E-MailRelay
|
A iterator that returns unsorted filenames in a directory. More...
#include <gdirectory.h>
Public Member Functions | |
DirectoryIterator (const Directory &dir) | |
Constructor taking a directory reference. More... | |
~DirectoryIterator () | |
Destructor. | |
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 or a symlink to a directory. More... | |
bool | isLink () const |
Returns true if the current item is a symlink. 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... | |
std::string | fileName () const |
Returns the name of the current item. More... | |
DirectoryIterator (const DirectoryIterator &)=delete | |
DirectoryIterator (DirectoryIterator &&) noexcept=default | |
DirectoryIterator & | operator= (const DirectoryIterator &)=delete |
DirectoryIterator & | operator= (DirectoryIterator &&) noexcept=default |
A iterator that returns unsorted filenames in a directory.
The iteration model is:
Definition at line 98 of file gdirectory.h.
|
explicit |
Constructor taking a directory reference.
Iterates over all files in the directory.
Definition at line 105 of file gdirectory_unix.cpp.
bool G::DirectoryIterator::error | ( | ) | const |
Returns true on error. The caller should stop the iteration.
Definition at line 113 of file gdirectory_unix.cpp.
std::string G::DirectoryIterator::fileName | ( | ) | const |
Returns the name of the current item.
On Windows any characters that cannot be represented in the active code page are replaced by '?'.
Definition at line 128 of file gdirectory_unix.cpp.
G::Path G::DirectoryIterator::filePath | ( | ) | const |
Returns the path of the current item.
Definition at line 123 of file gdirectory_unix.cpp.
bool G::DirectoryIterator::isDir | ( | ) | const |
Returns true if the current item is a directory or a symlink to a directory.
Definition at line 138 of file gdirectory_unix.cpp.
bool G::DirectoryIterator::isLink | ( | ) | const |
Returns true if the current item is a symlink.
Definition at line 133 of file gdirectory_unix.cpp.
bool G::DirectoryIterator::more | ( | ) |
Returns true if more and advances by one.
Definition at line 118 of file gdirectory_unix.cpp.
std::string G::DirectoryIterator::sizeString | ( | ) | const |
Returns the file size as a decimal string.
The value may be bigger than any integer type can hold.
Definition at line 144 of file gdirectory_unix.cpp.