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

uiter.h File Reference

C API: Unicode Character Iteration. More...

#include "unicode/utypes.h"

Go to the source code of this file.

Data Structures

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


Variables

U_CDECL_BEGIN struct UCharIterator


Detailed Description

C API: Unicode Character Iteration.

See also:
UCharIterator

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

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  move relative to the start, limit, or current index
Returns:
the requested index
See also:
UCharIteratorOrigin , UCharIterator @draft ICU 2.1

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

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

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

Function type declaration for UCharIterator.move().

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.

Parameters:
iter  the UCharIterator structure ("this pointer")
delta  can be positive, zero, or negative
origin  move relative to the start, limit, or current index
Returns:
the new index
See also:
UCharIteratorOrigin , UCharIterator @draft ICU 2.1

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

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

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


Enumeration Type Documentation

enum UCharIteratorOrigin
 

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

See also:
UCharIteratorMove , UCharIterator @draft ICU 2.1


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

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

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

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


Generated on Sun Mar 3 16:06:56 2002 for ICU 2.0 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002