E-MailRelay
|
A iterator that returns 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. 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 | |
void | operator= (const DirectoryIterator &)=delete |
DirectoryIterator & | operator= (DirectoryIterator &&) noexcept=default |
A iterator that returns filenames in a directory.
The iteration model is:
Definition at line 99 of file gdirectory.h.
|
explicit |
Constructor taking a directory reference.
Iterates over all files in the directory.
Definition at line 103 of file gdirectory_unix.cpp.
bool G::DirectoryIterator::error | ( | ) | const |
Returns true on error. The caller should stop the iteration.
Definition at line 111 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 126 of file gdirectory_unix.cpp.
G::Path G::DirectoryIterator::filePath | ( | ) | const |
Returns the path of the current item.
Definition at line 121 of file gdirectory_unix.cpp.
bool G::DirectoryIterator::isDir | ( | ) | const |
Returns true if the current item is a directory.
Definition at line 131 of file gdirectory_unix.cpp.
bool G::DirectoryIterator::more | ( | ) |
Returns true if more and advances by one.
Definition at line 116 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 136 of file gdirectory_unix.cpp.