]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/sfwdchit.h
1 /********************************************************************
3 * Copyright (c) 1997-2003, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
10 #include "unicode/chariter.h"
13 class SimpleFwdCharIterator
: public ForwardCharacterIterator
{
15 // not used -- SimpleFwdCharIterator(const UnicodeString& s);
16 SimpleFwdCharIterator(UChar
*s
, int32_t len
, UBool adopt
= FALSE
);
18 virtual ~SimpleFwdCharIterator();
21 * Returns true when both iterators refer to the same
22 * character in the same character-storage object.
24 // not used -- virtual UBool operator==(const ForwardCharacterIterator& that) const;
27 * Generates a hash code for this iterator.
29 virtual int32_t hashCode(void) const;
32 * Returns a UClassID for this ForwardCharacterIterator ("poor man's
33 * RTTI").<P> Despite the fact that this function is public,
34 * DO NOT CONSIDER IT PART OF CHARACTERITERATOR'S API!
36 virtual UClassID
getDynamicClassID(void) const;
39 * Gets the current code unit for returning and advances to the next code unit
40 * in the iteration range
41 * (toward endIndex()). If there are
42 * no more code units to return, returns DONE.
44 virtual UChar
nextPostInc(void);
47 * Gets the current code point for returning and advances to the next code point
48 * in the iteration range
49 * (toward endIndex()). If there are
50 * no more code points to return, returns DONE.
52 virtual UChar32
next32PostInc(void);
55 * Returns FALSE if there are no more code units or code points
56 * at or after the current position in the iteration range.
57 * This is used with nextPostInc() or next32PostInc() in forward
60 virtual UBool
hasNext();
63 SimpleFwdCharIterator() {}
64 SimpleFwdCharIterator(const SimpleFwdCharIterator
&other
)
65 : ForwardCharacterIterator(other
) {}
66 SimpleFwdCharIterator
&operator=(const SimpleFwdCharIterator
&) { return *this; }
68 static const int32_t kInvalidHashCode
;
69 static const int32_t kEmptyHashCode
;
71 UChar
*fStart
, *fEnd
, *fCurrent
;