mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
CommandLineParser: operator << for CompilerOutputs and CombinedJsonRequests
This commit is contained in:
@@ -176,6 +176,16 @@ bool CompilerOutputs::operator==(CompilerOutputs const& _other) const noexcept
|
||||
return true;
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& _out, CompilerOutputs const& _selection)
|
||||
{
|
||||
vector<string> serializedSelection;
|
||||
for (auto&& [componentName, component]: CompilerOutputs::componentMap())
|
||||
if (_selection.*component)
|
||||
serializedSelection.push_back(CompilerOutputs::componentName(component));
|
||||
|
||||
return _out << joinHumanReadable(serializedSelection, ",");
|
||||
}
|
||||
|
||||
string const& CompilerOutputs::componentName(bool CompilerOutputs::* _component)
|
||||
{
|
||||
solAssert(_component, "");
|
||||
@@ -196,6 +206,17 @@ bool CombinedJsonRequests::operator==(CombinedJsonRequests const& _other) const
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
ostream& operator<<(ostream& _out, CombinedJsonRequests const& _requests)
|
||||
{
|
||||
vector<string> serializedRequests;
|
||||
for (auto&& [componentName, component]: CombinedJsonRequests::componentMap())
|
||||
if (_requests.*component)
|
||||
serializedRequests.push_back(CombinedJsonRequests::componentName(component));
|
||||
|
||||
return _out << joinHumanReadable(serializedRequests, ",");
|
||||
}
|
||||
|
||||
string const& CombinedJsonRequests::componentName(bool CombinedJsonRequests::* _component)
|
||||
{
|
||||
solAssert(_component, "");
|
||||
|
||||
Reference in New Issue
Block a user