Logo Search packages:      
Sourcecode: icu version File versions  Download package

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.

This function may perform slowly for moving relative to UITER_LENGTH because an iterator implementation may have to count the rest of the UChars if the native storage is not UTF-16.

When moving relative to the limit or length, or relative to the current position after setState() was called, move() may return UITER_UNKNOWN_INDEX (-2) to avoid an inefficient determination of the actual UTF-16 index. The actual index can be determined with getIndex(UITER_CURRENT) which will count the UChars if necessary. See UITER_UNKNOWN_INDEX for details.

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, or UITER_UNKNOWN_INDEX when the index is not known.
See also:
UCharIteratorOrigin

UCharIterator

UITER_UNKNOWN_INDEX ICU 2.1

Definition at line 142 of file uiter.h.


Generated by  Doxygen 1.6.0   Back to index