Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

uiter.h File Reference

C API: Unicode Character Iteration. More...

#include "unicode/utypes.h"

Go to the source code of this file.

Compounds

struct  UCharIterator
 C API for code unit iteration. More...


Typedefs

typedef enum UCharIteratorOrigin UCharIteratorOrigin
 Origin constants for UCharIterator.getIndex() and UCharIterator.move(). More...

typedef int32_t U_CALLCONV UCharIteratorGetIndex (UCharIterator *iter, UCharIteratorOrigin origin)
 Function type declaration for UCharIterator.getIndex(). More...

typedef int32_t U_CALLCONV UCharIteratorMove (UCharIterator *iter, int32_t delta, UCharIteratorOrigin origin)
 Function type declaration for UCharIterator.move(). More...

typedef UBool U_CALLCONV UCharIteratorHasNext (UCharIterator *iter)
 Function type declaration for UCharIterator.hasNext(). More...

typedef UBool U_CALLCONV UCharIteratorHasPrevious (UCharIterator *iter)
 Function type declaration for UCharIterator.hasPrevious(). More...

typedef UChar32 U_CALLCONV UCharIteratorCurrent (UCharIterator *iter)
 Function type declaration for UCharIterator.current(). More...

typedef UChar32 U_CALLCONV UCharIteratorNext (UCharIterator *iter)
 Function type declaration for UCharIterator.next(). More...

typedef UChar32 U_CALLCONV UCharIteratorPrevious (UCharIterator *iter)
 Function type declaration for UCharIterator.previous(). More...

typedef int32_t U_CALLCONV UCharIteratorReserved (UCharIterator *iter, int32_t something)
 Function type declaration for UCharIterator.reservedFn(). More...


Enumerations

enum  UCharIteratorOrigin {
  UITER_START, UITER_CURRENT, UITER_LIMIT, UITER_ZERO,
  UITER_LENGTH
}
 Origin constants for UCharIterator.getIndex() and UCharIterator.move(). More...


Functions

UChar32 uiter_current32 (UCharIterator *iter)
 Helper function for UCharIterator to get the code point at the current index. More...

UChar32 uiter_next32 (UCharIterator *iter)
 Helper function for UCharIterator to get the next code point. More...

UChar32 uiter_previous32 (UCharIterator *iter)
 Helper function for UCharIterator to get the previous code point. More...

void uiter_setString (UCharIterator *iter, const UChar *s, int32_t length)
 Set up a UCharIterator to iterate over a string. More...

void uiter_setCharacterIterator (UCharIterator *iter, CharacterIterator *charIter)
 Set up a UCharIterator to wrap around a C++ CharacterIterator. More...

void uiter_setReplaceable (UCharIterator *iter, const Replaceable *rep)
 Set up a UCharIterator to iterate over a C++ Replaceable. More...


Variables

U_NAMESPACE_BEGIN class CharacterIterator
U_NAMESPACE_END struct UCharIterator
 C typedef for struct UCharIterator. More...


Detailed Description

C API: Unicode Character Iteration.

See also:
UCharIterator

Definition in file uiter.h.


Typedef Documentation

typedef UChar32 U_CALLCONV UCharIteratorCurrent(UCharIterator *iter)
 

Function type declaration for UCharIterator.current().

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

Parameters:
iter  the UCharIterator structure ("this pointer")
Returns:
the current code unit
See also:
UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

Definition at line 135 of file uiter.h.

typedef int32_t U_CALLCONV UCharIteratorGetIndex(UCharIterator *iter, UCharIteratorOrigin origin)
 

Function type declaration for UCharIterator.getIndex().

Gets the current position, or the start or limit of the iteration range.

Parameters:
iter  the UCharIterator structure ("this pointer")
origin  get the 0, start, limit, length, or current index
Returns:
the requested index, or U_SENTINEL in an error condition
See also:
UCharIteratorOrigin , UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

Definition at line 68 of file uiter.h.

typedef UBool U_CALLCONV UCharIteratorHasNext(UCharIterator *iter)
 

Function type declaration for UCharIterator.hasNext().

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

Parameters:
iter  the UCharIterator structure ("this pointer")
Returns:
boolean value for whether current() and next() can still return another code unit
See also:
UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

Definition at line 106 of file uiter.h.

typedef UBool U_CALLCONV UCharIteratorHasPrevious(UCharIterator *iter)
 

Function type declaration for UCharIterator.hasPrevious().

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

Parameters:
iter  the UCharIterator structure ("this pointer")
Returns:
boolean value for whether previous() can still return another code unit
See also:
UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

Definition at line 120 of file uiter.h.

typedef int32_t U_CALLCONV UCharIteratorMove(UCharIterator *iter, int32_t delta, UCharIteratorOrigin origin)
 

Function type declaration for UCharIterator.move().

Use iter->move(iter, index, UITER_ZERO) like CharacterIterator::setIndex(index).

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. Out of bounds movement will be pinned to the start or limit.

