#include <UDirectory.h>
Class UDirectory.
This class can be used to get file names in a directory.
Definition at line 34 of file UDirectory.h.
◆ UDirectory() [1/2]
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. |
Definition at line 63 of file UDirectory.cpp.
◆ UDirectory() [2/2]
◆ ~UDirectory()
UDirectory::~UDirectory |
( |
| ) |
|
◆ currentDir()
Get the current directory.
- Parameters
-
trailingSeparator | If true, a '/' is added to the path. |
- Returns
- the current directory
Definition at line 309 of file UDirectory.cpp.
◆ exists()
Check if a directory exists.
- Parameters
-
dirPath | the directory path |
- Returns
- true if the directory exists
Definition at line 249 of file UDirectory.cpp.
◆ getDir()
Get the directory path of a file path.
- Parameters
-
- Returns
- the directory path of the file
Definition at line 273 of file UDirectory.cpp.
◆ 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.
◆ getNextFileName()
Get the next file name.
- Returns
- the next file name
Definition at line 221 of file UDirectory.cpp.
◆ getNextFilePath()
Get the next file path.
- Returns
- the next file path
Definition at line 232 of file UDirectory.cpp.
◆ homeDir()
Return the "home" directory.
- Returns
- the directory path.
Definition at line 355 of file UDirectory.cpp.
◆ isValid()
bool UDirectory::isValid |
( |
| ) |
|
Check is the directory exists.
- Returns
- if directory exists.
Definition at line 216 of file UDirectory.cpp.
◆ makeDir()
bool UDirectory::makeDir |
( |
const std::string & |
dirPath | ) |
|
|
static |
Make a directory.
- Parameters
-
dirPath | the directory path |
- Returns
- true on success, false otherwise.
Definition at line 333 of file UDirectory.cpp.
◆ operator=()
◆ removeDir()
bool UDirectory::removeDir |
( |
const std::string & |
dirPath | ) |
|
|
static |
Remove a directory.
- Parameters
-
dirPath | the directory path |
- Returns
- true on success, false otherwise.
Definition at line 344 of file UDirectory.cpp.
◆ rewind()
void UDirectory::rewind |
( |
| ) |
|
Return the pointer of file names to beginning.
Definition at line 243 of file UDirectory.cpp.
◆ separator()
Return \ (Win32) or / (Unix) depending of the platform.
Definition at line 391 of file UDirectory.cpp.
◆ setPath()
Set path of the directory.
- Parameters
-
path | the new directory path. |
Definition at line 95 of file UDirectory.cpp.
◆ update()
void UDirectory::update |
( |
| ) |
|
Update indexed file names (if the directory changed).
Definition at line 104 of file UDirectory.cpp.
◆ extensions_
◆ fileNames_
◆ iFileName_
◆ path_
The documentation for this class was generated from the following files: