DDraceNetwork Docs
CStorage Class Reference
Inheritance diagram for CStorage:
[legend]
Collaboration diagram for CStorage:
[legend]

Classes

struct  CFindCBData
 
struct  SFindFilesCallbackData
 
struct  SListDirectoryInfoUniqueCallbackData
 
struct  SListDirectoryUniqueCallbackData
 

Public Member Functions

 CStorage ()
 
int Init (int StorageType, int NumArgs, const char **ppArguments)
 
void LoadPaths (const char *pArgv0)
 
void AddDefaultPaths ()
 
void AddPath (const char *pPath)
 
void FindDatadir (const char *pArgv0)
 
void FindBinarydir (const char *pArgv0)
 
int NumPaths () const override
 
void ListDirectoryInfo (int Type, const char *pPath, FS_LISTDIR_CALLBACK_FILEINFO pfnCallback, void *pUser) override
 
void ListDirectory (int Type, const char *pPath, FS_LISTDIR_CALLBACK pfnCallback, void *pUser) override
 
const char * GetPath (int Type, const char *pDir, char *pBuffer, unsigned BufferSize)
 
void TranslateType (int &Type, const char *pPath)
 
IOHANDLE OpenFile (const char *pFilename, int Flags, int Type, char *pBuffer=0, int BufferSize=0) override
 
template<typename F >
bool GenericExists (const char *pFilename, int Type, F &&CheckFunction)
 
bool FileExists (const char *pFilename, int Type) override
 
bool FolderExists (const char *pFilename, int Type) override
 
bool ReadFile (const char *pFilename, int Type, void **ppResult, unsigned *pResultLen) override
 
char * ReadFileStr (const char *pFilename, int Type) override
 
bool RetrieveTimes (const char *pFilename, int Type, time_t *pCreated, time_t *pModified) override
 
bool CalculateHashes (const char *pFilename, int Type, SHA256_DIGEST *pSha256, unsigned *pCrc) override
 
bool FindFile (const char *pFilename, const char *pPath, int Type, char *pBuffer, int BufferSize) override
 
size_t FindFiles (const char *pFilename, const char *pPath, int Type, std::set< std::string > *pEntries) override
 
bool RemoveFile (const char *pFilename, int Type) override
 
bool RemoveFolder (const char *pFilename, int Type) override
 
bool RemoveBinaryFile (const char *pFilename) override
 
bool RenameFile (const char *pOldFilename, const char *pNewFilename, int Type) override
 
bool RenameBinaryFile (const char *pOldFilename, const char *pNewFilename) override
 
bool CreateFolder (const char *pFoldername, int Type) override
 
void GetCompletePath (int Type, const char *pDir, char *pBuffer, unsigned BufferSize) override
 
const char * GetBinaryPath (const char *pFilename, char *pBuffer, unsigned BufferSize) override
 
const char * GetBinaryPathAbsolute (const char *pFilename, char *pBuffer, unsigned BufferSize) override
 
virtual int NumPaths () const =0
 
virtual void ListDirectory (int Type, const char *pPath, FS_LISTDIR_CALLBACK pfnCallback, void *pUser)=0
 
virtual void ListDirectoryInfo (int Type, const char *pPath, FS_LISTDIR_CALLBACK_FILEINFO pfnCallback, void *pUser)=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
 
virtual bool FolderExists (const char *pFilename, int Type)=0
 
virtual bool ReadFile (const char *pFilename, int Type, void **ppResult, unsigned *pResultLen)=0
 
virtual char * ReadFileStr (const char *pFilename, int Type)=0
 
virtual bool RetrieveTimes (const char *pFilename, int Type, time_t *pCreated, time_t *pModified)=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 size_t FindFiles (const char *pFilename, const char *pPath, int Type, std::set< std::string > *pEntries)=0
 
virtual bool RemoveFile (const char *pFilename, int Type)=0
 
virtual bool RemoveFolder (const char *pFilename, int Type)=0
 
virtual bool RenameFile (const char *pOldFilename, const char *pNewFilename, int Type)=0
 
virtual bool CreateFolder (const char *pFoldername, int Type)=0
 
virtual void GetCompletePath (int Type, const char *pDir, char *pBuffer, unsigned BufferSize)=0
 
virtual bool RemoveBinaryFile (const char *pFilename)=0
 
virtual bool RenameBinaryFile (const char *pOldFilename, const char *pNewFilename)=0
 
virtual const char * GetBinaryPath (const char *pFilename, char *pBuffer, unsigned BufferSize)=0
 
