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
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 int32_t U_CALLCONV UCharIteratorCurrent (UCharIterator *iter)
 Function type declaration for UCharIterator.current(). More...

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

typedef int32_t 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

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

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

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

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

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

U_CAPI void U_EXPORT2 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 U_CDECL_BEGIN
struct 
UCharIterator


Detailed Description

C API: Unicode Character Iteration.

See also:
UCharIterator

Definition in file uiter.h.


Typedef Documentation

typedef int32_t U_CALLCONV UCharIteratorCurrent(UCharIterator *iter)
 

Function type declaration for UCharIterator.current().

Return the code unit at the current position, or -1 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 136 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 -1 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 69 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 107 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 121 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 -1 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 92 of file uiter.h.

typedef int32_t 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 -1 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 152 of file uiter.h.

typedef enum UCharIteratorOrigin UCharIteratorOrigin
 

Definition at line 52 of file uiter.h.

typedef int32_t 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 -1 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 168 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 182 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

U_CAPI int32_t U_EXPORT2 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 -1 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 , UTF_GET_CHAR , 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.

U_CAPI int32_t U_EXPORT2 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 -1 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 , UTF_NEXT_CHAR
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

U_CAPI int32_t U_EXPORT2 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 -1 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 , UTF_PREV_CHAR
Draft:
This API has been introduced in ICU 2.1. It is still in draft state and may be modified in a future release.

U_CAPI void U_EXPORT2 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.

U_CAPI void U_EXPORT2 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.

U_CAPI void U_EXPORT2 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
 

Definition at line 41 of file uiter.h.


Generated on Thu Aug 15 14:13:42 2002 for ICU 2.2 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001