Windows C++ Library
Public Types | Public Member Functions | Private Member Functions | Private Attributes
WCL::FolderIterator Class Reference

An iterator for enumerating the file and directory names in a filesystem folder. More...

#include <FolderIterator.hpp>

List of all members.

Public Types

enum  Flag { FIND_FOLDERS = 0x0001, FIND_FILES = 0x0002, NONE = 0x0000, DEFAULT = (FIND_FOLDERS | FIND_FILES) }
 The search flags. More...

Public Member Functions

 FolderIterator ()
 Default constructor.
 FolderIterator (const tstring &strFolder, const tstring &strMask=TXT("*.*"), int nFlags=DEFAULT)
 Construction from the folder to iterate and the file mask to use.
 ~FolderIterator ()
 Destructor.
const tstring & Folder () const
 Get the name of the folder.
const tstring & Mask () const
 Get the mask used for filtering.
const tchar * operator* () const
 Dereference operator.
FolderIteratoroperator++ ()
 Advance the iterator.
bool Equals (const FolderIterator &RHS) const
 Compare two iterators for equivalence.

Private Member Functions

bool IsValid () const
 Check if the iterator is valid.
void Begin ()
 Start the enumeration.
void Next ()
 Continue the enumeration.
void Reset ()
 End the enumeration of the folder.
 FolderIterator (const FolderIterator &)
FolderIteratoroperator= (const FolderIterator &)

Private Attributes

tstring m_strFolder
 The folder to iterate.
tstring m_strMask
 The file mask to use.
int m_nFlags
 The search flags.
HANDLE m_hFindFile
 The underlying Win32 handle.
WIN32_FIND_DATA m_oFindData
 The underlying enumeration data.

Detailed Description

An iterator for enumerating the file and directory names in a filesystem folder.


Member Enumeration Documentation

The search flags.

Enumerator:
FIND_FOLDERS 

Find folders.

FIND_FILES 

Find files.

NONE 

The initial state.

DEFAULT 

The default flags.


Constructor & Destructor Documentation

Default constructor.

This creates an iterator that is the 'end' iterator.

WCL::FolderIterator::FolderIterator ( const tstring &  strFolder,
const tstring &  strMask = TXT("*.*"),
int  nFlags = DEFAULT 
)

Construction from the folder to iterate and the file mask to use.

Destructor.


Member Function Documentation

const tstring & WCL::FolderIterator::Folder ( ) const [inline]

Get the name of the folder.

const tstring & WCL::FolderIterator::Mask ( ) const [inline]

Get the mask used for filtering.

const tchar * WCL::FolderIterator::operator* ( ) const

Dereference operator.

FolderIterator & WCL::FolderIterator::operator++ ( )

Advance the iterator.

bool WCL::FolderIterator::Equals ( const FolderIterator RHS) const

Compare two iterators for equivalence.

bool WCL::FolderIterator::IsValid ( ) const [inline, private]

Check if the iterator is valid.

void WCL::FolderIterator::Begin ( ) [private]

Start the enumeration.

void WCL::FolderIterator::Next ( ) [private]

Continue the enumeration.

void WCL::FolderIterator::Reset ( ) [private]

End the enumeration of the folder.

FolderIterator& WCL::FolderIterator::operator= ( const FolderIterator ) [private]

Member Data Documentation

The folder to iterate.

tstring WCL::FolderIterator::m_strMask [private]

The file mask to use.

The search flags.

The underlying Win32 handle.

WIN32_FIND_DATA WCL::FolderIterator::m_oFindData [private]

The underlying enumeration data.


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