|
@ -59,8 +59,6 @@ enum class DocumentationType: uint8_t |
|
|
ABISolidityInterface |
|
|
ABISolidityInterface |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
extern const std::map<std::string, std::string> StandardSources; |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Easy to use and self-contained Solidity compiler with as few header dependencies as possible. |
|
|
* Easy to use and self-contained Solidity compiler with as few header dependencies as possible. |
|
|
* It holds state and can be used to either step through the compilation stages (and abort e.g. |
|
|
* It holds state and can be used to either step through the compilation stages (and abort e.g. |
|
@ -74,7 +72,7 @@ public: |
|
|
|
|
|
|
|
|
/// Adds a source object (e.g. file) to the parser. After this, parse has to be called again.
|
|
|
/// Adds a source object (e.g. file) to the parser. After this, parse has to be called again.
|
|
|
/// @returns true if a source object by the name already existed and was replaced.
|
|
|
/// @returns true if a source object by the name already existed and was replaced.
|
|
|
void addSources(std::map<std::string, std::string> const& _nameContents, bool _isLibrary = false) { for (auto const& i: _nameContents) addSource(i.first, i.second, _isLibrary); } |
|
|
void addSources(StringMap const& _nameContents, bool _isLibrary = false) { for (auto const& i: _nameContents) addSource(i.first, i.second, _isLibrary); } |
|
|
bool addSource(std::string const& _name, std::string const& _content, bool _isLibrary = false); |
|
|
bool addSource(std::string const& _name, std::string const& _content, bool _isLibrary = false); |
|
|
void setSource(std::string const& _sourceCode); |
|
|
void setSource(std::string const& _sourceCode); |
|
|
/// Parses all source units that were added
|
|
|
/// Parses all source units that were added
|
|
@ -103,8 +101,9 @@ public: |
|
|
dev::h256 getContractCodeHash(std::string const& _contractName = "") const; |
|
|
dev::h256 getContractCodeHash(std::string const& _contractName = "") const; |
|
|
|
|
|
|
|
|
/// Streams a verbose version of the assembly to @a _outStream.
|
|
|
/// Streams a verbose version of the assembly to @a _outStream.
|
|
|
|
|
|
/// @arg _sourceCodes is the map of input files to source code strings
|
|
|
/// Prerequisite: Successful compilation.
|
|
|
/// Prerequisite: Successful compilation.
|
|
|
void streamAssembly(std::ostream& _outStream, std::string const& _contractName = "") const; |
|
|
void streamAssembly(std::ostream& _outStream, std::string const& _contractName = "", StringMap _sourceCodes = StringMap()) const; |
|
|
|
|
|
|
|
|
/// Returns a string representing the contract interface in JSON.
|
|
|
/// Returns a string representing the contract interface in JSON.
|
|
|
/// Prerequisite: Successful call to parse or compile.
|
|
|
/// Prerequisite: Successful call to parse or compile.
|
|
|