webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Attributes | List of all members
UCharIterator Struct Reference

#include <uiter.h>

Public Attributes

const voidcontext
 
int32_t length
 
int32_t start
 
int32_t index
 
int32_t limit
 
int32_t reservedField
 
UCharIteratorGetIndexgetIndex
 
UCharIteratorMovemove
 
UCharIteratorHasNexthasNext
 
UCharIteratorHasPrevioushasPrevious
 
UCharIteratorCurrentcurrent
 
UCharIteratorNextnext
 
UCharIteratorPreviousprevious
 
UCharIteratorReservedreservedFn
 
UCharIteratorGetStategetState
 
UCharIteratorSetStatesetState
 

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.

The current() and next() functions only check the current index against the limit, and previous() only checks the current index against the start, to see if the iterator already reached the end of the iteration range.

The assumption - in all iterators - is that the index is moved via the API, which means it won't go out of bounds, or the index is modified by user code that knows enough about the iterator implementation to set valid index values.

UCharIterator functions return code unit values 0..0xffff, or U_SENTINEL if the iteration bounds are reached.

ICU 2.1

Member Data Documentation

◆ context

const void * UCharIterator::context

(protected) Pointer to string or wrapped object or similar. Not used by caller. ICU 2.1

◆ current

UCharIteratorCurrent * UCharIterator::current

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

See also
UCharIteratorCurrent ICU 2.1

◆ getIndex

UCharIteratorGetIndex * UCharIterator::getIndex

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

See also
UCharIteratorGetIndex ICU 2.1

◆ getState

UCharIteratorGetState * UCharIterator::getState

(public) Return the state of the iterator, to be restored later with setState(). This function pointer is NULL if the iterator does not implement it.

See also
UCharIteratorGet ICU 2.6

◆ hasNext

UCharIteratorHasNext * UCharIterator::hasNext

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

See also
UCharIteratorHasNext ICU 2.1

◆ hasPrevious

UCharIteratorHasPrevious * UCharIterator::hasPrevious

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

See also
UCharIteratorHasPrevious ICU 2.1

◆ index

int32_t UCharIterator::index

(protected) Current index or similar. Not used by caller. ICU 2.1

◆ length

int32_t UCharIterator::length

(protected) Length of string or similar. Not used by caller. ICU 2.1

◆ limit

int32_t UCharIterator::limit

(protected) Limit index or similar. Not used by caller. ICU 2.1

◆ move

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 ICU 2.1

◆ next

UCharIteratorNext * UCharIterator::next

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

See also
UCharIteratorNext ICU 2.1

◆ previous

UCharIteratorPrevious * UCharIterator::previous

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

See also
UCharIteratorPrevious ICU 2.1

◆ reservedField

int32_t UCharIterator::reservedField

(protected) Used by UTF-8 iterators and possibly others. ICU 2.1

◆ reservedFn

UCharIteratorReserved * UCharIterator::reservedFn

(public) Reserved for future use. Currently NULL.

See also
UCharIteratorReserved ICU 2.1

◆ setState

UCharIteratorSetState * UCharIterator::setState

(public) Restore the iterator state from the state word from a call to getState(). This function pointer is NULL if the iterator does not implement it.

See also
UCharIteratorSet ICU 2.6

◆ start

int32_t UCharIterator::start

(protected) Start index or similar. Not used by caller. ICU 2.1


The documentation for this struct was generated from the following file: