G::DirectoryIterator Class Reference

A Directory iterator. More...

#include <gdirectory.h>

List of all members.

Public Member Functions

 DirectoryIterator (const Directory &dir, const std::string &wc)
 Constructor taking a directory reference and a wildcard specification.
 DirectoryIterator (const Directory &dir)
 Constructor taking a directory reference.
 ~DirectoryIterator ()
 Destructor.
bool error () const
 Returns true on error. The caller should stop the iteration.
bool more ()
 Returns true if more and advances by one.
bool isDir () const
 Returns true if the current item is a directory.
std::string modificationTimeString () const
 Returns the last-modified time for the file in an undefined format -- used for comparison.
std::string sizeString () const
 Returns the file size as a decimal string.
Path filePath () const
 Returns the path of the current item.
Path fileName () const
 Returns the name of the current item.


Detailed Description

A Directory iterator.

The iteration model is

 while(iter.more()) { (void)iter.filePath() ; }

Definition at line 108 of file gdirectory.h.


Constructor & Destructor Documentation

G::DirectoryIterator::DirectoryIterator ( const Directory dir,
const std::string &  wc 
)

Constructor taking a directory reference and a wildcard specification.

Iterates over all matching files in the directory.

Definition at line 74 of file gdirectory_unix_glob.cpp.

G::DirectoryIterator::DirectoryIterator ( const Directory dir  )  [explicit]

Constructor taking a directory reference.

Iterates over all files in the directory.

Definition at line 69 of file gdirectory_unix_glob.cpp.

G::DirectoryIterator::~DirectoryIterator (  ) 

Destructor.

Definition at line 118 of file gdirectory_unix_glob.cpp.


Member Function Documentation

bool G::DirectoryIterator::error (  )  const

Returns true on error. The caller should stop the iteration.

Definition at line 83 of file gdirectory_unix_glob.cpp.

References G::DirectoryIteratorImp::error().

Referenced by filter_run(), and G::DirectoryList::readType().

bool G::DirectoryIterator::more (  ) 

Returns true if more and advances by one.

Definition at line 88 of file gdirectory_unix_glob.cpp.

References G::DirectoryIteratorImp::more().

Referenced by filter_run(), and G::DirectoryList::readType().

bool G::DirectoryIterator::isDir (  )  const

Returns true if the current item is a directory.

Definition at line 103 of file gdirectory_unix_glob.cpp.

References G::DirectoryIteratorImp::isDir().

Referenced by filter_run(), and G::DirectoryList::readType().

std::string G::DirectoryIterator::modificationTimeString (  )  const

Returns the last-modified time for the file in an undefined format -- used for comparison.

Definition at line 108 of file gdirectory_unix_glob.cpp.

References G::DirectoryIteratorImp::modificationTimeString().

std::string G::DirectoryIterator::sizeString (  )  const

Returns the file size as a decimal string.

The value may be more than 32 bits. See also class G::Number.

Definition at line 113 of file gdirectory_unix_glob.cpp.

References G::DirectoryIteratorImp::sizeString().

G::Path G::DirectoryIterator::filePath (  )  const

Returns the path of the current item.

Definition at line 93 of file gdirectory_unix_glob.cpp.

References G::DirectoryIteratorImp::filePath().

Referenced by filter_run(), and G::DirectoryList::readType().

G::Path G::DirectoryIterator::fileName (  )  const

Returns the name of the current item.

Definition at line 98 of file gdirectory_unix_glob.cpp.

References G::DirectoryIteratorImp::fileName().

Referenced by filter_run(), and G::DirectoryList::readType().


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

Generated on Fri Apr 18 15:56:13 2008 for E-MailRelay by  doxygen 1.5.5