Class: TDirectoryIterator

Declaration: FileSystemInterface.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TDirectoryTreeIterator

Purpose:

Iterates over the contents of a directory.

Instantiation:

Allocate on the heap or the stack. The stack is preferred.

Deriving Classes:

Do not derive from this class.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TDirectoryIterator::Next

  1. virtual TFileSystemEntity Next ()
  2. virtual TFileSystemEntity Next (TPropertySet & fillinProperties)

Interface Category:

API.

Purpose:

  1. Returns the next item in the iteration.
  2. Returns the next item in the iteration and fills in the requested properties.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

The file system entity that is next in the iteration. If all entities have been exhausted, kEndOfIteration is returned.

Exceptions:

  1. Throws TFileSystemObjectInvalid if First has not been called, or if the iterator has not been initialized.
  2. Throws TFileSystemTypeMismatch if the query evaluation causes a type mismatch.

Concurrency:

Not multithread safe. This is a handle class.

Other Considerations:

None.

Member Function: TDirectoryIterator::First

  1. virtual TFileSystemEntity First ()
  2. virtual TFileSystemEntity First (TPropertySet & fillinProperties)

Interface Category:

API.

Purpose:

  1. Resets the iterator and returns the first item in the iteration.
  2. Resets the iterator, returns the first item in the iteration, and returns all properties specified in fillinProperties.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

The file system entity that is first in the iteration. If the directory is empty, then kEndOfIteration is returned.

Exceptions:

Throws TFileSystemObjectInvalid if the iterator has not been initialized. Throws TFileSystemTypeMismatch if the query evaluation causes a type mismatch.

Concurrency:

Not multithread safe. This is a handle class.

Other Considerations:

None.

Member Function: TDirectoryIterator::~TDirectoryIterator

virtual ~ TDirectoryIterator ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. This is a handle class.

Other Considerations:

None.

Member Function: TDirectoryIterator::operator=

TDirectoryIterator & operator =(const TDirectoryIterator & right)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. This is a handle class.

Other Considerations:

None.

Member Function: TDirectoryIterator::TDirectoryIterator

  1. TDirectoryIterator ()
  2. TDirectoryIterator (const TDirectory & directory, const TPropertyIDSet & properties =kNoProperties, const TPropertyQuery & aQuery =kNoQuery)
  3. TDirectoryIterator (const TDirectoryIterator & copy)
  4. TDirectoryIterator (const TDirectory & directory, const TPropertyIDSet & properties, const TPropertyQuery & aQuery, bool beRecursive)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Constructs an iterator to find entities that satisfy aQuery and to return their properties.
  3. Copy constructor.
  4. Constructs a recursive, depth-first iterator to find entities that satisfy aQuery and to return their properties.

Calling Context:

  1. Called by the stream-in operators, or directly for later assignment.
  2. Call this function directly.
  3. Called to copy an object.
  4. Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. This is a handle class.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.