OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TFileNameIterator Class Reference

TFileNameIterator is used to iterate through a list of file names. More...

#include <owl/filename.h>

Public Member Functions

 TFileNameIterator (const tstring &wildName)
 Under Win32 a WIN32_FIND_DATA structure (the Data member) is allocated and intialized.
 
virtual ~TFileNameIterator ()
 Deletes the find file Data structure.
 
 operator const TFileStatus & () const
 Returns a reference to the Status member indicating the results of the last operation.
 
const TFileStatusoperator* () const
 Dereference operator returns a reference to the Status member indicating the results of the last operation.
 
 operator const tchar * () const
 Returns the full name if the last operator was sucessful; otherwise it returns 0.
 
const TFileStatusoperator++ ()
 Attempts to find the next file.
 
const TFileStatusCurrent () const
 Returns a reference to the Status member indicating the results of the last operation.
 
bool IsDir () const
 
bool IsSysDir () const
 true if it is the "." or ".." system directory;
 
unsigned long GetAttributes () const
 

Protected Member Functions

 TFileNameIterator ()
 
virtual bool FindNext (TFileStatus &status, void *findData)
 all work do here -> must fill TFileStatus structure return true on success
 

Protected Attributes

bool Done
 Set false in the constructor.
 
voidData
 Under Win32 a pointer to a WIN32_FIND_DATA structure.
 
TFileStatus Status
 Status of last attempt to find a file. See TFileStatus structure.
 

Detailed Description

TFileNameIterator is used to iterate through a list of file names.

Definition at line 187 of file filename.h.

Constructor & Destructor Documentation

◆ TFileNameIterator() [1/2]

owl::TFileNameIterator::TFileNameIterator ( const tstring & wildName)

Under Win32 a WIN32_FIND_DATA structure (the Data member) is allocated and intialized.

If a file is not found the Done member is set true; otherwise the data structure is filled in.

wildName may contain wild card characters and a path.

Definition at line 1072 of file filename.cpp.

References _T, _tcsrchr, Data, Done, and Status.

◆ ~TFileNameIterator()

owl::TFileNameIterator::~TFileNameIterator ( )
virtual

Deletes the find file Data structure.

Definition at line 1095 of file filename.cpp.

References Data.

◆ TFileNameIterator() [2/2]

owl::TFileNameIterator::TFileNameIterator ( )
inlineprotected

Definition at line 202 of file filename.h.

Member Function Documentation

◆ Current()

const TFileStatus & owl::TFileNameIterator::Current ( ) const
inline

Returns a reference to the Status member indicating the results of the last operation.

See TFileStatus structure

Definition at line 306 of file filename.h.

References Status.

◆ FindNext()

bool owl::TFileNameIterator::FindNext ( TFileStatus & status,
void * findData )
protectedvirtual

all work do here -> must fill TFileStatus structure return true on success

Attempts to find the next file. Returns a true if found, false otherwise.

Definition at line 1105 of file filename.cpp.

◆ GetAttributes()

unsigned long owl::TFileNameIterator::GetAttributes ( ) const
inline

Definition at line 200 of file filename.h.

◆ IsDir()

bool owl::TFileNameIterator::IsDir ( ) const
inline

Definition at line 332 of file filename.h.

References owl::TFileStatus::attribute, and Status.

◆ IsSysDir()

bool owl::TFileNameIterator::IsSysDir ( ) const
inline

true if it is the "." or ".." system directory;

Definition at line 338 of file filename.h.

References _T, owl::TFileStatus::fullName, IsDir(), and Status.

◆ operator const tchar *()

owl::TFileNameIterator::operator const tchar * ( ) const
inline

Returns the full name if the last operator was sucessful; otherwise it returns 0.

Definition at line 279 of file filename.h.

◆ operator const TFileStatus &()

owl::TFileNameIterator::operator const TFileStatus & ( ) const
inline

Returns a reference to the Status member indicating the results of the last operation.

See TFileStatus structure. For example:

TFileNameIterator iterator("file?.exe");
while(iterator)
{
TFileStatus& status = iterator;
//do something
++iterator;
}
TFileNameIterator is used to iterate through a list of file names.
Definition filename.h:187

Definition at line 272 of file filename.h.

◆ operator*()

const TFileStatus & owl::TFileNameIterator::operator* ( ) const
inline

Dereference operator returns a reference to the Status member indicating the results of the last operation.

Similar to STL form. See TFileStatus structure. For example:

TFileNameIterator iterator("file?.exe");
while(iterator)
{
TFileStatus& status = *iterator;
//do something
++iterator;
}

Definition at line 298 of file filename.h.

References Status.

◆ operator++()

const TFileStatus & owl::TFileNameIterator::operator++ ( )
inline

Attempts to find the next file.

Returns a reference to the Status member. See TFileStatus structure. For example:

TFileNameIterator iterator("file?.exe");
while(iterator)
{
TFileStatus& status = *iterator;
//do something
++iterator;
}

Definition at line 325 of file filename.h.

References Data, Done, FindNext(), and Status.

Member Data Documentation

◆ Data

void* owl::TFileNameIterator::Data
protected

Under Win32 a pointer to a WIN32_FIND_DATA structure.

Definition at line 212 of file filename.h.

◆ Done

bool owl::TFileNameIterator::Done
protected

Set false in the constructor.

Set true if the last attempt to find a file failed.

Definition at line 209 of file filename.h.

◆ Status

TFileStatus owl::TFileNameIterator::Status
protected

Status of last attempt to find a file. See TFileStatus structure.

Definition at line 215 of file filename.h.


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