IVolumeIterator

Iterates over over all mounted volumes on the system.

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 (IVolumeIterator aVolume; aVolume; aVolume++) { DoSomething( *aVolume ); }


IVolumeIterator - Member Functions and Data by Group

Constructors & Destructor

Use these functions to construct and destroy objects of class IVolumeIterator.


[view class]
~IVolumeIterator
Destructor.
public:
virtual ~IVolumeIterator()
Destroys the IVolumeIterator object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IVolumeIterator
Constructs an object of class IVolumeIterator.


Overload 1
Copy Constructor
public:
IVolumeIterator(const IVolumeIterator& copy)
Use this constructor to create an IVolumeIterator object that is copied from the given one.

Note that copying a volume 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.

copy
A constant reference to the object to be copied.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
Default constructor.
public:
IVolumeIterator()
Use this constructor to create an empty IVolumeIteratorObject.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Assignment Operator

Use the function in this group to create a volume iterator object copied from the given one. Incrementing the new one causes the original one to be incremented too.


[view class]
operator =
Assignment operator.
public:
IVolumeIterator& operator =(const IVolumeIterator& copy)
Assigning a volume 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


Iterating Through Volumes

Use these iteration operators to iterator through the volumes.


[view class]
operator *
public:
IVolume operator *() const
Returns the IVolume that this iterator is iterating.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ++
Proceeds to the next volume in the iteration.


Overload 1
Pre-increment operator used for expressions such as ++iterator.
public:
IVolumeIterator& operator ++()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
Post-increment operator used for expressions such as iterator++.
public:
IVolumeIterator operator ++(int)

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ->
Returns a pointer to the current volume in the iteration.
public:
IVolume* 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


Testing and Comparing Volume Iterators

Use these functions to compare volume iterators or validate them.


[view class]
operator !=
Inequality operator.
public:
bool operator !=(const IVolumeIterator& other) const

This function test two volume iterators for inequality. They 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 ==
Tests two volume iterator objects for equality.
public:
bool operator ==(const IVolumeIterator& other) const
Tests this IVolumeIterator object against the given one for equality.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator bool
Performs a validity test.
public:
operator bool() const
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 volumes over which to iterate.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Miscellaneous Members


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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IVolumeIterator - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data