From 52fae93d2903fc606bb0c4347a994a1b1285835b Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 6 Apr 2018 15:38:13 +0100 Subject: Fixing documentation and building --- yage/core/iomanager.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'yage/core/iomanager.cpp') diff --git a/yage/core/iomanager.cpp b/yage/core/iomanager.cpp index 3d9ea7cb..487ef8a9 100644 --- a/yage/core/iomanager.cpp +++ b/yage/core/iomanager.cpp @@ -10,11 +10,14 @@ #include #include +#include namespace yage { -bool IoManager::readFileToBuffer(const std::string &file_path, +namespace IoManager { + +bool readFileToBuffer(const std::string &file_path, std::vector &buffer) { std::ifstream file(file_path, std::ios::binary); @@ -39,4 +42,11 @@ bool IoManager::readFileToBuffer(const std::string &file_path, return true; } +std::string parentDirectory(std::string file_path) +{ + return std::regex_replace(file_path, std::regex("(.*)/.*"), "$1"); +} + +} + } // namespace yage -- cgit