00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __UITER_H__
00018 #define __UITER_H__
00019
00027 #include "unicode/utypes.h"
00028
00029 #ifdef XP_CPLUSPLUS
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
00083 #define UITER_NO_STATE ((uint32_t)0xffffffff)
00084
00103 typedef int32_t U_CALLCONV
00104 UCharIteratorGetIndex(UCharIterator *iter, UCharIteratorOrigin origin);
00105
00140 typedef int32_t U_CALLCONV
00141 UCharIteratorMove(UCharIterator *iter, int32_t delta, UCharIteratorOrigin origin);
00142
00155 typedef UBool U_CALLCONV
00156 UCharIteratorHasNext(UCharIterator *iter);
00157
00169 typedef UBool U_CALLCONV
00170 UCharIteratorHasPrevious(UCharIterator *iter);
00171
00184 typedef UChar32 U_CALLCONV
00185 UCharIteratorCurrent(UCharIterator *iter);
00186
00200 typedef UChar32 U_CALLCONV
00201 UCharIteratorNext(UCharIterator *iter);
00202
00216 typedef UChar32 U_CALLCONV
00217 UCharIteratorPrevious(UCharIterator *iter);
00218
00230 typedef int32_t U_CALLCONV
00231 UCharIteratorReserved(UCharIterator *iter, int32_t something);
00232
00273 typedef uint32_t U_CALLCONV
00274 UCharIteratorGetState(const UCharIterator *iter);
00275
00301 typedef void U_CALLCONV
00302 UCharIteratorSetState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode);
00303
00304
00325 struct UCharIterator {
00331 const void *context;
00332
00338 int32_t length;
00339
00345 int32_t start;
00346
00352 int32_t index;
00353
00359 int32_t limit;
00360
00365 int32_t reservedField;
00366
00374 UCharIteratorGetIndex *getIndex;
00375
00385 UCharIteratorMove *move;
00386
00394 UCharIteratorHasNext *hasNext;
00395
00402 UCharIteratorHasPrevious *hasPrevious;
00403
00411 UCharIteratorCurrent *current;
00412
00421 UCharIteratorNext *next;
00422
00431 UCharIteratorPrevious *previous;
00432
00439 UCharIteratorReserved *reservedFn;
00440
00448 UCharIteratorGetState *getState;
00449
00458 UCharIteratorSetState *setState;
00459 };
00460
00479 U_CAPI UChar32 U_EXPORT2
00480 uiter_current32(UCharIterator *iter);
00481
00496 U_CAPI UChar32 U_EXPORT2
00497 uiter_next32(UCharIterator *iter);
00498
00513 U_CAPI UChar32 U_EXPORT2
00514 uiter_previous32(UCharIterator *iter);
00515
00534 U_CAPI uint32_t U_EXPORT2
00535 uiter_getState(const UCharIterator *iter);
00536
00552 U_CAPI void U_EXPORT2
00553 uiter_setState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode);
00554
00577 U_CAPI void U_EXPORT2
00578 uiter_setString(UCharIterator *iter, const UChar *s, int32_t length);
00579
00600 U_CAPI void U_EXPORT2
00601 uiter_setUTF16BE(UCharIterator *iter, const char *s, int32_t length);
00602
00636 U_CAPI void U_EXPORT2
00637 uiter_setUTF8(UCharIterator *iter, const char *s, int32_t length);
00638
00639 #ifdef XP_CPLUSPLUS
00640
00661 U_CAPI void U_EXPORT2
00662 uiter_setCharacterIterator(UCharIterator *iter, CharacterIterator *charIter);
00663
00686 U_CAPI void U_EXPORT2
00687 uiter_setReplaceable(UCharIterator *iter, const Replaceable *rep);
00688
00689 #endif
00690
00691 U_CDECL_END
00692
00693 #endif