Contains some useful routines for manipulating files.
|
static void | appendToFile (const char *szFilename, const char *szString) |
| Appends szString to the specified file. (This is a convenient method for logging. It is not efficient, because it does not keep the file open.) More...
|
|
static char * | clipFilename (char *szBuff) |
| This finds the last slash in szBuff and sets it to '\0' and returns szBuff. More...
|
|
static const char * | clipPath (const char *szBuff) |
| This finds the last slash in szBuff and returns a pointer to the char past that. (If there are no slashes or back-slashes, it returns szBuff) More...
|
|
static void | condensePath (char *szPath) |
| Remove extra ".." folders in the path. More...
|
|
static bool | copyFile (const char *szSrcPath, const char *szDestPath) |
| This copies a file. It doesn't check to see if it is overwriting–it just does the copying. On success it returns true. On error it returns false. It won't work with a file bigger than 2GB. Both paths must include the filename. More...
|
|
static bool | deleteFile (const char *szFilename) |
| Deletes the specified file. Returns true iff successful. More...
|
|
static bool | doesDirExist (const char *szDir) |
| returns true if the directory exists More...
|
|
static bool | doesFileExist (const char *filename) |
| returns true if the file exists More...
|
|
static void | fileList (std::vector< std::string > &list, const char *dir=".") |
| Adds the names of all the files (excluding folders) in the specified directory to "list". The filenames do not include any path information. More...
|
|
static void | fileListRecursive (std::vector< std::string > &list, const char *dir=".") |
| Produces a list of all the files in "dir" recursively. Relative paths to all the files will be added to the list. More...
|
|
static void | folderList (std::vector< std::string > &list, const char *dir=".", bool excludeDots=true) |
| Adds the names of all the folders in the specified directory to "list". If excludeDots is true, then folders named "." or ".." will be excluded. The folder names do not include any path information. More...
|
|
static void | folderListRecursive (std::vector< std::string > &list, const char *dir=".") |
| Produces a list of all the folders in "dir" recursively, including "dir". Relative paths to all the folders will be added to the list. "dir" is guaranteed to be the first item in the list. More...
|
|
static char * | loadFile (const char *szFilename, size_t *pnSize) |
| Loads a file into memory and returns a pointer to the memory. You must delete the buffer it returns. More...
|
|
static bool | localStorageDirectory (char *toHere) |
| returns a user's home directory for the various OS's More...
|
|
static bool | makeDir (const char *szDir) |
| This is a brute force way to make a directory. It iterates through each subdir in szDir and calls mkdir until it has created the complete set of nested directories. More...
|
|
static time_t | modifiedTime (const char *szFilename) |
| This returns the number of seconds since 1970 UTC. More...
|
|
static void | parsePath (const char *szPath, struct PathData *pData) |
| Identifies the folder, file, extension, and total length from a path. More...
|
|
static bool | removeDir (const char *szDir) |
| Removes the specified directory. Fails if it is not empty. Returns true iff successful. More...
|
|
static void | saveFile (const char *pBuf, size_t nSize, const char *szFilename) |
| Saves a buffer as a file. Returns true on success. More...
|
|
static void | setModifiedTime (const char *filename, time_t t) |
| Set the last modified time of a file. More...
|
|
static void | tempFilename (char *pBuf) |
| returns a temporary filename More...
|
|