#include <UDirectory.h>
|
| 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 () |
| |
Class UDirectory.
This class can be used to get file names in a directory.
Definition at line 34 of file UDirectory.h.
◆ UDirectory()
| UDirectory::UDirectory |
( |
const std::string & |
path = "", |
|
|
const std::string & |
extensions = "" |
|
) |
| |
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. |
◆ exists()
| static bool UDirectory::exists |
( |
const std::string & |
dirPath | ) |
|
|
static |
Check if a directory exists.
- Parameters
-
| dirPath | the directory path |
- Returns
- true if the directory exists
◆ getDir()
| static std::string UDirectory::getDir |
( |
const std::string & |
filePath | ) |
|
|
static |
Get the directory path of a file path.
- Parameters
-
- Returns
- the directory path of the file
◆ currentDir()
| static std::string UDirectory::currentDir |
( |
bool |
trailingSeparator = false | ) |
|
|
static |
Get the current directory.
- Parameters
-
| trailingSeparator | If true, a '/' is added to the path. |
- Returns
- the current directory
◆ makeDir()
| static bool UDirectory::makeDir |
( |
const std::string & |
dirPath | ) |
|
|
static |
Make a directory.
- Parameters
-
| dirPath | the directory path |
- Returns
- true on success, false otherwise.
◆ removeDir()
| static bool UDirectory::removeDir |
( |
const std::string & |
dirPath | ) |
|
|
static |
Remove a directory.
- Parameters
-
| dirPath | the directory path |
- Returns
- true on success, false otherwise.
◆ homeDir()
| static std::string UDirectory::homeDir |
( |
| ) |
|
|
static |
Return the "home" directory.
- Returns
- the directory path.
◆ separator()
| static std::string UDirectory::separator |
( |
| ) |
|
|
static |
Return \ (Win32) or / (Unix) depending of the platform.
◆ setPath()
| void UDirectory::setPath |
( |
const std::string & |
path, |
|
|
const std::string & |
extensions = "" |
|
) |
| |
Set path of the directory.
- Parameters
-
| path | the new directory path. |
◆ update()
| void UDirectory::update |
( |
| ) |
|
Update indexed file names (if the directory changed).
◆ isValid()
| bool UDirectory::isValid |
( |
| ) |
|
Check is the directory exists.
- Returns
- if directory exists.
◆ getNextFileName()
| std::string UDirectory::getNextFileName |
( |
| ) |
|
Get the next file name.
- Returns
- the next file name
◆ getNextFilePath()
| std::string UDirectory::getNextFilePath |
( |
| ) |
|
Get the next file path.
- Returns
- the next file path
◆ getFileNames()
| const std::list< std::string > & UDirectory::getFileNames |
( |
| ) |
const |
|
inline |
Get all file names.
- See also
- UDirectory()
- Returns
- all the file names in directory matching the set extensions.
Definition at line 129 of file UDirectory.h.
◆ rewind()
| void UDirectory::rewind |
( |
| ) |
|
Return the pointer of file names to beginning.
The documentation for this class was generated from the following file: