diff options
author | Oleg Morozenkov <reo7sp@users.noreply.github.com> | 2017-03-21 18:50:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 18:50:45 +0300 |
commit | 4d9e96d9c91e1faeefb67de2164c026f84be020e (patch) | |
tree | 60af55841a59d7af13bb492d248e0744478e8056 /src/tools/FileTools.cpp | |
parent | 1c7d4c17062644d28f485b0ff6cbc213e975ac29 (diff) | |
parent | 156c087f3eeeeffb949ae6a572dd7b52815eb0e5 (diff) |
Merge pull request #43 from kukin-konstantin/master
fix errors and new function
Diffstat (limited to 'src/tools/FileTools.cpp')
-rw-r--r-- | src/tools/FileTools.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/FileTools.cpp b/src/tools/FileTools.cpp index e92e96d..14c322c 100644 --- a/src/tools/FileTools.cpp +++ b/src/tools/FileTools.cpp @@ -22,4 +22,14 @@ std::string read(const std::string& filePath) { throw errno; } +bool write(const std::string& content, const std::string& filePath) { + ofstream out(filePath, ios::out | ios::binary); + if (out) { + out << content; + out.close(); + return true; + } + return false; +} + }; |