Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

uiter.h File Reference

C API: Unicode Character Iteration. More...

#include "unicode/utypes.h"

Go to the source code of this file.

Typedefs

typedef UCharIterator UCharIterator
typedef enum UCharIteratorOrigin UCharIteratorOrigin
typedef int32_t U_CALLCONV UCharIteratorGetIndex (UCharIterator *iter, UCharIteratorOrigin origin)
 Function type declaration for UCharIterator.getIndex().
typedef int32_t U_CALLCONV UCharIteratorMove (UCharIterator *iter, int32_t delta, UCharIteratorOrigin origin)
 Function type declaration for UCharIterator.move().
typedef UBool U_CALLCONV UCharIteratorHasNext (UCharIterator *iter)
 Function type declaration for UCharIterator.hasNext().
typedef UBool U_CALLCONV UCharIteratorHasPrevious (UCharIterator *iter)
 Function type declaration for UCharIterator.hasPrevious().
typedef int32_t U_CALLCONV UCharIteratorCurrent (UCharIterator *iter)
 Function type declaration for UCharIterator.current().
typedef int32_t U_CALLCONV UCharIteratorNext (UCharIterator *iter)
 Function type declaration for UCharIterator.next().
typedef int32_t U_CALLCONV UCharIteratorPrevious (UCharIterator *iter)
 Function type declaration for UCharIterator.previous().
typedef int32_t U_CALLCONV UCharIteratorReserved (UCharIterator *iter, int32_t something)
 Function type declaration for UCharIterator.reservedFn().

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.
U_CAPI int32_t U_EXPORT2 uiter_next32 (UCharIterator *iter)
 Helper function for UCharIterator to get the next code point.
U_CAPI int32_t U_EXPORT2 uiter_previous32 (UCharIterator *iter)
 Helper function for UCharIterator to get the previous code point.
U_CAPI void U_EXPORT2 uiter_setString (UCharIterator *iter, const UChar *s, int32_t length)
 Set up a UCharIterator to iterate over a string.


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 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 get the 0, start, limit, length, or current index
Returns:
the requested index, or -1 in an error condition
See also:
UCharIteratorOrigin

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

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


Enumeration Type Documentation

enum UCharIteratorOrigin
 

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

See also:
UCharIteratorMove

UCharIterator 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() 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 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 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 ICU 2.1


Generated on Sun May 22 18:49:37 2005 for ICU 2.1 by  doxygen 1.4.2