ICU 4.8.1.1
4.8.1.1
|
00001 /* 00002 ******************************************************************************* 00003 * 00004 * Copyright (C) 2002-2006,2009 International Business Machines 00005 * Corporation and others. All Rights Reserved. 00006 * 00007 ******************************************************************************* 00008 * file name: uiter.h 00009 * encoding: US-ASCII 00010 * tab size: 8 (not used) 00011 * indentation:4 00012 * 00013 * created on: 2002jan18 00014 * created by: Markus W. Scherer 00015 */ 00016 00017 #ifndef __UITER_H__ 00018 #define __UITER_H__ 00019 00027 #include "unicode/utypes.h" 00028 00029 #if U_SHOW_CPLUSPLUS_API 00030 U_NAMESPACE_BEGIN 00031 00032 class CharacterIterator; 00033 class Replaceable; 00034 00035 U_NAMESPACE_END 00036 #endif 00037 00038 U_CDECL_BEGIN 00039 00040 struct UCharIterator; 00041 typedef struct UCharIterator UCharIterator; 00049 typedef enum UCharIteratorOrigin { 00050 UITER_START, UITER_CURRENT, UITER_LIMIT, UITER_ZERO, UITER_LENGTH 00051 } UCharIteratorOrigin; 00052 00054 enum { 00069 UITER_UNKNOWN_INDEX=-2 00070 }; 00071 00072 00084 #define UITER_NO_STATE ((uint32_t)0xffffffff) 00085 00104 typedef int32_t U_CALLCONV 00105 UCharIteratorGetIndex(UCharIterator *iter, UCharIteratorOrigin origin); 00106 00141 typedef int32_t U_CALLCONV 00142 UCharIteratorMove(UCharIterator *iter, int32_t delta, UCharIteratorOrigin origin); 00143 00156 typedef UBool U_CALLCONV 00157 UCharIteratorHasNext(UCharIterator *iter); 00158 00170 typedef UBool U_CALLCONV 00171 UCharIteratorHasPrevious(UCharIterator *iter); 00172 00185 typedef UChar32 U_CALLCONV 00186 UCharIteratorCurrent(UCharIterator *iter); 00187 00201 typedef UChar32 U_CALLCONV 00202 UCharIteratorNext(UCharIterator *iter); 00203 00217 typedef UChar32 U_CALLCONV 00218 UCharIteratorPrevious(UCharIterator *iter); 00219 00231 typedef int32_t U_CALLCONV 00232 UCharIteratorReserved(UCharIterator *iter, int32_t something); 00233 00278 typedef uint32_t U_CALLCONV 00279 UCharIteratorGetState(const UCharIterator *iter); 00280 00306 typedef void U_CALLCONV 00307 UCharIteratorSetState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode); 00308 00309 00339 struct UCharIterator { 00345 const void *context; 00346 00352 int32_t length; 00353 00359 int32_t start; 00360 00366 int32_t index; 00367 00373 int32_t limit; 00374 00379 int32_t reservedField; 00380 00388 UCharIteratorGetIndex *getIndex; 00389 00399 UCharIteratorMove *move; 00400 00408 UCharIteratorHasNext *hasNext; 00409 00416 UCharIteratorHasPrevious *hasPrevious; 00417 00425 UCharIteratorCurrent *current; 00426 00435 UCharIteratorNext *next; 00436 00445 UCharIteratorPrevious *previous; 00446 00453 UCharIteratorReserved *reservedFn; 00454 00462 UCharIteratorGetState *getState; 00463 00472 UCharIteratorSetState *setState; 00473 }; 00474 00493 U_STABLE UChar32 U_EXPORT2 00494 uiter_current32(UCharIterator *iter); 00495 00510 U_STABLE UChar32 U_EXPORT2 00511 uiter_next32(UCharIterator *iter); 00512 00527 U_STABLE UChar32 U_EXPORT2 00528 uiter_previous32(UCharIterator *iter); 00529 00548 U_STABLE uint32_t U_EXPORT2 00549 uiter_getState(const UCharIterator *iter); 00550 00566 U_STABLE void U_EXPORT2 00567 uiter_setState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode); 00568 00591 U_STABLE void U_EXPORT2 00592 uiter_setString(UCharIterator *iter, const UChar *s, int32_t length); 00593 00614 U_STABLE void U_EXPORT2 00615 uiter_setUTF16BE(UCharIterator *iter, const char *s, int32_t length); 00616 00650 U_STABLE void U_EXPORT2 00651 uiter_setUTF8(UCharIterator *iter, const char *s, int32_t length); 00652 00653 #if U_SHOW_CPLUSPLUS_API 00654 00675 U_STABLE void U_EXPORT2 00676 uiter_setCharacterIterator(UCharIterator *iter, U_NAMESPACE_QUALIFIER CharacterIterator *charIter); 00677 00700 U_STABLE void U_EXPORT2 00701 uiter_setReplaceable(UCharIterator *iter, const U_NAMESPACE_QUALIFIER Replaceable *rep); 00702 00703 #endif 00704 00705 U_CDECL_END 00706 00707 #endif