Class for reading filenames in a directory.
More...
#include <Radiant/Directory.hpp>
Class for reading filenames in a directory.
This class exists because there exists no portable way to read directories (which is sad).
- Author
- Esa Nuuros
- Examples:
- PostProcessingExample.cpp.
Flags to filter directory contents.
| Enumerator |
|---|
| DIRS |
Accept directories.
|
| FILES |
Accept Files.
|
| NO_DOT_AND_DOTDOT |
Do not accept "." or "..".
|
| HIDDEN |
Accept hidden files/directories.
|
| SYSTEM |
Accept system system files.
|
| ALL_ENTRIES |
Accept everything.
|
Flags to sort files.
| Enumerator |
|---|
| NAME |
Sort by name.
|
| NOT_SORTED |
Do not sort.
|
Construct a directory listing Creating a Directory object immediately scans the contents of the directory.
Entries matching the given filters are included.
- Parameters
-
| pathname | directory path |
| filters | one or more filter flags OR'ed together |
| sortFlag | flag indicating how the results should be sorted |
Construct a directory listing Creating a Directory object immediately scans the contents of the directory.
Entries matching the given filters are included.
- Parameters
-
| pathname | directory path |
| suffixlist | list of accpeted suffices, for example "jpg,png,tiff" |
| filters | one or more filter flags OR'ed together |
| sortFlag | flag indicating how the results should be sorted |
| int Radiant::Directory::count |
( |
| ) |
const |
| static bool Radiant::Directory::exists |
( |
const QString & |
dir | ) |
|
|
static |
Checks if the given directory exists.
- Parameters
-
- Returns
- True if exists, false otherwise
| QString Radiant::Directory::fileName |
( |
int |
n | ) |
const |
Return given entry name in the directory.
- Parameters
-
| n | index of item in selected sorting scheme |
- Returns
- filename of selected item
| QString Radiant::Directory::fileNameWithPath |
( |
int |
n | ) |
const |
Get the full path name of the nth file.
This method is equal to concatenation of strings returned by path and fileName.
- Parameters
-
- Returns
- full path to the requested file
- Examples:
- PostProcessingExample.cpp.
Create a directory listing with MIME pattern filtering.
- Parameters
-
| pathname | path of the directory |
| mimePattern | mime pattern for files to match |
| filters | one or more filters flags |
| sortFlag | flag indicating how the results are sorted |
- Returns
- directory object with the matching filters
- Examples:
- HelloImagesExample.cpp, PositionalSoundsExample.cpp, and SamplePlayerExample.cpp.
| static bool Radiant::Directory::mkdir |
( |
const QString & |
dirname | ) |
|
|
static |
Creates a new directory.
- Parameters
-
| dirname | Name of the directory to create |
- Returns
- True if creation succeeded, false otherwise
| static bool Radiant::Directory::mkdirRecursive |
( |
const QString & |
path | ) |
|
|
static |
Creates a new directory recursively.
- Parameters
-
| path | Path to new directory |
- Returns
- True if succeeded, false otherwise
| const QString& Radiant::Directory::path |
( |
| ) |
const |
|
inline |
Returns the directory path.
- Returns
- Path to the directory