#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. | |
UCharIteratorGetIndex * | getIndex |
(public) Returns the current position or the start or limit index of the iteration range. More... | |
UCharIteratorMove * | move |
(public) Moves the current position relative to the start or limit of the iteration range, or relative to the current position itself. More... | |
UCharIteratorHasNext * | hasNext |
(public) Check if current and next can still return another code unit. More... | |
UCharIteratorHasPrevious * | hasPrevious |
(public) Check if previous can still return another code unit. More... | |
UCharIteratorCurrent * | current |
(public) Return the code unit at the current position, or -1 if there is none (index is at the limit). More... | |
UCharIteratorNext * | 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). More... | |
UCharIteratorPrevious * | 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). More... | |
UCharIteratorReserved * | reservedFn |
(public) Reserved for future use. More... |
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
|
(protected) Pointer to string or wrapped object or similar. Not used by caller. |
|
(public) Return the code unit at the current position, or -1 if there is none (index is at the limit).
|
|
(public) Returns the current position or the start or limit index of the iteration range.
|
|
(public) Check if current and next can still return another code unit.
|
|
(public) Check if previous can still return another code unit.
|
|
(protected) Current index or similar. Not used by caller. |
|
(protected) Length of string or similar. Not used by caller. |
|
(protected) Limit index or similar. Not used by caller. |
|
(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.
|
|
(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).
|
|
(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).
|
|
(public) Reserved for future use. Currently NULL.
|
|
(protected) Start index or similar. Not used by caller. |