![]() |
Public API Reference |
![]() |
This is a general cache that can cache data on VFS. More...
#include <csutil/vfscache.h>
Public Member Functions | |
virtual bool | CacheData (const void *data, size_t size, const char *type, const char *scope, uint32 id) |
Cache some data. | |
virtual bool | ClearCache (const char *type=0, const char *scope=0, const uint32 *id=0) |
Clear items from the cache. | |
csVfsCacheManager (iObjectRegistry *object_reg, const char *vfsdir) | |
Construct the cache manager with the given directory. | |
virtual void | Flush () |
Flush VFS. | |
virtual const char * | GetCurrentScope () const |
Get current scope or 0 if none set. | |
virtual const char * | GetCurrentType () const |
Get current type or 0 if none set. | |
virtual bool | IsReadOnly () const |
Is the cache manager read-only? | |
virtual csPtr< iDataBuffer > | ReadCache (const char *type, const char *scope, uint32 id) |
Retrieve some data from the cache. | |
virtual void | SetCurrentScope (const char *scope) |
Set current scope. | |
virtual void | SetCurrentType (const char *type) |
Set current type. | |
virtual void | SetReadOnly (bool ro) |
Force the cache manager to be read-only. |
This is a general cache that can cache data on VFS.
Definition at line 36 of file vfscache.h.
csVfsCacheManager::csVfsCacheManager | ( | iObjectRegistry * | object_reg, |
const char * | vfsdir | ||
) |
Construct the cache manager with the given directory.
All cached data will be put somewhere in that directory.
virtual bool csVfsCacheManager::CacheData | ( | const void * | data, |
size_t | size, | ||
const char * | type, | ||
const char * | scope, | ||
uint32 | id | ||
) | [virtual] |
virtual bool csVfsCacheManager::ClearCache | ( | const char * | type = 0 , |
const char * | scope = 0 , |
||
const uint32 * | id = 0 |
||
) | [virtual] |
Clear items from the cache.
Implements iCacheManager.
virtual void csVfsCacheManager::Flush | ( | ) | [virtual] |
Flush VFS.
Implements iCacheManager.
virtual const char* csVfsCacheManager::GetCurrentScope | ( | ) | const [inline, virtual] |
Get current scope or 0 if none set.
Implements iCacheManager.
Definition at line 80 of file vfscache.h.
virtual const char* csVfsCacheManager::GetCurrentType | ( | ) | const [inline, virtual] |
Get current type or 0 if none set.
Implements iCacheManager.
Definition at line 72 of file vfscache.h.
virtual bool csVfsCacheManager::IsReadOnly | ( | ) | const [inline, virtual] |
virtual csPtr<iDataBuffer> csVfsCacheManager::ReadCache | ( | const char * | type, |
const char * | scope, | ||
uint32 | id | ||
) | [virtual] |
Retrieve some data from the cache.
Returns 0 if the data could not be found in the cache.
Implements iCacheManager.
virtual void csVfsCacheManager::SetCurrentScope | ( | const char * | scope | ) | [virtual] |
Set current scope.
Implements iCacheManager.
virtual void csVfsCacheManager::SetCurrentType | ( | const char * | type | ) | [virtual] |
Set current type.
Implements iCacheManager.
virtual void csVfsCacheManager::SetReadOnly | ( | bool | ro | ) | [inline, virtual] |
Force the cache manager to be read-only.
This will prevent updates of the cache but CacheData() will still return true to indicate success.
Implements iCacheManager.
Definition at line 62 of file vfscache.h.