SourcePro® API Reference Guide

 
List of all members | Public Types | Public Member Functions | Private Member Functions | Friends
RWDirectoryIterator< const char * > Struct Template Reference

Provides a specialization of the class template for const char*, with no iteration of subdirectories. More...

#include <rw/directory.h>

Inherits RWHandle.

Public Types

typedef const char * value_type
 

Public Member Functions

 RWDirectoryIterator ()
 
 RWDirectoryIterator (const char *cs)
 
 RWDirectoryIterator (const RWDirectoryIterator &it)
 
 RWDirectoryIterator (RWDirectoryIterator &&it)
 
value_type operator* () const
 
RWDirectoryIteratoroperator++ ()
 
RWDirectoryIterator operator++ (int)
 
RWDirectoryIteratoroperator= (const RWDirectoryIterator &)
 
RWDirectoryIteratoroperator= (RWDirectoryIterator &&it)
 
void swap (RWDirectoryIterator &it)
 

Private Member Functions

RWDirectoryIteratorImp & body ()
 
const RWDirectoryIteratorImp & body () const
 

Friends

bool operator!= (const RWDirectoryIterator< const char * > &, const RWDirectoryIterator< const char * > &)
 
bool operator== (const RWDirectoryIterator< const char * > &, const RWDirectoryIterator< const char * > &)
 

Detailed Description

template<>
struct RWDirectoryIterator< const char * >

The Essential Tools library provides two specializations of the class template: this class, RWDirectoryIterator<const char*>, for const char* which acts like a flat iterator , i.e. no iteration of subdirectories; and an RWCString specialization, RWDirectoryIterator<RWCString>, to provide a recursive iteration of subdirectories. Neither follow symbolic links.

Both iterators are refinements of the Input Iterator concept. One limitation is that they are usable only in single-pass algorithms.

The nature of the API for manipulating files and directories requires special attention to synchronization issues. These classes are:

Synopsis
#include <rw/directory.h>
Persistence
None

Member Typedef Documentation

typedef const char* RWDirectoryIterator< const char * >::value_type

Typedef for the type on which self is specialized.

Constructor & Destructor Documentation

RWDirectoryIterator< const char * >::RWDirectoryIterator ( )

Constructs an iterator that compares equal with any past-the-end iterator.

RWDirectoryIterator< const char * >::RWDirectoryIterator ( const char *  cs)
explicit

Constructs an iterator over the content of the directory name provided by the argument cs.

Exceptions
RWInternalError one of its derived types, thrown if cs is not a directory.
RWDirectoryIterator< const char * >::RWDirectoryIterator ( const RWDirectoryIterator< const char * > &  it)

Constructs an iterator that is a copy of the iterator passed as the argument. Dereferencing each yields identical results, yet they will not compare equal. See the equality comparison operators below.

RWDirectoryIterator< const char * >::RWDirectoryIterator ( RWDirectoryIterator< const char * > &&  it)

Move constructor. The constructed iterator takes ownership of the data owned by it.

Condition:
This method is available only on platforms with rvalue reference support.

Member Function Documentation

RWDirectoryIteratorImp& RWDirectoryIterator< const char * >::body ( )
private

Returns a reference to the underlying implementation type.

const RWDirectoryIteratorImp& RWDirectoryIterator< const char * >::body ( ) const
private

Returns a reference to the underlying implementation type.

value_type RWDirectoryIterator< const char * >::operator* ( ) const

Dereferencing operator. Returns the file name or 0 if the iterator is a past-the-end iterator.

RWDirectoryIterator& RWDirectoryIterator< const char * >::operator++ ( )

Prefix increment operator. Returns a reference to this object.

RWDirectoryIterator RWDirectoryIterator< const char * >::operator++ ( int  )

Postfix increment operator. Returns an iterator that points to the entry previous to the increment operation.

RWDirectoryIterator& RWDirectoryIterator< const char * >::operator= ( const RWDirectoryIterator< const char * > &  )

Assignment operator. Performs the assignment of the value of the argument. Note that the objects will not compare equal unless they are both past-the-end iterators.

RWDirectoryIterator& RWDirectoryIterator< const char * >::operator= ( RWDirectoryIterator< const char * > &&  it)

Move assignment. Self takes ownership of the data owned by it.

Condition:
This method is available only on platforms with rvalue reference support.
void RWDirectoryIterator< const char * >::swap ( RWDirectoryIterator< const char * > &  it)

Swaps the data owned by self with the data owned by it.

Friends And Related Function Documentation

bool operator!= ( const RWDirectoryIterator< const char * > &  ,
const RWDirectoryIterator< const char * > &   
)
friend

Inequality operator. Equivalent to logical negation of corresponding equality operator.

bool operator== ( const RWDirectoryIterator< const char * > &  ,
const RWDirectoryIterator< const char * > &   
)
friend

Equality operator. Tests equality between the two RWDirectoryIterator<const char*> objects passed as parameters. Only past-the-end iterators compare equal.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.