aboutsummaryrefslogtreecommitdiffstats
path: root/libdevcore/CommonIO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libdevcore/CommonIO.cpp')
-rw-r--r--libdevcore/CommonIO.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp
index eb7af83e..8c7e08f6 100644
--- a/libdevcore/CommonIO.cpp
+++ b/libdevcore/CommonIO.cpp
@@ -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;