#include <gdirectory.h>
Public Member Functions | |
DirectoryIterator (const Directory &dir, const std::string &wc) | |
Constructor taking a directory reference and a wildcard specification. More... | |
DirectoryIterator (const Directory &dir) | |
Constructor taking a directory reference. More... | |
~DirectoryIterator () | |
Destructor. More... | |
bool | error () const |
Returns true on error. The caller should stop the iteration. More... | |
bool | more () |
Returns true if more and advances by one. More... | |
bool | isDir () const |
Returns true if the current item is a directory. More... | |
std::string | modificationTimeString () const |
Returns the last-modified time for the file in an undefined format – used for comparison. More... | |
std::string | sizeString () const |
Returns the file size as a decimal string. More... | |
Path | filePath () const |
Returns the path of the current item. More... | |
Path | fileName () const |
Returns the name of the current item. More... | |
A Directory iterator.
The iteration model is
Definition at line 108 of file gdirectory.h.
G::DirectoryIterator::DirectoryIterator | ( | const Directory & | dir, |
const std::string & | wc | ||
) |
Constructor taking a directory reference and a wildcard specification.
Iterates over all matching files in the directory.
This constructor overload may not be implemented on all platforms, so prefer DirectoryList::readType() where possible.
Definition at line 74 of file gdirectory_unix_glob.cpp.
|
explicit |
Constructor taking a directory reference.
Iterates over all files in the directory.
Definition at line 69 of file gdirectory_unix_glob.cpp.
G::DirectoryIterator::~DirectoryIterator | ( | ) |
Destructor.
Definition at line 118 of file gdirectory_unix_glob.cpp.
bool G::DirectoryIterator::error | ( | ) | const |
Returns true on error. The caller should stop the iteration.
Definition at line 83 of file gdirectory_unix_glob.cpp.
Referenced by filter_run(), and G::DirectoryList::readType().
G::Path G::DirectoryIterator::fileName | ( | ) | const |
Returns the name of the current item.
Definition at line 98 of file gdirectory_unix_glob.cpp.
Referenced by filter_run(), and G::DirectoryList::readType().
G::Path G::DirectoryIterator::filePath | ( | ) | const |
Returns the path of the current item.
Definition at line 93 of file gdirectory_unix_glob.cpp.
Referenced by filter_run(), and G::DirectoryList::readType().
bool G::DirectoryIterator::isDir | ( | ) | const |
Returns true if the current item is a directory.
Definition at line 103 of file gdirectory_unix_glob.cpp.
Referenced by filter_run(), and G::DirectoryList::readType().
std::string G::DirectoryIterator::modificationTimeString | ( | ) | const |
Returns the last-modified time for the file in an undefined format – used for comparison.
Definition at line 108 of file gdirectory_unix_glob.cpp.
bool G::DirectoryIterator::more | ( | ) |
Returns true if more and advances by one.
Definition at line 88 of file gdirectory_unix_glob.cpp.
Referenced by filter_run(), and G::DirectoryList::readType().
std::string G::DirectoryIterator::sizeString | ( | ) | const |
Returns the file size as a decimal string.
The value may be more than 32 bits. See also class G::Number.
Definition at line 113 of file gdirectory_unix_glob.cpp.