virtual const char * GetBinaryPathAbsolute (const char *pFilename, char *pBuffer, unsigned BufferSize)=0
 
- Public Member Functions inherited from IInterface
 IInterface ()
 
virtual void Shutdown ()
 
virtual ~IInterface ()
 

Static Public Member Functions

static int ListDirectoryInfoUniqueCallback (const CFsFileInfo *pInfo, int IsDir, int Type, void *pUser)
 
static int ListDirectoryUniqueCallback (const char *pName, int IsDir, int Type, void *pUser)
 
static int FindFileCallback (const char *pName, int IsDir, int Type, void *pUser)
 
static int FindFilesCallback (const char *pName, int IsDir, int Type, void *pUser)
 
static IStorageCreate (int StorageType, int NumArgs, const char **ppArguments)
 
- Static Public Member Functions inherited from IStorage
static const char * InterfaceName ()
 
static void StripPathAndExtension (const char *pFilename, char *pBuffer, int BufferSize)
 
static const char * FormatTmpPath (char *aBuf, unsigned BufSize, const char *pPath)
 

Public Attributes

char m_aaStoragePaths [MAX_PATHS][IO_MAX_PATH_LENGTH]
 
int m_NumPaths
 
char m_aDatadir [IO_MAX_PATH_LENGTH]
 
char m_aUserdir [IO_MAX_PATH_LENGTH]
 
char m_aCurrentdir [IO_MAX_PATH_LENGTH]
 
char m_aBinarydir [IO_MAX_PATH_LENGTH]
 

Additional Inherited Members

- Public Types inherited from IStorage
enum  {
  TYPE_SAVE = 0 , TYPE_ALL = -1 , TYPE_ABSOLUTE = -2 , TYPE_SAVE_OR_ABSOLUTE = -3 ,
  TYPE_ALL_OR_ABSOLUTE = -4 , STORAGETYPE_BASIC = 0 , STORAGETYPE_SERVER , STORAGETYPE_CLIENT
}
 
- Protected Member Functions inherited from IInterface
IKernelKernel ()
 

Constructor & Destructor Documentation

◆ CStorage()

CStorage::CStorage ( )
inline

Member Function Documentation

◆ AddDefaultPaths()

void CStorage::AddDefaultPaths ( )
inline

◆ AddPath()

void CStorage::AddPath ( const char *  pPath)
inline

◆ CalculateHashes()

bool CStorage::CalculateHashes ( const char *  pFilename,
int  Type,
SHA256_DIGEST pSha256,
unsigned *  pCrc 
)
inlineoverridevirtual

Implements IStorage.

◆ Create()

static IStorage * CStorage::Create ( int  StorageType,
int  NumArgs,
const char **  ppArguments 
)
inlinestatic

◆ CreateFolder()

bool CStorage::CreateFolder ( const char *  pFoldername,
int  Type 
)
inlineoverridevirtual

Implements IStorage.

◆ FileExists()

bool CStorage::FileExists ( const char *  pFilename,
int  Type 
)
inlineoverridevirtual

Implements IStorage.

◆ FindBinarydir()

void CStorage::FindBinarydir ( const char *  pArgv0)
inline

◆ FindDatadir()

void CStorage::FindDatadir ( const char *  pArgv0)
inline

◆ FindFile()

bool CStorage::FindFile ( const char *  pFilename,
const char *  pPath,
int  Type,
char *  pBuffer,
int  BufferSize 
)
inlineoverridevirtual

Implements IStorage.

◆ FindFileCallback()

static int CStorage::FindFileCallback ( const char *  pName,
int  IsDir,
int  Type,
void *  pUser 
)
inlinestatic

◆ FindFiles()

size_t CStorage::FindFiles ( const char *  pFilename,
const char *  pPath,
int  Type,
std::set< std::string > *  pEntries 
)
inlineoverridevirtual

Implements IStorage.

◆ FindFilesCallback()

static int CStorage::FindFilesCallback ( const char *  pName,
int  IsDir,
int  Type,
void *  pUser 
)
inlinestatic

◆ FolderExists()

bool CStorage::FolderExists ( const char *  pFilename,
int  Type 
)
inlineoverridevirtual

Implements IStorage.

◆ GenericExists()

template<typename F >
bool CStorage::GenericExists ( const char *  pFilename,
int  Type,
F &&  CheckFunction 
)
inline

◆ GetBinaryPath()

const char * CStorage::GetBinaryPath ( const char *  pFilename,
char *  pBuffer,
unsigned  BufferSize 
)
inlineoverridevirtual

Implements IStorage.

◆ GetBinaryPathAbsolute()

const char * CStorage::GetBinaryPathAbsolute ( const char *  pFilename,
char *  pBuffer,
unsigned  BufferSize 
)
inlineoverridevirtual

Implements IStorage.

◆ GetCompletePath()

void CStorage::GetCompletePath ( int  Type,
const char *  pDir,
char *  pBuffer,
unsigned  BufferSize 
)
inlineoverridevirtual

Implements IStorage.

◆ GetPath()

const char * CStorage::GetPath ( int  Type,
const char *  pDir,
char *  pBuffer,
unsigned  BufferSize 
)
inline

◆ Init()

int CStorage::Init ( int  StorageType,
int  NumArgs,
const char **  ppArguments 
)
inline

◆ ListDirectory()

void CStorage::ListDirectory ( int  Type,
const char *  pPath,
FS_LISTDIR_CALLBACK  pfnCallback,
void *  pUser 
)
inlineoverridevirtual

Implements IStorage.

◆ ListDirectoryInfo()

void CStorage::ListDirectoryInfo ( int  Type,
const char *  pPath,
FS_LISTDIR_CALLBACK_FILEINFO  pfnCallback,
void *  pUser 
)
inlineoverridevirtual

Implements IStorage.

◆ ListDirectoryInfoUniqueCallback()

static int CStorage::ListDirectoryInfoUniqueCallback ( const CFsFileInfo pInfo,
int  IsDir,
int  Type,
void *  pUser 
)
inlinestatic

◆ ListDirectoryUniqueCallback()

static int CStorage::ListDirectoryUniqueCallback ( const char *  pName,
int  IsDir,
int  Type,
void *  pUser 
)
inlinestatic

◆ LoadPaths()

void CStorage::LoadPaths ( const char *  pArgv0)
inline

◆ NumPaths()

int CStorage::NumPaths ( ) const
inlineoverridevirtual

Implements IStorage.

◆ OpenFile()

IOHANDLE CStorage::OpenFile ( const char *  pFilename,
int  Flags,
int  Type,
char *  pBuffer = 0,
int  BufferSize = 0 
)
inlineoverridevirtual

Implements IStorage.

◆ ReadFile()

bool CStorage::ReadFile ( const char *  pFilename,
int  Type,
void **  ppResult,
unsigned *  pResultLen 
)
inlineoverridevirtual

Implements IStorage.

◆ ReadFileStr()

char * CStorage::ReadFileStr ( const char *  pFilename,
int  Type 
)
inlineoverridevirtual

Implements IStorage.

◆ RemoveBinaryFile()

bool CStorage::RemoveBinaryFile ( const char *  pFilename)
inlineoverridevirtual

Implements IStorage.

◆ RemoveFile()

bool CStorage::RemoveFile ( const char *  pFilename,
int  Type 
)
inlineoverridevirtual

Implements IStorage.

◆ RemoveFolder()

bool CStorage::RemoveFolder ( const char *  pFilename,
int  Type 
)
inlineoverridevirtual

Implements IStorage.

◆ RenameBinaryFile()

bool CStorage::RenameBinaryFile ( const char *  pOldFilename,
const char *  pNewFilename 
)
inlineoverridevirtual

Implements IStorage.

◆ RenameFile()

bool CStorage::RenameFile ( const char *  pOldFilename,
const char *  pNewFilename,
int  Type 
)
inlineoverridevirtual

Implements IStorage.

◆ RetrieveTimes()

bool CStorage::RetrieveTimes ( const char *  pFilename,
int  Type,
time_t *  pCreated,
time_t *  pModified 
)
inlineoverridevirtual

Implements IStorage.

◆ TranslateType()

void CStorage::TranslateType ( int &  Type,
const char *  pPath 
)
inline

Member Data Documentation

◆ m_aaStoragePaths

char CStorage::m_aaStoragePaths[MAX_PATHS][IO_MAX_PATH_LENGTH]

◆ m_aBinarydir

char CStorage::m_aBinarydir[IO_MAX_PATH_LENGTH]

◆ m_aCurrentdir

char CStorage::m_aCurrentdir[IO_MAX_PATH_LENGTH]

◆ m_aDatadir

char CStorage::m_aDatadir[IO_MAX_PATH_LENGTH]

◆ m_aUserdir

char CStorage::m_aUserdir[IO_MAX_PATH_LENGTH]

◆ m_NumPaths

int CStorage::m_NumPaths

The documentation for this class was generated from the following file: