Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

UCharIterator Struct Reference

C API for code unit iteration. More...

#include <uiter.h>


Data Fields

const void * context
 (protected) Pointer to string or wrapped object or similar. More...

int32_t length
 (protected) Length of string or similar. More...

int32_t start
 (protected) Start index or similar. More...

int32_t index
 (protected) Current index or similar. More...

int32_t limit
 (protected) Limit index or similar. More...

int32_t reservedField
 (protected) Not currently used by any instance.

UCharIteratorGetIndexgetIndex
 (public) Returns the current position or the start or limit index of the iteration range. More...

UCharIteratorMovemove
 (public) Moves the current position relative to the start or limit of the iteration range, or relative to the current position itself. More...

UCharIteratorHasNexthasNext
 (public) Check if current and next can still return another code unit. More...

UCharIteratorHasPrevioushasPrevious
 (public) Check if previous can still return another code unit. More...

UCharIteratorCurrentcurrent
 (public) Return the code unit at the current position, or -1 if there is none (index is at the limit). More...

UCharIteratorNextnext
 (public) Return the code unit at the current index and increment the index (post-increment, like s[i++]), or return -1 if there is none (index is at the limit). More...

UCharIteratorPreviousprevious
 (public) Decrement the index and return the code unit from there (pre-decrement, like s[--i]), or return -1 if there is none (index is at the start). More...

UCharIteratorReservedreservedFn
 (public) Reserved for future use. More...


Detailed Description

C API for code unit iteration.

This can be used as a C wrapper around CharacterIterator, Replaceable, or implemented using simple strings, etc.

There are two roles for using UCharIterator:

A "provider" sets the necessary function pointers and controls the "protected" fields of the UCharIterator structure. A "provider" passes a UCharIterator into C APIs that need a UCharIterator as an abstract, flexible string interface.

Implementations of such C APIs are "callers" of UCharIterator functions; they only use the "public" function pointers and never access the "protected" fields directly.

UCharIterator functions return code unit values 0..0xffff, or -1 if the iteration bounds are reached. Therefore, the return type is int32_t.

@draft ICU 2.1


Field Documentation

const void* UCharIterator::context
 

(protected) Pointer to string or wrapped object or similar.

Not used by caller.

UCharIteratorCurrent* UCharIterator::current
 

(public) Return the code unit at the current position, or -1 if there is none (index is at the limit).

See also:
UCharIteratorCurrent

UCharIteratorGetIndex* UCharIterator::getIndex
 

(public) Returns the current position or the start or limit index of the iteration range.

See also:
UCharIteratorGetIndex

UCharIteratorHasNext* UCharIterator::hasNext
 

(public) Check if current and next can still return another code unit.

See also:
UCharIteratorHasNext

UCharIteratorHasPrevious* UCharIterator::hasPrevious
 

(public) Check if previous can still return another code unit.

See also:
UCharIteratorHasPrevious

int32_t UCharIterator::index
 

(protected) Current index or similar.

Not used by caller.

int32_t UCharIterator::length
 

(protected) Length of string or similar.

Not used by caller.

int32_t UCharIterator::limit
 

(protected) Limit index or similar.

Not used by caller.

UCharIteratorMove* UCharIterator::move
 

(public) Moves the current position relative to the start or limit of the iteration range, or relative to the current position itself.

The movement is expressed in numbers of code units forward or backward by specifying a positive or negative delta.

See also:
UCharIteratorMove

UCharIteratorNext* UCharIterator::next
 

(public) Return the code unit at the current index and increment the index (post-increment, like s[i++]), or return -1 if there is none (index is at the limit).

See also:
UCharIteratorNext

UCharIteratorPrevious* UCharIterator::previous
 

(public) Decrement the index and return the code unit from there (pre-decrement, like s[--i]), or return -1 if there is none (index is at the start).

See also:
UCharIteratorPrevious

UCharIteratorReserved* UCharIterator::reservedFn
 

(public) Reserved for future use.

Currently NULL.

See also:
UCharIteratorReserved

int32_t UCharIterator::start
 

(protected) Start index or similar.

Not used by caller.


The documentation for this struct was generated from the following file:
Generated on Mon Mar 4 20:10:37 2002 for ICU 2.0 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002