3#ifndef ENGINE_STORAGE_H
4#define ENGINE_STORAGE_H
52 virtual IOHANDLE OpenFile(
const char *pFilename,
int Flags,
int Type,
char *pBuffer =
nullptr,
int BufferSize = 0) = 0;
53 virtual bool FileExists(
const char *pFilename,
int Type) = 0;
55 virtual bool ReadFile(
const char *pFilename,
int Type,
void **ppResult,
unsigned *pResultLen) = 0;
56 virtual char *
ReadFileStr(
const char *pFilename,
int Type) = 0;
57 virtual bool RetrieveTimes(
const char *pFilename,
int Type, time_t *pCreated, time_t *pModified) = 0;
59 virtual bool FindFile(
const char *pFilename,
const char *pPath,
int Type,
char *pBuffer,
int BufferSize) = 0;
60 virtual size_t FindFiles(
const char *pFilename,
const char *pPath,
int Type, std::set<std::string> *pEntries) = 0;
61 virtual bool RemoveFile(
const char *pFilename,
int Type) = 0;
63 virtual bool RenameFile(
const char *pOldFilename,
const char *pNewFilename,
int Type) = 0;
65 virtual void GetCompletePath(
int Type,
const char *pDir,
char *pBuffer,
unsigned BufferSize) = 0;
69 virtual const char *
GetBinaryPath(
const char *pFilename,
char *pBuffer,
unsigned BufferSize) = 0;
73 static const char *
FormatTmpPath(
char *aBuf,
unsigned BufSize,
const char *pPath);
virtual void ListDirectory(int Type, const char *pPath, FS_LISTDIR_CALLBACK pfnCallback, void *pUser)=0
virtual const char * GetBinaryPath(const char *pFilename, char *pBuffer, unsigned BufferSize)=0
virtual bool FolderExists(const char *pFilename, int Type)=0
virtual bool RenameBinaryFile(const char *pOldFilename, const char *pNewFilename)=0
virtual const char * GetBinaryPathAbsolute(const char *pFilename, char *pBuffer, unsigned BufferSize)=0
virtual char * ReadFileStr(const char *pFilename, int Type)=0
virtual bool RenameFile(const char *pOldFilename, const char *pNewFilename, int Type)=0
virtual IOHANDLE OpenFile(const char *pFilename, int Flags, int Type, char *pBuffer=nullptr, int BufferSize=0)=0
virtual bool FileExists(const char *pFilename, int Type)=0
static void StripPathAndExtension(const char *pFilename, char *pBuffer, int BufferSize)
Definition: storage.cpp:879
static const char * FormatTmpPath(char *aBuf, unsigned BufSize, const char *pPath)
Definition: storage.cpp:901
virtual bool RemoveFolder(const char *pFilename, int Type)=0
virtual bool CalculateHashes(const char *pFilename, int Type, SHA256_DIGEST *pSha256, unsigned *pCrc=nullptr)=0
virtual bool FindFile(const char *pFilename, const char *pPath, int Type, char *pBuffer, int BufferSize)=0
virtual bool CreateFolder(const char *pFoldername, int Type)=0
virtual bool RetrieveTimes(const char *pFilename, int Type, time_t *pCreated, time_t *pModified)=0
virtual bool ReadFile(const char *pFilename, int Type, void **ppResult, unsigned *pResultLen)=0
virtual bool RemoveFile(const char *pFilename, int Type)=0
virtual void GetCompletePath(int Type, const char *pDir, char *pBuffer, unsigned BufferSize)=0
virtual int NumPaths() const =0
virtual size_t FindFiles(const char *pFilename, const char *pPath, int Type, std::set< std::string > *pEntries)=0
virtual void ListDirectoryInfo(int Type, const char *pPath, FS_LISTDIR_CALLBACK_FILEINFO pfnCallback, void *pUser)=0
virtual bool RemoveBinaryFile(const char *pFilename)=0
@ TYPE_ABSOLUTE
Definition: storage.h:27
@ STORAGETYPE_CLIENT
Definition: storage.h:45
@ TYPE_ALL_OR_ABSOLUTE
Definition: storage.h:41
@ STORAGETYPE_BASIC
Definition: storage.h:43
@ TYPE_ALL
Definition: storage.h:26
@ TYPE_SAVE_OR_ABSOLUTE
Definition: storage.h:34
@ STORAGETYPE_SERVER
Definition: storage.h:44
@ TYPE_SAVE
Definition: storage.h:25
#define MACRO_INTERFACE(Name)
Definition: kernel.h:25
void * IOHANDLE
Definition: logger.h:11
IStorage * CreateTempStorage(const char *pDirectory)
Definition: storage.cpp:926
IStorage * CreateStorage(int StorageType, int NumArgs, const char **ppArguments)
Definition: storage.cpp:907
IStorage * CreateLocalStorage()
Definition: storage.cpp:912
@ MAX_PATHS
Definition: storage.h:16
int(* FS_LISTDIR_CALLBACK_FILEINFO)(const CFsFileInfo *info, int is_dir, int dir_type, void *user)
Definition: types.h:29
int(* FS_LISTDIR_CALLBACK)(const char *name, int is_dir, int dir_type, void *user)
Definition: types.h:20