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 existed for opening. 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 111 of file MSwindows.C.

Constructor & Destructor Documentation

◆ directoryIterator()

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

Construct for dirName, optionally allowing hidden files/dirs.

Definition at line 135 of file MSwindows.C.

References directoryIterator::good(), and directoryIterator::next().

Here is the call graph for this function:

◆ ~directoryIterator()

~directoryIterator ( )
inline

Destructor.

Definition at line 164 of file MSwindows.C.

References directoryIterator::close().

Here is the call graph for this function:

Member Function Documentation

◆ exists()

bool exists ( ) const
inline

Directory existed for opening.

Definition at line 173 of file MSwindows.C.

Referenced by Foam::readDir(), and Foam::rmDir().

Here is the caller graph for this function:

◆ good()

bool good ( ) const
inline

Directory pointer is valid.

Definition at line 179 of file MSwindows.C.

Referenced by directoryIterator::close(), directoryIterator::directoryIterator(), and directoryIterator::operator bool().

Here is the caller graph for this function:

◆ close()

void close ( )
inline

Close directory.

Definition at line 185 of file MSwindows.C.

References directoryIterator::good().

Referenced by directoryIterator::~directoryIterator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ val()

const std::string& val ( ) const
inline

The current item.

Definition at line 195 of file MSwindows.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 it runs out of items

Definition at line 203 of file MSwindows.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 228 of file MSwindows.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 234 of file MSwindows.C.

References directoryIterator::val().

Here is the call graph for this function:

◆ operator++()

directoryIterator& operator++ ( )
inline

Same as next()

Definition at line 240 of file MSwindows.C.

References directoryIterator::next().

Here is the call graph for this function:

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