![]() |
Blamite Game Engine - blam!
00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
|
Namespace containing functions related to caching. More...
Functions | |
std::string | WriteFileToCache (void *data, int length, std::string id) |
Writes a block of data to the cache as a file. More... | |
HRESULT | ReadFileFromCache (void **data, int *length, std::string id) |
Reads a file from the cache into memory. More... | |
HRESULT | DeleteFileFromCache (std::string id) |
Deletes a file from the local cache storage. More... | |
void | ClearCachedFiles () |
Clears all files from the cache. More... | |
Namespace containing functions related to caching.
void Blam::Cache::ClearCachedFiles | ( | ) |
Clears all files from the cache.
Will log to console if any files failed to be removed.
HRESULT Blam::Cache::DeleteFileFromCache | ( | std::string | id | ) |
Deletes a file from the local cache storage.
Will log an error to console if the file could not be removed.
HRESULT Blam::Cache::ReadFileFromCache | ( | void ** | data, |
int * | length, | ||
std::string | id | ||
) |
Reads a file from the cache into memory.
Memory allocation does not need to be performed prior to calling, as this function will call malloc() on its own.
data | - Pointer at which to write the memory. |
length | - Pointer at which to store the size of the data. |
id | - The ID of the cached data to read |
S_OK
if the file was loaded without error, will return E_FAIL
if no cached file could be found with the specified ID. std::string Blam::Cache::WriteFileToCache | ( | void * | data, |
int | length, | ||
std::string | id | ||
) |
Writes a block of data to the cache as a file.
data | - The data to put in the file |
length | - The size of the data in bytes |
id | - The ID of the cached data, used to retrieve the file later on |