Parameters:
iter  the UCharIterator structure ("this pointer")
delta  can be positive, zero, or negative
origin  move relative to the 0, start, limit, length, or current index
Returns:
the new index, or U_SENTINEL on an error condition.
See also:
UCharIteratorOrigin , UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

Definition at line 91 of file uiter.h.

typedef UChar32 U_CALLCONV UCharIteratorNext(UCharIterator *iter)
 

Function type declaration for UCharIterator.next().

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).

Parameters:
iter  the UCharIterator structure ("this pointer")
Returns:
the current code unit (and post-increment the current index)
See also:
UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

Definition at line 151 of file uiter.h.

typedef enum UCharIteratorOrigin UCharIteratorOrigin
 

Origin constants for UCharIterator.getIndex() and UCharIterator.move().

See also:
UCharIteratorMove , UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

typedef UChar32 U_CALLCONV UCharIteratorPrevious(UCharIterator *iter)
 

Function type declaration for UCharIterator.previous().

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).

Parameters:
iter  the UCharIterator structure ("this pointer")
Returns:
the previous code unit (after pre-decrementing the current index)
See also:
UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

Definition at line 167 of file uiter.h.

typedef int32_t U_CALLCONV UCharIteratorReserved(UCharIterator *iter, int32_t something)
 

Function type declaration for UCharIterator.reservedFn().

Reserved for future use.

Parameters:
iter  the UCharIterator structure ("this pointer")
something  some integer argument
Returns:
some integer
See also:
UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

Definition at line 181 of file uiter.h.


Enumeration Type Documentation

enum UCharIteratorOrigin
 

Origin constants for UCharIterator.getIndex() and UCharIterator.move().

See also:
UCharIteratorMove , UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.
Enumeration values:
UITER_START 
UITER_CURRENT 
UITER_LIMIT 
UITER_ZERO 
UITER_LENGTH 

Definition at line 49 of file uiter.h.


Function Documentation

UChar32 uiter_current32 UCharIterator   iter
 

Helper function for UCharIterator to get the code point at the current index.

Return the code point that includes the code unit at the current position, or U_SENTINEL if there is none (index is at the limit). If the current code unit is a lead or trail surrogate, then the following or preceding surrogate is used to form the code point value.

Parameters:
iter  the UCharIterator structure ("this pointer")
Returns:
the current code point
See also:
UCharIterator , U16_GET , UnicodeString::char32At()
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

UChar32 uiter_next32 UCharIterator   iter
 

Helper function for UCharIterator to get the next code point.

Return the code point 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).

Parameters:
iter  the UCharIterator structure ("this pointer")
Returns:
the current code point (and post-increment the current index)
See also:
UCharIterator , U16_NEXT
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

UChar32 uiter_previous32 UCharIterator   iter
 

Helper function for UCharIterator to get the previous code point.

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

Parameters:
iter  the UCharIterator structure ("this pointer")
Returns:
the previous code point (after pre-decrementing the current index)
See also:
UCharIterator , U16_PREV
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

void uiter_setCharacterIterator UCharIterator   iter,
CharacterIterator   charIter
 

Set up a UCharIterator to wrap around a C++ CharacterIterator.

Sets the UCharIterator function pointers for iteration using the CharacterIterator charIter.

The CharacterIterator pointer charIter is set into UCharIterator.context without copying or cloning the CharacterIterator object. The other "protected" UCharIterator fields are set to 0 and will be ignored. The iteration index and boundaries are controlled by the CharacterIterator.

Parameters:
iter  UCharIterator structure to be set for iteration
charIter  CharacterIterator to wrap
See also:
UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

void uiter_setReplaceable UCharIterator   iter,
const Replaceable   rep
 

Set up a UCharIterator to iterate over a C++ Replaceable.

Sets the UCharIterator function pointers for iteration over the Replaceable rep with iteration boundaries start=index=0 and length=limit=rep->length(). The "provider" may set the start, index, and limit values at any time within the range 0..length=rep->length(). The length field will be ignored.

The Replaceable pointer rep is set into UCharIterator.context without copying or cloning/reallocating the Replaceable object.

Parameters:
iter  UCharIterator structure to be set for iteration
rep  Replaceable to iterate over
See also:
UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

void uiter_setString UCharIterator   iter,
const UChar *    s,
int32_t    length
 

Set up a UCharIterator to iterate over a string.

Sets the UCharIterator function pointers for iteration over the string s with iteration boundaries start=index=0 and length=limit=string length. The "provider" may set the start, index, and limit values at any time within the range 0..length. The length field will be ignored.

The string pointer s is set into UCharIterator.context without copying or reallocating the string contents.

Parameters:
iter  UCharIterator structure to be set for iteration
s  String to iterate over
length  Length of s, or -1 if NUL-terminated
See also:
UCharIterator
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.


Variable Documentation

U_NAMESPACE_BEGIN class CharacterIterator
 

Definition at line 32 of file uiter.h.

typedef struct UCharIterator UCharIterator
 

C typedef for struct UCharIterator.

Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

Definition at line 41 of file uiter.h.


Generated on Wed Dec 18 16:50:33 2002 for ICU 2.4 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001