SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWUAvailableEncodingListIterator Class Reference

Provides a C++ Standard Library-compatible random-access iterator for class RWUAvailableEncodingList. More...

#include <rw/i18n/RWUAvailableEncodingListIterator.h>

Public Types

typedef int32_t difference_type
 
typedef std::random_access_iterator_tag iterator_category
 
typedef value_typepointer
 
typedef value_type reference
 
typedef const char * value_type
 

Public Member Functions

 RWUAvailableEncodingListIterator (const RWUAvailableEncodingListIterator &source)
 
 RWUAvailableEncodingListIterator (void)
 
 ~RWUAvailableEncodingListIterator ()
 
value_type operator* () const
 
RWUAvailableEncodingListIteratoroperator++ ()
 
RWUAvailableEncodingListIterator operator++ (int)
 
RWUAvailableEncodingListIteratoroperator+= (difference_type offset)
 
difference_type operator- (const RWUAvailableEncodingListIterator &rhs) const
 
RWUAvailableEncodingListIteratoroperator-- ()
 
RWUAvailableEncodingListIterator operator-- (int)
 
RWUAvailableEncodingListIteratoroperator-= (difference_type offset)
 
RWUAvailableEncodingListIteratoroperator= (const RWUAvailableEncodingListIterator &rhs)
 
value_type operator[] (difference_type offset) const
 

Friends

std::strong_ordering operator<=> (const RWUAvailableEncodingListIterator &lhs, const RWUAvailableEncodingListIterator &rhs)
 
bool operator== (const RWUAvailableEncodingListIterator &lhs, const RWUAvailableEncodingListIterator &rhs)
 
class RWUAvailableEncodingList
 

Related Symbols

(Note that these are not member symbols.)

RWUAvailableEncodingListIterator operator+ (const RWUAvailableEncodingListIterator &lhs, RWUAvailableEncodingListIterator::difference_type offset)
 
RWUAvailableEncodingListIterator operator+ (RWUAvailableEncodingListIterator::difference_type offset, const RWUAvailableEncodingListIterator &rhs)
 
RWUAvailableEncodingListIterator operator- (const RWUAvailableEncodingListIterator &lhs, RWUAvailableEncodingListIterator::difference_type offset)
 

Detailed Description

RWUAvailableEncodingListIterator is a C++ Standard Library-compatible random-access iterator for class RWUAvailableEncodingList. An instance of RWUAvailableEncodingListIterator can be used to access the list of encoding names currently recognized by the Internationalization Module. The list cannot be changed at run time.

Example
#include <rw/i18n/RWUAvailableEncodingList.h>
#include <iostream>
int main() {
// Iterate over the list of encodings and write them
// to std::cout, obtaining iterators from the static
// RWUAvailableEncodingList begin() and end() methods.
iter != RWUAvailableEncodingList::end(); ++iter) {
std::cout << *iter << std::endl;
}
// Iterate over the list of encodings again, obtaining
// iterators from an RWUAvailableEncodingList object.
for (iter = list.begin(); iter != list.end(); ++iter) {
std::cout << *iter << std::endl;
}
return 0;
}
Provides a C++ Standard Library-compatible random-access iterator for class RWUAvailableEncodingList.
Definition RWUAvailableEncodingListIterator.h:101
Constructs iterators that provide access to the current list of encoding names.
Definition RWUAvailableEncodingList.h:99
static iterator begin()
Definition RWUAvailableEncodingList.h:206
static iterator end()
Definition RWUAvailableEncodingList.h:211
See also
RWUAvailableEncodingList

Member Typedef Documentation

◆ difference_type

Declares an alias for the type used to represent iterator offsets and differences.

◆ iterator_category

typedef std::random_access_iterator_tag RWUAvailableEncodingListIterator::iterator_category

Tags this class as a C++ Standard Library-compatible random-access iterator.

◆ pointer

Declares an alias for the value pointer type.

◆ reference

Declares an alias for the value reference type.

◆ value_type

Declares an alias for the value type returned by operator*().

Constructor & Destructor Documentation

◆ RWUAvailableEncodingListIterator() [1/2]

RWUAvailableEncodingListIterator::RWUAvailableEncodingListIterator ( void )
inline

