G::DirectoryList Class Reference

A Directory iterator that does all file i/o in one go. More...

#include <gdirectory.h>

List of all members.

Public Member Functions

 DirectoryList ()
 Default constructor for an empty list.
void readAll (const Path &dir)
 An initialiser that is to be used after default construction.
void readType (const Path &dir, const std::string &suffix, unsigned int limit=0U)
 An initialiser that is to be used after default construction.
bool more ()
 Returns true if more and advances by one.
bool isDir () const
 Returns true if the current item is a directory.
G::Path filePath () const
 Returns the current path.
G::Path fileName () const
 Returns the current filename.


Detailed Description

A Directory iterator that does all file i/o in one go.

The implementation uses DirectoryIterator.

Definition at line 158 of file gdirectory.h.


Constructor & Destructor Documentation

G::DirectoryList::DirectoryList (  ) 

Default constructor for an empty list.

Initialise with a read method.

Definition at line 76 of file gdirectory.cpp.


Member Function Documentation

void G::DirectoryList::readAll ( const Path dir  ) 

An initialiser that is to be used after default construction.

Reads all files in the directory. All file i/o is done in readAll()/readType().

Definition at line 82 of file gdirectory.cpp.

References readType().

void G::DirectoryList::readType ( const Path dir,
const std::string &  suffix,
unsigned int  limit = 0U 
)

An initialiser that is to be used after default construction.

Reads all files that have the given suffix. All file i/o is done in readAll()/readType().

Definition at line 87 of file gdirectory.cpp.

References G::DirectoryIterator::error(), G::DirectoryIterator::fileName(), G::DirectoryIterator::filePath(), G::DirectoryIterator::isDir(), G::DirectoryIterator::more(), G::Path::str(), and G::Str::tailMatch().

Referenced by GSmtp::FileIterator::FileIterator(), GPop::StoreLock::lock(), and readAll().

bool G::DirectoryList::more (  ) 

Returns true if more and advances by one.

Definition at line 110 of file gdirectory.cpp.

Referenced by GPop::StoreLock::lock(), and GSmtp::FileIterator::next().

bool G::DirectoryList::isDir (  )  const

Returns true if the current item is a directory.

Definition at line 126 of file gdirectory.cpp.

G::Path G::DirectoryList::filePath (  )  const

Returns the current path.

Definition at line 131 of file gdirectory.cpp.

Referenced by GSmtp::FileIterator::next().

G::Path G::DirectoryList::fileName (  )  const

Returns the current filename.

Definition at line 136 of file gdirectory.cpp.

Referenced by GPop::StoreLock::lock().


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