mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add readStandardInput helper
This commit is contained in:
@@ -66,6 +66,20 @@ string dev::readFileAsString(string const& _file)
|
||||
return readFile<string>(_file);
|
||||
}
|
||||
|
||||
string dev::readStandardInput()
|
||||
{
|
||||
string ret;
|
||||
while (!cin.eof())
|
||||
{
|
||||
string tmp;
|
||||
// NOTE: this will read until EOF or NL
|
||||
getline(cin, tmp);
|
||||
ret.append(tmp);
|
||||
ret.append("\n");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void dev::writeFile(std::string const& _file, bytesConstRef _data, bool _writeDeleteRename)
|
||||
{
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
Reference in New Issue
Block a user