|
"L. Spiro Engine"
|
High-level file functions. More...
#include <LSFFilesEx.h>
Static Public Member Functions | |
| static LSVOID LSE_CALL | InitFilesEx () |
| static LSVOID LSE_CALL | ShutDownFilesEx () |
| static LSBOOL LSE_CALL | LoadFileToMemory (const LSCHAR *_pcFile, LSUINT8 *&_pui8Buffer, LSUINTPTR *_puiptrSize, CStdAllocator *_psaAllocator=NULL) |
| static LSVOID LSE_CALL | FreeFile (LSUINT8 *_pui8Buffer, CStdAllocator *_psaAllocator=NULL) |
| static LSBOOL LSE_CALL | SendBufferToFile (const LSCHAR *_pcPath, const LSUINT8 *_pui8Buffer, LSUINTPTR _uiptrSize) |
Static Protected Attributes | |
| static CStdAllocator * | m_psaAllocator |
High-level file functions.
Class CFilesEx Description: Building off the low-level file routines, this class provides higher-level file functionality such as loading files to RAM.
| static LSVOID LSE_CALL lsf::CFilesEx::FreeFile | ( | LSUINT8 * | _pui8Buffer, |
| CStdAllocator * | _psaAllocator = NULL |
||
| ) | [static] |
Remove from RAM a file that was loaded via LoadFileToMemory().
| _pui8Buffer | The file data previously filled by a successful call to LoadFileToMemory(). |
| _psaAllocator | Optional pointer to the allocator used to allocate _pui8Buffer. This should be the same value that was passed to LoadFileToMemory(), even (especially) if NULL was passed. |
| static LSVOID LSE_CALL lsf::CFilesEx::InitFilesEx | ( | ) | [static] |
Initialize the extended file functionality. Required before LoadFileToMemory() and FreeFile() can be used with a NULL allocator.
| static LSBOOL LSE_CALL lsf::CFilesEx::LoadFileToMemory | ( | const LSCHAR * | _pcFile, |
| LSUINT8 *& | _pui8Buffer, | ||
| LSUINTPTR * | _puiptrSize, | ||
| CStdAllocator * | _psaAllocator = NULL |
||
| ) | [static] |
Load a file fully to RAM.
| _pcFile | Path to the file to load. Must be in UTF-8 format. |
| _pui8Buffer | Holds the returned file data. This buffer is allocated using _psaAllocator. |
| _puiptrSize | Optional value to hold the size of the loaded file. If not needed, set to NULL. |
| _psaAllocator | Optional pointer to the allocator to use to allocate _pui8Buffer. |
| static LSBOOL LSE_CALL lsf::CFilesEx::SendBufferToFile | ( | const LSCHAR * | _pcPath, |
| const LSUINT8 * | _pui8Buffer, | ||
| LSUINTPTR | _uiptrSize | ||
| ) | [static] |
Write a buffer to a file. If the file exists its contents are erased.
| _pcPath | Pointer to a string containing the path of the file to create. Its contents will be overwritten. |
| _pui8Buffer | The buffer to write to the given file path. |
| _uiptrSize | Number of bytes to write. |
| static LSVOID LSE_CALL lsf::CFilesEx::ShutDownFilesEx | ( | ) | [static] |
Shut down the extended file functionality when the engine closes.
CStdAllocator* lsf::CFilesEx::m_psaAllocator [static, protected] |
Default allocator.
1.7.3