diff options
Diffstat (limited to 'src/tools/FileTools.cpp')
-rw-r--r-- | src/tools/FileTools.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/tools/FileTools.cpp b/src/tools/FileTools.cpp index 105d80f..279f152 100644 --- a/src/tools/FileTools.cpp +++ b/src/tools/FileTools.cpp @@ -12,24 +12,24 @@ using namespace std; namespace FileTools { string read(const string& filePath) { - ifstream in(filePath, ios::in | ios::binary); - if (!in) { - throw system_error(errno, system_category()); - } - ostringstream contents; - contents << in.rdbuf(); - in.close(); - return contents.str(); + ifstream in(filePath, ios::in | ios::binary); + if (!in) { + throw system_error(errno, system_category()); + } + ostringstream contents; + contents << in.rdbuf(); + in.close(); + return contents.str(); } bool write(const string& content, const string& filePath) { - ofstream out(filePath, ios::out | ios::binary); - if (!out) { - return false; - } - out << content; - out.close(); - return true; + ofstream out(filePath, ios::out | ios::binary); + if (!out) { + return false; + } + out << content; + out.close(); + return true; } }; |