directoryIterator Class Reference

A simple directory contents iterator. More...

Public Member Functions

 directoryIterator (const fileName &dirName, bool allowHidden=false)
 Construct for dirName, optionally allowing hidden files/dirs. More...
 
 ~directoryIterator ()
 Destructor. More...
 
bool exists () const
 Directory open succeeded. More...
 
bool good () const
 Directory pointer is valid. More...
 
void close ()
 Close directory. More...
 
const std::string & val () const
 The current item. More...
 
bool next ()
 Read next item, always ignoring "." and ".." entries. More...
 
 operator bool () const
 Same as good() More...
 
const std::string & operator* () const
 Same as val() More...
 
directoryIteratoroperator++ ()
 Same as next() More...
 

Detailed Description

A simple directory contents iterator.

Definition at line 119 of file POSIX.C.

Constructor & Destructor Documentation

◆ directoryIterator()

directoryIterator ( const fileName dirName,
bool  allowHidden = false 
)
inline

Construct for dirName, optionally allowing hidden files/dirs.

Definition at line 145 of file POSIX.C.

References directoryIterator::next().

Here is the call graph for this function:

◆ ~directoryIterator()

~directoryIterator ( )
inline

Destructor.

Definition at line 162 of file POSIX.C.

References directoryIterator::close().

Here is the call graph for this function:

Member Function Documentation

◆ exists()

bool exists ( ) const
inline

Directory open succeeded.

Definition at line 171 of file POSIX.C.

◆ good()

bool good ( ) const
inline

Directory pointer is valid.

Definition at line 177 of file POSIX.C.

Referenced by directoryIterator::operator bool().

Here is the caller graph for this function:

◆ close()

void close ( )
inline

Close directory.

Definition at line 183 of file POSIX.C.

Referenced by directoryIterator::~directoryIterator().

Here is the caller graph for this function:

◆ val()

const std::string& val ( ) const
inline

The current item.

Definition at line 193 of file POSIX.C.

Referenced by directoryIterator::operator*().

Here is the caller graph for this function:

◆ next()

bool next ( )
inline

Read next item, always ignoring "." and ".." entries.

Normally also ignore hidden files/dirs (beginning with '.') Automatically close when there are no more items

Definition at line 201 of file POSIX.C.

Referenced by directoryIterator::directoryIterator(), and directoryIterator::operator++().

Here is the caller graph for this function:

◆ operator bool()

operator bool ( ) const
inline

Same as good()

Definition at line 223 of file POSIX.C.

References directoryIterator::good().

Here is the call graph for this function:

◆ operator*()

const std::string& operator* ( ) const
inline

Same as val()

Definition at line 229 of file POSIX.C.

References directoryIterator::val().

Here is the call graph for this function:

◆ operator++()

directoryIterator& operator++ ( )
inline

Same as next()

Definition at line 235 of file POSIX.C.

References directoryIterator::next().

Here is the call graph for this function:

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