Recast  1
Game with custom magic
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
FileUtils.hpp
Go to the documentation of this file.
1 //
2 // Created by Oleg Morozenkov on 02.06.17.
3 //
4 
5 #ifndef RECAST_FILEUTILS_H
6 #define RECAST_FILEUTILS_H
7 
8 #include <string>
9 #include <fstream>
10 #include <sstream>
11 
15 namespace FileUtils {
16 
23  inline std::string readFile(const std::string& fileName) {
24  std::ifstream file(fileName);
25  std::ostringstream output;
26  output << file.rdbuf();
27  return output.str();
28  }
29 
30 }
31 
32 #endif //RECAST_FILEUTILS_H
std::string readFile(const std::string &fileName)
Definition: FileUtils.hpp:23