Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Internationalization Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWUConstStringIterator

Module:  Internationalization Module   Group:  Unicode String Processing


Does Not Inherit

Local Index

Members

Non-Members

Header File

#include <rw/i18n/RWUConstStringIterator.h> 

Description

RWUConstStringIterator provides read-only access to the code points encoded by the code units within an RWBasicUString. Code points within a given string are accessed in forward or reverse order, starting from the beginning or end of the string, respectively.

Attempting to dereference or advance an iterator that is positioned past the end of the string, such as the iterator returned by RWUString::endCodePointIterator(), throws RWBoundsErr.

Instances of RWUConstStringIterator are returned from const RWUString objects, and from instances of classes such as RWUBreakSearch. These classes return RWUConstStringIterator instances because the instances cannot be used to modify the source string.

Bounds Checking

Bounds checking always occurs when repositioning or dereferencing an iterator. Any attempt to dereference an iterator that is in the past-the-end condition produces an RWBoundsErr exception.

Conversion Errors

An RWUConstStringIterator converts code units into code points. Code points greater than 0xFFFF are encoded as a pair of surrogate code units within the string. An RWUStringIterator cannot advance over or dereference an incomplete surrogate pair. An iterator throws an RWConversionErr exception if an incomplete surrogate pair is encountered.

Example

Related Classes

RWBasicUString, RWUString, RWUStringIterator, RWUBreakSearch

Public Typedefs

typedef int difference_type;
typedef RW_SL_STD(bidirectional_iterator_tag) 
   iterator_category;
typedef value_type* pointer;
typedef value_type& reference;
typedef size_t size_type;
typedef RWUChar32 value_type;

Global Operators

bool
operator==(const RWUConstStringIterator& lhs,
           const RWUConstStringIterator& rhs);
bool
operator==(const RWUConstStringIterator& lhs,
           const RWUStringIterator& rhs);
bool
operator!=(const RWUConstStringIterator& lhs,
           const RWUConstStringIterator& rhs);
bool
operator!=(const RWUConstStringIterator& lhs,
           const RWUStringIterator& rhs);

Public Constructors

RWUConstStringIterator();
RWUConstStringIterator(const RWBasicUString& ustr);
RWUConstStringIterator(const RWUConstStringIterator& iter);
RWUConstStringIterator(const RWUStringIterator& iter);

NOTE -- There is no corresponding conversion from RWUConstStringIterator to RWUStringIterator. This preserves const correctness for the iterator classes.

Public Member Operators

RWUConstStringIterator&
operator=(const RWUConstStringIterator& iter);
RWUConstStringIterator&
operator++();
RWUConstStringIterator
operator++(int);
RWUConstStringIterator&
operator--();
RWUConstStringIterator
operator--(int);
RWUChar32
operator*() const;
operator size_t() const;

Public Member Functions

void
advanceCodePoints(int offset);
const RWUChar16*
data() const;


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.