Raw data file loader.
More...
#include <cppassist/include/cppassist/fs/RawFile.h>
Raw data file loader.
This class allows for loading raw data (e.g., textures) from files. You have to exactly know how to interpret the content of the file, e.g., you need to know the format and size of the texture, the file does not provide this information. To create raw textures, you can use for example glraw (https://github.com/cginternals/glraw).
◆ RawFile()
cppassist::RawFile::RawFile |
( |
| ) |
|
◆ ~RawFile()
cppassist::RawFile::~RawFile |
( |
| ) |
|
◆ load()
bool cppassist::RawFile::load |
( |
const std::string & |
filePath | ) |
|
Load file contents.
- Parameters
-
[in] | filePath | Path to the file to load |
- Returns
true
if file contents could be loaded successfully, else false
◆ reload()
bool cppassist::RawFile::reload |
( |
| ) |
|
Reload file contents.
- Returns
true
if file contents could be loaded successfully, else false
◆ data()
const char* cppassist::RawFile::data |
( |
| ) |
const |
Get plain C pointer to file contents.
- Returns
- Plain C pointer to file contents if successfully loaded,
nullptr
else
◆ size()
size_t cppassist::RawFile::size |
( |
| ) |
const |
Get number of bytes in file.
- Returns
- Number of bytes in file if successfully loaded, 0 else
◆ isValid()
bool cppassist::RawFile::isValid |
( |
| ) |
const |
Get validity of file contents.
- Returns
true
if file contents could be loaded successfully, else false
◆ filePath()
const std::string& cppassist::RawFile::filePath |
( |
| ) |
const |
Get file path.
- Returns
- File path
◆ readFile()
bool cppassist::RawFile::readFile |
( |
| ) |
|
|
protected |
Load contents from file path.
- Returns
true
if file contents could be loaded successfully, else false
◆ m_filePath
std::string cppassist::RawFile::m_filePath |
|
protected |
◆ m_data
std::string cppassist::RawFile::m_data |
|
protected |
◆ m_valid
bool cppassist::RawFile::m_valid |
|
protected |
Validity of loaded file contents.
The documentation for this class was generated from the following file: