Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_FileIterator Class Reference

Class used to iterate and list files in a directory in the underlying OSs file system. More...

List of all members.

Public Member Functions

Constructor / Destructor
 CP_FileIterator ()
 Constructor.
 CP_FileIterator (const CP_FileSystemSpec &inParentDirectory, CP_FileFilter *inFilter=NULL)
 CP_FileIterator (const CP_FileIterator &inFilterIterator)
virtual ~CP_FileIterator () throw ()
 Destructor.
Getters
CP_FileSystemSpec GetDirectory () const
File Specs List
CP_FileSystemSpec_Array GetFileSpecs ()
File Filter
CP_FileFilterGetFileFilter ()
void SetFileFilter (CP_FileFilter *inFilter)

Protected Member Functions

Iteration
virtual void IterateDirectory (const CP_FileSystemSpec &inParentDirectory)

Protected Attributes

CP_FileSystemSpec fParentDirectory
CP_FileSystemSpec_Array fFileSpecs
CP_FileFilterfFileFilter


Detailed Description

The user can supply an optional CP_FileFilter object to control which files are listed.


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_FileIterator::CP_FileIterator  ) 
 

Constructor.

Exceptions:
none 

CP_FileIterator::CP_FileIterator const CP_FileSystemSpec inParentDirectory,
CP_FileFilter inFilter = NULL
 

Constructor.

Parameters:
inParentDirectory CP_FileSystemSpec object that specifies the directory to be used to find files in.
inFilter CP_FileFilter object to control which files are listed.
Exceptions:
none 

CP_FileIterator::CP_FileIterator const CP_FileIterator inIterator  ) 
 

Copy constructor.

Parameters:
inIterator CP_FileIterator to copy fields from.
Exceptions:
none 

CP_FileIterator::~CP_FileIterator  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_FileSystemSpec CP_FileIterator::GetDirectory  )  const
 

Returns a CP_FileSystemSpec that represents the directory that this iterator is being used in currently.

Exceptions:
none 
Returns:
CP_FileSystemSpec const The directory being iterated over.

CP_FileSystemSpec_Array CP_FileIterator::GetFileSpecs  ) 
 

Returns a CP_FileSystemSpec_Array that contains a list of CP_FileSystemSpecs for each item in the directory that matches the filters criteria if one is installed, otherwise all file system objects are returned.

Exceptions:
none 
Returns:
CP_FileSystemSpec_Array The list of files matching the filters criteria.

CP_FileFilter* CP_FileIterator::GetFileFilter  ) 
 

Returns the CP_FileFilter object used with this iterator. NULL is returned if this iterator is not using a file filter.

Exceptions:
none 
Returns:
CP_FileFilter * The file filter object used with this iterator.

void CP_FileIterator::SetFileFilter CP_FileFilter inFilter  ) 
 

Sets the CP_FileFilter object to use with this iterator. When this object has a filter, the filter controls which files will be returned.

Parameters:
inFilter The CP_FileFilter to use with this object. It is safe to pass NULL here, which indicates you want to not use any filter.
Exceptions:
none 
Returns:
void

void CP_FileIterator::IterateDirectory const CP_FileSystemSpec inParentDirectory  )  [protected, virtual]
 

Calls on the MacOS file system to iterator over a directory and return information about each file in the system. This is the routine that does the actual implementation of getting the files list on MacOS.

We fill in an array with the file specs that pass through the user supplied filter, if any. Otherwise all files are added to the array of file specs.

Parameters:
inParentDirectory CP_FileSystemSpec object that specifies the directory to be used to find files in.
Exceptions:
OSErr exceptions
Returns:
void


Member Data Documentation

CP_FileSystemSpec CP_FileIterator::fParentDirectory [protected]
 

CP_FileSystemSpec_Array CP_FileIterator::fFileSpecs [protected]
 

The directory we are searching in.

CP_FileFilter* CP_FileIterator::fFileFilter [protected]
 

List of CP_FileSystemSpecs that match the filter, if any. Otherwise, all files.


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:45 2005 for CPLAT_MacOS by  doxygen 1.4.0