00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CSUTIL_VFSCACHE_H__
00020 #define __CSUTIL_VFSCACHE_H__
00021
00022 #include "iutil/cache.h"
00023
00024 struct iObjectRegistry;
00025 struct iVFS;
00026
00030 class csVfsCacheManager : public iCacheManager
00031 {
00032 private:
00033 iObjectRegistry* object_reg;
00034 char* vfsdir;
00035 char* current_type;
00036 char* current_scope;
00037 iVFS* vfs;
00038
00039 iVFS* GetVFS ();
00040
00041 void CacheName (char* buf, const char* type, const char* scope,
00042 uint32 id);
00043
00044 public:
00049 csVfsCacheManager (iObjectRegistry* object_reg, const char* vfsdir);
00050
00051 virtual ~csVfsCacheManager ();
00052
00053 SCF_DECLARE_IBASE;
00054
00055 virtual void SetCurrentType (const char* type);
00056 virtual const char* GetCurrentType () const { return current_type; }
00057 virtual void SetCurrentScope (const char* scope);
00058 virtual const char* GetCurrentScope () const { return current_scope; }
00059 virtual bool CacheData (void* data, uint32 size,
00060 const char* type, const char* scope, uint32 id);
00061 virtual iDataBuffer* ReadCache (const char* type, const char* scope,
00062 uint32 id);
00063 virtual bool ClearCache (const char* type = NULL, const char* scope = NULL,
00064 const uint32* id = NULL);
00065 };
00066
00067 #endif // __CSUTIL_VFSCACHE_H__
00068