00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CS_UTIL_VFSCACHE_H__
00020 #define __CS_UTIL_VFSCACHE_H__
00021
00025 #include "iutil/cache.h"
00026
00027 struct iObjectRegistry;
00028 struct iVFS;
00029
00033 class csVfsCacheManager : public iCacheManager
00034 {
00035 private:
00036 iObjectRegistry* object_reg;
00037 char* vfsdir;
00038 char* current_type;
00039 char* current_scope;
00040 csRef<iVFS> vfs;
00041
00042 iVFS* GetVFS ();
00043
00044 void CacheName (char* buf, const char* type, const char* scope,
00045 uint32 id);
00046
00047 public:
00052 csVfsCacheManager (iObjectRegistry* object_reg, const char* vfsdir);
00053
00054 virtual ~csVfsCacheManager ();
00055
00056 SCF_DECLARE_IBASE;
00057
00061 virtual void SetCurrentType (const char* type);
00065 virtual const char* GetCurrentType () const { return current_type; }
00069 virtual void SetCurrentScope (const char* scope);
00073 virtual const char* GetCurrentScope () const { return current_scope; }
00077 virtual bool CacheData (void* data, uint32 size,
00078 const char* type, const char* scope, uint32 id);
00083 virtual csPtr<iDataBuffer> ReadCache (const char* type, const char* scope,
00084 uint32 id);
00088 virtual bool ClearCache (const char* type = NULL, const char* scope = NULL,
00089 const uint32* id = NULL);
00090 };
00091
00092 #endif // __CS_UTIL_VFSCACHE_H__
00093