cxxtools::DirectoryIterator Class Reference

Iterates over entries of a directory. More...

#include <cxxtools/directory.h>

Public Member Functions

 DirectoryIterator ()
 Default constructor.
 DirectoryIterator (const std::string &path, bool skipHiden=false)
 Constructs an iterator pointing at the file given by a path.
 DirectoryIterator (const DirectoryIterator &it)
 Copy constructor.
 ~DirectoryIterator ()
 Destructor.
DirectoryIteratoroperator++ ()
 Advances the iterator to the next file.
DirectoryIteratoroperator= (const DirectoryIterator &it)
 Assignment operator.
bool operator== (const DirectoryIterator &it) const
 Equality comparison.
bool operator!= (const DirectoryIterator &it) const
 Inequality comparison.
const std::string & path () const
 Returns the full path of the file the iterator points at.
const std::string & operator* () const
 Returns the name of the file the iterator points at.
const std::string * operator-> () const

Detailed Description

Iterates over entries of a directory.

A DirectoryIterator is created by the Directory class and can be used as follows:

for (cxxtools::DirectoryIterator it = d.begin(); it != d.end(); ++it)
{
std::cout << "name: " << *it << std::endl;
}

Constructor & Destructor Documentation

cxxtools::DirectoryIterator::DirectoryIterator ( )

Default constructor.

cxxtools::DirectoryIterator::DirectoryIterator ( const std::string &  path,
bool  skipHiden = false 
)

Constructs an iterator pointing at the file given by a path.

cxxtools::DirectoryIterator::DirectoryIterator ( const DirectoryIterator it)

Copy constructor.

cxxtools::DirectoryIterator::~DirectoryIterator ( )

Destructor.

Member Function Documentation

bool cxxtools::DirectoryIterator::operator!= ( const DirectoryIterator it) const
inline

Inequality comparison.

const std::string& cxxtools::DirectoryIterator::operator* ( ) const

Returns the name of the file the iterator points at.

DirectoryIterator& cxxtools::DirectoryIterator::operator++ ( )

Advances the iterator to the next file.

const std::string* cxxtools::DirectoryIterator::operator-> ( ) const
DirectoryIterator& cxxtools::DirectoryIterator::operator= ( const DirectoryIterator it)

Assignment operator.

bool cxxtools::DirectoryIterator::operator== ( const DirectoryIterator it) const
inline

Equality comparison.

const std::string& cxxtools::DirectoryIterator::path ( ) const

Returns the full path of the file the iterator points at.


The documentation for this class was generated from the following file: