Deepsolver
|
The iterator over the files and subdirectories. More...
Public Types | |
typedef std::shared_ptr< Iterator > | Ptr |
Public Member Functions | |
std::string | fullPath () const |
Returns the name of the directory item this iterator is pointing to with all parent directories. | |
Iterator (const std::string &path, DIR *dir) | |
The constructor. | |
bool | moveNext () |
Moves the iterator to next item. | |
std::string | name () const |
Returns the name of the directory item this iterator is pointing to. | |
virtual | ~Iterator () |
The destructor. |
This class enumerates all items in the directory. Each item can be examined both as just the name of a file and as a full path with all parent directories.
The iterator is created pointed before the first item. Hence, a user has to call moveNext() method at least once to be able call methods providing item information.
Deepsolver::Directory::Iterator::Iterator | ( | const std::string & | path, |
DIR * | dir | ||
) | [inline] |
[in] | path | The name of the directory to be used for proper full path construction |
[in] | dir | The valid directory handle to read data from |
std::string Directory::Iterator::fullPath | ( | ) | const |
bool Deepsolver::Directory::Iterator::moveNext | ( | ) |
This method moves the iterator to the first item on its first invocation or to the next on each consequent. The method returns zero if next item does not exist. If method returns zero on first call that means the directory is empty.
std::string Directory::Iterator::name | ( | ) | const |