BARE2D
BARE2D::IOManager Class Reference

#include <IOManager.hpp>

Static Public Member Functions

template<typename T >
static bool readFileToBuffer (std::string &filepath, std::vector< T > &buf, std::ios_base::openmode mode=std::ios::binary)
 Loads a file into a buffer. More...
 
static bool readFileToBuffer (const char *filepath, std::string &buf, std::ios_base::openmode mode=std::ios::binary)
 

Detailed Description

Definition at line 9 of file IOManager.hpp.

Member Function Documentation

◆ readFileToBuffer() [1/2]

bool BARE2D::IOManager::readFileToBuffer ( const char *  filepath,
std::string &  buf,
std::ios_base::openmode  mode = std::ios::binary 
)
static
Parameters
mode= std::ios::binary

Definition at line 9 of file IOManager.cpp.

References BARE2D::Logger::getInstance(), and BARE2D::Logger::log().

+ Here is the call graph for this function:

◆ readFileToBuffer() [2/2]

template<typename T >
static bool BARE2D::IOManager::readFileToBuffer ( std::string &  filepath,
std::vector< T > &  buf,
std::ios_base::openmode  mode = std::ios::binary 
)
static

Loads a file into a buffer.

Parameters
filepathThe filepath to be read from
bufThe buffer to read to
Returns
Returns false if there was a problem reading the file, true otherwise.

Referenced by BARE2D::ShaderProgram::compileShaders(), BARE2D::ResourceManager::loadScript(), and BARE2D::ResourceManager::loadTexture().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: