diff options
author | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 01:56:42 +0300 |
---|---|---|
committer | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 01:56:42 +0300 |
commit | d47ee877be5d1175bdc36f2d87881ddaf875a8e9 (patch) | |
tree | 7fd20cdc1236fe6b832ae980de12afd7071ebab9 /src/tools/FileTools.cpp | |
parent | cea20d4078f2088dea0dd589f1cc9dd7ee22461b (diff) |
Refactor http clients, fix webhook server, add more samples, change tabs to 4 spaces
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; } }; |