aboutsummaryrefslogtreecommitdiffstats
path: root/yage/base/iomanager.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-10-31 22:11:18 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-10-31 22:11:18 +0000
commitf776df6076725d14679b31168e3ede53c966182e (patch)
treeb843d7ef0d0722a1b3571ee09aa1345d19c60e7f /yage/base/iomanager.cpp
parent1bb0ef8960c71ef505a351702bec54c01ba15e22 (diff)
downloadYAGE-f776df6076725d14679b31168e3ede53c966182e.tar.gz
YAGE-f776df6076725d14679b31168e3ede53c966182e.zip
renaming base folder
Diffstat (limited to 'yage/base/iomanager.cpp')
-rw-r--r--yage/base/iomanager.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/yage/base/iomanager.cpp b/yage/base/iomanager.cpp
deleted file mode 100644
index d5b950d6..00000000
--- a/yage/base/iomanager.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ----------------------------------------------------------------------------
- * iomanager.cpp
- *
- * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
- * See file LICENSE for more details
- * ----------------------------------------------------------------------------
- */
-
-#include <yage/base/iomanager.h>
-
-#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