DUtils::FileFunctions Class Reference
General functions to manipulate directories and files.
More...
#include <FileFunctions.h>
List of all members.
Static Public Member Functions |
static void | MkDir (const char *path) |
static void | RmDir (const char *path) |
static void | RmFile (const char *path) |
static bool | DirExists (const char *path) |
static bool | FileExists (const char *filename) |
static std::vector< std::string > | Dir (const char *path, const char *right, bool sorted=false) |
static std::string | FileName (const std::string filepath) |
static void | FileParts (const std::string filepath, std::string &path, std::string &filename, std::string &ext) |
Detailed Description
General functions to manipulate directories and files.
Member Function Documentation
std::vector< std::string > FileFunctions::Dir |
( |
const char * |
path, |
|
|
const char * |
right, |
|
|
bool |
sorted = false | |
|
) |
| | [static] |
Returns the relative path of the files located in the path given and whose right path of the name matches 'right'
- Parameters:
-
| path,: | path to directory |
| right,: | string like "_L.png" |
| sorted,: | if true, the files are sorted alphabetically |
- Returns:
- path list
bool FileFunctions::DirExists |
( |
const char * |
path |
) |
[static] |
Checks the existence of a folder
- Returns:
- true iff the directory exists
bool FileFunctions::FileExists |
( |
const char * |
filename |
) |
[static] |
Checks the existence of a file
- Returns:
- true iff the file exists
std::string FileFunctions::FileName |
( |
const std::string |
filepath |
) |
[static] |
Extracts the filename of the given path
- Parameters:
-
- Returns:
- file name
void FileFunctions::FileParts |
( |
const std::string |
filepath, |
|
|
std::string & |
path, |
|
|
std::string & |
filename, |
|
|
std::string & |
ext | |
|
) |
| | [static] |
Extracts the path, file name and extension of the given path
- Parameters:
-
| filepath | |
| path | (out): path to file |
| filename | (out): filename without extension or dot |
| ext | (out): extension without dot |
void FileFunctions::MkDir |
( |
const char * |
path |
) |
[static] |
Creates the directory 'path'. The parent directory must exist
- Parameters:
-
void FileFunctions::RmDir |
( |
const char * |
path |
) |
[static] |
Removes a directory and its content
- Parameters:
-
void FileFunctions::RmFile |
( |
const char * |
path |
) |
[static] |
Removes a file
- Parameters:
-
The documentation for this class was generated from the following files: