|
static void | TrimString (std::string &str) |
|
static bool | FileExistRaw (const char *filename) |
|
static bool | AddDiskSearchPath (const std::string &sFile, bool nFront=false) |
| this is low level, use with care. More...
|
|
static bool | FileExist (const char *filename) |
| check if file exist, this function is cross platform. More...
|
|
static bool | FileExist2 (const char *filename, std::string *pDiskFile=NULL) |
| check if file exist, this function is cross platform. More...
|
|
static void | MakeFileNameFromRelativePath (char *output, const char *filename, const char *relativePath) |
| make a standard filename. More...
|
|
static bool | MoveFile (const char *src, const char *dest) |
| The MoveFile function will move (rename) either a file or a directory (including its children) either in the same directory or across directories. More...
|
|
static bool | CopyFile (const char *src, const char *dest, bool bOverride) |
| The CopyFile function copies an existing file to a new file. More...
|
|
static std::string | GetParentDirectoryFromPath (const std::string &sfilename, int nParentCounts=0) |
| trim the sFile by nParentCounts number of parent directories. More...
|
|
static bool | MakeDirectoryFromFilePath (const char *filename) |
| make directory More...
|
|
static bool | SaveBufferToFile (const std::string &filename, bool bReplace, char *buffer, DWORD nBufSize) |
| extract this para file to disk More...
|
|
static bool | DeleteFile (const char *filename) |
| delete a given file
|
|
static int | DeleteDirectory (const char *dirname) |
| delete a given directory, regardless of whether it's empty or not
|
|
static int | DeleteFiles (const std::string &sFilePattern, bool bSecureFolderOnly=true, int nSubFolderCount=10) |
| delete a given file. More...
|
|
static std::string | GetWritableFullPathForFilename (const std::string &filename) |
| if already absolute path, return it, if not we will prepend current writable path. More...
|
|
static std::string | GetFileName (const std::string &sFilePath) |
| get file name
|
|
static FileData | GetDataFromFile (const char *filename) |
| Creates binary data from a file. More...
|
|
static std::string | GetStringFromFile (const std::string &filename) |
|
static bool | GetFileInfo (const char *filename, CParaFileInfo &fileInfo) |
| get file size of a disk file in bytes. More...
|
|
static FileData | GetResDataFromFile (const std::string &filename) |
| data need not be released, since it is from the resource file. More...
|
|
static bool | DoesResFileExist (const std::string &filename) |
| whether the resource file exist
|
|
static void | AddEmbeddedResource (const char *name, const char *buffer, size_t nSize) |
| add an embedded resource, the resource is usually from extern static const char* of the executable. More...
|
|
static std::string | GetFullPathForFilename (const std::string &filename) |
| get fullPath for filename
|
|
static bool | IsAbsolutePath (const std::string &path) |
| Checks whether the path is an absolute path. More...
|
|
static int | GetFileSize (const char *sFilePath) |
| get file size of a disk file in bytes. More...
|
|
static FileHandle | OpenFile (const char *sFilePath, bool bRead=false, bool bWrite=true) |
| open file and return the file handle. More...
|
|
static bool | SetFilePointer (FileHandle &fileHandle, int lDistanceToMove, int dwMoveMethod) |
| The SetFilePointer function moves the file pointer of an open file. More...
|
|
static int | GetFilePosition (FileHandle &fileHandle) |
| get the current file pointer position. More...
|
|
static bool | SetEndOfFile (FileHandle &fileHandle) |
| The SetEndOfFile function moves the end-of-file (EOF) position for the specified file to the current position of the file pointer.This function can be used to truncate or extend a file. More...
|
|
static int | WriteBytes (FileHandle &fileHandle, const void *src, int bytes) |
| Write byte stream to file the file must be opened with write access.
|
|
static int | ReadBytes (FileHandle &fileHandle, void *dest, int bytes) |
| read byte stream from file the file must be opened with read access.
|
|
static void | CloseFile (FileHandle &fileHandle) |
| close the given file
|
|
static std::string | GetInitialDirectory () |
| get current directory
|
|
static const std::string & | GetWritablePath () |
| in win32, this is the root directory, Gets the writable path. More...
|
|
static void | SetWritablePath (const std::string &writable_path) |
| not thread safe, only set at startup when there is just one thread running. More...
|
|
static void | FindDiskFiles (CSearchResult &result, const std::string &sRootPath, const std::string &sFilePattern, int nSubLevel) |
| this is a recursive function. More...
|
|
file platform related API and helper functions