aboutsummaryrefslogtreecommitdiffstats
path: root/src/iomanager.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-08-06 17:03:05 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-08-06 17:07:43 +0100
commitf7ce70d139effc5553c4ed2fa604724413b9d9b2 (patch)
tree5a05620ed6a65cf999b4ea0f3976b803b44504c8 /src/iomanager.cpp
parent932537776012c33dcdb6ae34dbb419f13717804d (diff)
downloadYAGE-f7ce70d139effc5553c4ed2fa604724413b9d9b2.tar.gz
YAGE-f7ce70d139effc5553c4ed2fa604724413b9d9b2.zip
Adding clang format with my style based on google
Diffstat (limited to 'src/iomanager.cpp')
-rw-r--r--src/iomanager.cpp51
1 files changed, 25 insertions, 26 deletions
diff --git a/src/iomanager.cpp b/src/iomanager.cpp
index bcb1dcd0..6059bfbc 100644
--- a/src/iomanager.cpp
+++ b/src/iomanager.cpp
@@ -11,30 +11,29 @@
#include <fstream>
#include <stdexcept>
-namespace yage
-{
-
-bool IoManager::readFileToBuffer(const std::string &file_path, std::vector<unsigned char> &buffer)
-{
- std::ifstream file(file_path, std::ios::binary);
- if(!file.is_open())
- throw std::runtime_error("Could not open '"+file_path+"'");
-
- // seek to the end
- file.seekg(0, std::ios::end);
-
- // get the file size
- int file_size = file.tellg();
- file.seekg(0, std::ios::beg);
-
- // reduce file size by header bytes
- file_size -= file.tellg();
-
- buffer.resize(file_size);
- file.read((char *)&buffer[0], file_size);
- file.close();
-
- return true;
+namespace yage {
+
+bool IoManager::readFileToBuffer(const std::string& file_path,
+ std::vector<unsigned char>& buffer) {
+ std::ifstream file(file_path, std::ios::binary);
+ if (!file.is_open())
+ throw std::runtime_error("Could not open '" + file_path + "'");
+
+ // seek to the end
+ file.seekg(0, std::ios::end);
+
+ // get the file size
+ int file_size = file.tellg();
+ file.seekg(0, std::ios::beg);
+
+ // reduce file size by header bytes
+ file_size -= file.tellg();
+
+ buffer.resize(file_size);
+ file.read((char*)&buffer[0], file_size);
+ file.close();
+
+ return true;
}
-
-} // yage
+
+} // yage