2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#ifndef ENGINE_STORAGE_H
|
|
|
|
#define ENGINE_STORAGE_H
|
|
|
|
|
|
|
|
#include "kernel.h"
|
|
|
|
|
|
|
|
class IStorage : public IInterface
|
|
|
|
{
|
|
|
|
MACRO_INTERFACE("storage", 0)
|
|
|
|
public:
|
|
|
|
enum
|
|
|
|
{
|
2010-10-06 21:07:35 +00:00
|
|
|
TYPE_SAVE = 0,
|
2012-01-09 00:38:45 +00:00
|
|
|
TYPE_ALL = -1,
|
|
|
|
|
|
|
|
STORAGETYPE_BASIC = 0,
|
|
|
|
STORAGETYPE_SERVER,
|
|
|
|
STORAGETYPE_CLIENT,
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-10-06 21:07:35 +00:00
|
|
|
virtual void ListDirectory(int Type, const char *pPath, FS_LISTDIR_CALLBACK pfnCallback, void *pUser) = 0;
|
|
|
|
virtual IOHANDLE OpenFile(const char *pFilename, int Flags, int Type, char *pBuffer = 0, int BufferSize = 0) = 0;
|
2011-02-21 10:23:30 +00:00
|
|
|
virtual bool FindFile(const char *pFilename, const char *pPath, int Type, char *pBuffer, int BufferSize) = 0;
|
2010-10-06 21:07:35 +00:00
|
|
|
virtual bool RemoveFile(const char *pFilename, int Type) = 0;
|
2010-12-07 23:09:18 +00:00
|
|
|
virtual bool RenameFile(const char* pOldFilename, const char* pNewFilename, int Type) = 0;
|
2010-10-16 16:33:54 +00:00
|
|
|
virtual bool CreateFolder(const char *pFoldername, int Type) = 0;
|
2012-01-08 12:14:02 +00:00
|
|
|
virtual void GetCompletePath(int Type, const char *pDir, char *pBuffer, unsigned BufferSize) = 0;
|
2015-03-14 19:01:18 +00:00
|
|
|
|
|
|
|
virtual bool RemoveBinaryFile(const char *pFilename) = 0;
|
|
|
|
virtual bool RenameBinaryFile(const char* pOldFilename, const char* pNewFilename) = 0;
|
|
|
|
virtual const char* GetBinaryPath(const char *pDir, char *pBuffer, unsigned BufferSize) = 0;
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
|
2012-01-09 00:38:45 +00:00
|
|
|
extern IStorage *CreateStorage(const char *pApplicationName, int StorageType, int NumArgs, const char **ppArguments);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|