00001
00002
00003
00004
00005
00006
00007
00008 #ifndef UCHRITER_H
00009 #define UCHRITER_H
00010
00011 #include "unicode/utypes.h"
00012 #include "unicode/chariter.h"
00013
00014
00026 class U_COMMON_API UCharCharacterIterator : public CharacterIterator {
00027 public:
00035 UCharCharacterIterator(const UChar* textPtr, int32_t length);
00036
00047 UCharCharacterIterator(const UChar* textPtr, int32_t length,
00048 UTextOffset position);
00049
00061 UCharCharacterIterator(const UChar* textPtr, int32_t length,
00062 UTextOffset textBegin,
00063 UTextOffset textEnd,
00064 UTextOffset position);
00065
00072 UCharCharacterIterator(const UCharCharacterIterator& that);
00073
00078 ~UCharCharacterIterator();
00079
00086 UCharCharacterIterator&
00087 operator=(const UCharCharacterIterator& that);
00088
00094 virtual UBool operator==(const ForwardCharacterIterator& that) const;
00095
00100 virtual int32_t hashCode(void) const;
00101
00108 virtual CharacterIterator* clone(void) const;
00109
00116 virtual UChar first(void);
00117
00125 virtual UChar firstPostInc(void);
00126
00135 virtual UChar32 first32(void);
00136
00144 virtual UChar32 first32PostInc(void);
00145
00152 virtual UChar last(void);
00153
00160 virtual UChar32 last32(void);
00161
00168 virtual UChar setIndex(UTextOffset position);
00169
00179 virtual UChar32 setIndex32(UTextOffset position);
00180
00185 virtual UChar current(void) const;
00186
00191 virtual UChar32 current32(void) const;
00192
00199 virtual UChar next(void);
00200
00208 virtual UChar nextPostInc(void);
00209
00219 virtual UChar32 next32(void);
00220
00228 virtual UChar32 next32PostInc(void);
00229
00236 virtual UBool hasNext();
00237
00244 virtual UChar previous(void);
00245
00252 virtual UChar32 previous32(void);
00253
00260 virtual UBool hasPrevious();
00261
00269 virtual UTextOffset move(int32_t delta, EOrigin origin);
00270
00278 virtual UTextOffset move32(int32_t delta, EOrigin origin);
00279
00284 void setText(const UChar* newText, int32_t newTextLength);
00285
00293 virtual void getText(UnicodeString& result);
00294
00299 virtual UClassID getDynamicClassID(void) const
00300 { return getStaticClassID(); }
00301
00306 static UClassID getStaticClassID(void)
00307 { return (UClassID)(&fgClassID); }
00308
00309 protected:
00310 UCharCharacterIterator();
00311
00312 const UChar* text;
00313
00314 static char fgClassID;
00315 };
00316
00317 #endif