mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Split out the JSON functionality from assembly.stream()
This commit is contained in:
1 parent
55d2a459a9
commit
a535a8b06e
10 files changed
+67
-46
No files matched your search
@@ -347,18 +347,28 @@ eth::LinkerObject const& CompilerStack::cloneObject(string const& _contractName)
|
||||
return contract(_contractName).cloneObject;
|
||||
}
|
||||
|
||||
Json::Value CompilerStack::streamAssembly(ostream& _outStream, string const& _contractName, StringMap _sourceCodes, bool _inJsonFormat) const
|
||||
ostream& CompilerStack::assemblyStream(ostream& _outStream, string const& _contractName, StringMap _sourceCodes) const
|
||||
{
|
||||
Contract const& currentContract = contract(_contractName);
|
||||
if (currentContract.compiler)
|
||||
return currentContract.compiler->streamAssembly(_outStream, _sourceCodes, _inJsonFormat);
|
||||
return currentContract.compiler->assemblyStream(_outStream, _sourceCodes);
|
||||
else
|
||||
{
|
||||
_outStream << "Contract not fully implemented" << endl;
|
||||
return Json::Value();
|
||||
return _outStream;
|
||||
}
|
||||
}
|
||||
|
||||
/// FIXME: cache the JSON
|
||||
Json::Value CompilerStack::assemblyJSON(string const& _contractName, StringMap _sourceCodes) const
|
||||
{
|
||||
Contract const& currentContract = contract(_contractName);
|
||||
if (currentContract.compiler)
|
||||
return currentContract.compiler->assemblyJSON(_sourceCodes);
|
||||
else
|
||||
return Json::Value();
|
||||
}
|
||||
|
||||
vector<string> CompilerStack::sourceNames() const
|
||||
{
|
||||
vector<string> names;
|
||||
|
||||
Reference in new issue
Block a user