#include <UDirectory.h>
List of all members.
Public Member Functions |
| UDirectory (const std::string &path="", const std::string &extensions="") |
void | setPath (const std::string &path, const std::string &extensions="") |
void | update () |
bool | isValid () |
std::string | getNextFileName () |
const std::list< std::string > & | getFileNames () const |
void | rewind () |
Static Public Member Functions |
static bool | exists (const std::string &dirPath) |
static std::string | getDir (const std::string &filePath) |
static std::string | currentDir (bool trailingSeparator=false) |
static bool | makeDir (const std::string &dirPath) |
static bool | removeDir (const std::string &dirPath) |
static std::string | homeDir () |
static std::string | separator () |
Detailed Description
Class UDirectory.
This class can be used to get file names in a directory.
Constructor & Destructor Documentation
Create a UDirectory object with path initialized to an existing "path" and with filter "extensions".
- Parameters:
-
path | the path to an existing directory |
extensions | filter to get only file names with the extensions specified, format is a list of extensions separated by a space: "jpg bmp" get only file names finishing by jpg or bmp. |
Member Function Documentation
Get the current directory.
- Parameters:
-
trailingSeparator | If true, a '/' is added to the path. |
- Returns:
- the current directory
Check if a directory exists.
- Parameters:
-
dirPath | the directory path |
- Returns:
- true if the directory exists
Get the directory path of a file path.
- Parameters:
-
- Returns:
- the directory path of the file
Get all file names.
- See also:
- UDirectory()
- Returns:
- all the file names in directory matching the set extensions.
Get the next file name.
- Returns:
- the next file name
Return the "home" directory.
- Returns:
- the directory path.
Check is the directory exists.
- Returns:
- if directory exists.
Make a directory.
- Parameters:
-
dirPath | the directory path |
- Returns:
- true on success, false otherwise.
Remove a directory.
- Parameters:
-
dirPath | the directory path |
- Returns:
- true on success, false otherwise.
Return the pointer of file names to beginning.
Return \ (Win32) or / (Unix) depending of the platform.
Set path of the directory.
- Parameters:
-
path | the new directory path. |
Update indexed file names (if the directory changed).
The documentation for this class was generated from the following files: