DDraceNetwork Documentation
Loading...
Searching...
No Matches
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

bool Init (EInitializationType InitializationType, int NumArgs, const char **ppArguments)
 
bool LoadPathsFromFile (const char *pArgv0)
 
bool AddDefaultPaths ()
 
bool AddPath (const char *pPath)
 
void FindUserDirectory ()
 
void FindDataDirectory (const char *pArgv0)
 
bool FindCurrentDirectory ()
 
void FindBinaryDirectory (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 charGetPath (int Type, const char *pDir, char *pBuffer, unsigned BufferSize) const
 
void TranslateType (int &Type, const char *pPath) const
 
IOHANDLE OpenFile (const char *pFilename, int Flags, int Type, char *pBuffer=nullptr, int BufferSize=0) override
 
template<typename F >
bool GenericExists (const char *pFilename, int Type, F &&CheckFunction) const
 
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
 
charReadFileStr (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 charGetBinaryPath (const char *pFilename, char *pBuffer, unsigned BufferSize) override
 
const charGetBinaryPathAbsolute (const char *pFilename, char *pBuffer, unsigned BufferSize) override
 
- Public Member Functions inherited from IInterface
 IInterface ()
 
virtual void Shutdown ()
 
virtual ~IInterface ()=default
 

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 (EInitializationType InitializationType, int NumArgs, const char **ppArguments)
 
- Static Public Member Functions inherited from IStorage
static const charInterfaceName ()
 
static void StripPathAndExtension (const char *pFilename, char *pBuffer, int BufferSize)
 
static const charFormatTmpPath (char *aBuf, unsigned BufSize, const char *pPath)
 

Private Attributes

char m_aaStoragePaths [MAX_PATHS][IO_MAX_PATH_LENGTH]
 
int m_NumPaths = 0
 
char m_aUserdir [IO_MAX_PATH_LENGTH] = ""
 
char m_aDatadir [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
}
 
enum class  EInitializationType { BASIC , SERVER , CLIENT }
 
- Protected Member Functions inherited from IInterface
IKernelKernel ()
 

Member Function Documentation

◆ AddDefaultPaths()

bool CStorage::AddDefaultPaths ( )
inline

◆ AddPath()

bool 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 ( EInitializationType  InitializationType,
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.

◆ FindBinaryDirectory()

void CStorage::FindBinaryDirectory ( const char pArgv0)
inline

◆ FindCurrentDirectory()

bool CStorage::FindCurrentDirectory ( )
inline

◆ FindDataDirectory()

void CStorage::FindDataDirectory ( 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

◆ FindUserDirectory()

void CStorage::FindUserDirectory ( )
inline

◆ 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 
) const
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 
) const
inline

◆ Init()

bool CStorage::Init ( EInitializationType  InitializationType,
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

◆ LoadPathsFromFile()

bool CStorage::LoadPathsFromFile ( 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 = nullptr,
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 
) const
inline

Member Data Documentation

◆ m_aaStoragePaths

char CStorage::m_aaStoragePaths[MAX_PATHS][IO_MAX_PATH_LENGTH]
private

◆ m_aBinarydir

char CStorage::m_aBinarydir[IO_MAX_PATH_LENGTH] = ""
private

◆ m_aCurrentdir

char CStorage::m_aCurrentdir[IO_MAX_PATH_LENGTH] = ""
private

◆ m_aDatadir

char CStorage::m_aDatadir[IO_MAX_PATH_LENGTH] = ""
private

◆ m_aUserdir

char CStorage::m_aUserdir[IO_MAX_PATH_LENGTH] = ""
private

◆ m_NumPaths

int CStorage::m_NumPaths = 0
private

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