![]() |
Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Reads a file, then gives read-only access to the contents. More...
#include <Filesystem.h>
Public Member Functions | |
| CVFSFile () | |
| ~CVFSFile () | |
| PSRETURN | Load (const PIVFS &vfs, const VfsPath &filename, bool log=true) |
| Returns either PSRETURN_OK or PSRETURN_CVFSFile_LoadFailed. More... | |
| const std::uint8_t * | GetBuffer () const |
| Returns buffer of this file as a stream of bytes. More... | |
| size_t | GetBufferSize () const |
| CStr8 | GetAsString () const |
| Returns contents of file as a string. More... | |
| CStr8 | DecodeUTF8 () const |
| Returns contents of a UTF-8 encoded file as a string with optional BOM removed. More... | |
Private Attributes | |
| std::unique_ptr< std::uint8_t[], AlignedDeleter > | m_Buffer |
| size_t | m_BufferSize |
Reads a file, then gives read-only access to the contents.
| CVFSFile::CVFSFile | ( | ) |
| CVFSFile::~CVFSFile | ( | ) |
| CStr CVFSFile::DecodeUTF8 | ( | ) | const |
Returns contents of a UTF-8 encoded file as a string with optional BOM removed.
| CStr CVFSFile::GetAsString | ( | ) | const |
Returns contents of file as a string.
| const std::uint8_t * CVFSFile::GetBuffer | ( | ) | const |
Returns buffer of this file as a stream of bytes.
| size_t CVFSFile::GetBufferSize | ( | ) | const |
Returns either PSRETURN_OK or PSRETURN_CVFSFile_LoadFailed.
| log | Whether to log a failure to load a file |
|
private |
|
private |