Default constructor. Creates an invalid iterator. Attempts to dereference an invalid iterator cause an RWBoundsErr exception to be thrown. Use RWUAvailableEncodingList to obtain valid iterators.

◆ RWUAvailableEncodingListIterator() [2/2]

RWUAvailableEncodingListIterator::RWUAvailableEncodingListIterator ( const RWUAvailableEncodingListIterator & source)
inline

Copy constructor. Makes self a copy of source.

◆ ~RWUAvailableEncodingListIterator()

RWUAvailableEncodingListIterator::~RWUAvailableEncodingListIterator ( )
inline

Destructor.

Member Function Documentation

◆ operator*()

RWUAvailableEncodingListIterator::value_type RWUAvailableEncodingListIterator::operator* ( ) const
inline

Returns a const char* to a null-terminated character string containing the encoding name located at the list position specified by self.

The storage for this string is owned by the library.

Exceptions
RWBoundsErrThrown if the iterator is invalid or positioned past the end of the list.

◆ operator++() [1/2]

RWUAvailableEncodingListIterator & RWUAvailableEncodingListIterator::operator++ ( )
inline

Repositions self to the next position in the encoding name list, and returns a reference to self.

◆ operator++() [2/2]

RWUAvailableEncodingListIterator RWUAvailableEncodingListIterator::operator++ ( int )
inline

Repositions self to the next position in the encoding name list, and returns a copy of the previous value of self.

◆ operator+=()

RWUAvailableEncodingListIterator & RWUAvailableEncodingListIterator::operator+= ( difference_type offset)
inline

Repositions self to a new position in the encoding name list by adding offset to the current iterator position, and returns a reference to self.

◆ operator-()

RWUAvailableEncodingListIterator::difference_type RWUAvailableEncodingListIterator::operator- ( const RWUAvailableEncodingListIterator & rhs) const
inline

Calculates the difference, or distance, between self and rhs.

◆ operator--() [1/2]

RWUAvailableEncodingListIterator & RWUAvailableEncodingListIterator::operator-- ( )
inline

Repositions self to the preceding position in the encoding name list and returns a reference to self.

◆ operator--() [2/2]

RWUAvailableEncodingListIterator RWUAvailableEncodingListIterator::operator-- ( int )
inline

Repositions self to the preceding position in the encoding name list and returns a copy of the previous value of self.

◆ operator-=()

RWUAvailableEncodingListIterator & RWUAvailableEncodingListIterator::operator-= ( difference_type offset)
inline

Repositions self to a new position in the encoding name list by subtracting offset from the current iterator position, and returns a reference to self.

◆ operator=()

RWUAvailableEncodingListIterator & RWUAvailableEncodingListIterator::operator= ( const RWUAvailableEncodingListIterator & rhs)
inline

Changes the state of self to match that of rhs. Makes the list position of self equal to the list position of rhs.

◆ operator[]()

RWUAvailableEncodingListIterator::value_type RWUAvailableEncodingListIterator::operator[] ( difference_type offset) const
inline

Returns a const char* to a null-terminated character string that contains the name of the available encoding name located at the list position specified by the given offset from self.

Friends And Related Symbol Documentation

◆ operator+() [1/2]

Returns a new iterator whose list position is calculated by adding offset to the position of lhs.

◆ operator+() [2/2]

Returns a new iterator whose list position is calculated by adding offset to the position of rhs.

◆ operator-()

Returns a new iterator whose list position is calculated by subtracting offset from the position of lhs.

◆ operator<=>

std::strong_ordering operator<=> ( const RWUAvailableEncodingListIterator & lhs,
const RWUAvailableEncodingListIterator & rhs )
friend

Performs a comparison of the list position of lhs and rhs.

Note
If a compiler does not support rewritten expressions (i.e. before C++20), comparison operators are explicitly implemented to provide equivalent behavior.

◆ operator==

bool operator== ( const RWUAvailableEncodingListIterator & lhs,
const RWUAvailableEncodingListIterator & rhs )
friend

Returns true if the list position of lhs is equal to the list position of rhs. Otherwise, returns false.

Note
If a compiler does not support rewritten expressions (i.e. before C++20), equality operators are explicitly implemented to provide equivalent behavior.

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