IRootDirectoryIterator

Iterates over all root directories on the system.

On a system such as OS/2 or Windows, each volume _is_ a root directory, and a root directory iterator return the exact same entities as a volume iterator. However, on ssystems like Unix, there can be many volumes but only one root directory, so the root directory iterator only returns the single root directory "/".

This class is designed to mimic a C++ pointer, similar to the iterator classes in the ANSI/ISO C++ draft standard. When the C++ Standard Library is available, IDirectoryIterator will inherit from input_iterator.

Typical usage is as follows: for (IRootDirectoryIterator aDirectory; aDirectory; aDirectory++) { DoSomething( *aDirectory ); }


IRootDirectoryIterator - Member Functions and Data by Group

Constructors & Destructor

Use these methods to construct, copy, and assign root directory iterator objects.


[view class]
~IRootDirectoryIterator
public:
virtual ~IRootDirectoryIterator()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IRootDirectoryIterator
Copy constructor

Copying a root directory iterator does not do what you might expect. It creates another iterator object which refers to the same iteration. If you increment the new iterator, the original iterator is also incremented, because both objects actually refer to the same iteration.


Overload 1
public:
IRootDirectoryIterator()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IRootDirectoryIterator(const IRootDirectoryIterator& copy)

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator =
Assignment operator
public:
IRootDirectoryIterator& operator =( const IRootDirectoryIterator& copy )

Assigning a root directory iterator does not do what you might expect. It creates another iterator object which refers to the same iteration. If you increment the new iterator, the original iterator is also incremented, because both objects actually refer to the same iteration.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Comparison and validation operators.

Use these methods to compare root directory iterators or to validate them.


[view class]
operator !=
Inequality operator
public:
bool operator !=(const IRootDirectoryIterator& other) const
Two root directory iterators compare as equal if they are both past the end of their iteration, or if one was copy-constructed from the other.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ==
public:
bool operator ==(const IRootDirectoryIterator& other) const
Two root directory iterators compare as equal if they are both past the end of their iteration, or if one was copy-constructed from the other.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator bool
public:
operator bool() const
Validity test

This member function is often used in the termination condition of a for or while loop. When operator bool returns false, there are no more root directories over which to iterate.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Standard iteration functions

Use these iteration operators to iterator through the directories.


[view class]
operator *
public:
IDirectory operator *() const

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ++

Proceeds to the next root directory in the iteration.


Overload 1
Pre-increment operator used for expressions like ++iterator.
public:
IRootDirectoryIterator& operator ++()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IRootDirectoryIterator operator ++(int)

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ->
Returns a pointer to the current root directory in the iteration.
public:
IDirectory* operator ->()
This member function allows the iterator to be used as if it were a normal C++ pointer, in expressions like: anIterator->name()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Miscellaneous Members


[view class]
end
public:
static const IRootDirectoryIterator& end()
Returns an iterator that represents the end of iteration.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IRootDirectoryIterator - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data