ICU 71.1 71.1

schriter.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ******************************************************************************
5 *
6 * Copyright (C) 1998-2005, International Business Machines
7 * Corporation and others. All Rights Reserved.
8 *
9 ******************************************************************************
10 *
11 * File schriter.h
12 *
13 * Modification History:
14 *
15 * Date Name Description
16 * 05/05/99 stephen Cleaned up.
17 ******************************************************************************
18 */
19
20 #ifndef SCHRITER_H
21 #define SCHRITER_H
22
23 #include "unicode/utypes.h"
24
25 #if U_SHOW_CPLUSPLUS_API
26
27 #include "unicode/chariter.h"
28 #include "unicode/uchriter.h"
29
35 U_NAMESPACE_BEGIN
48 class U_COMMON_API StringCharacterIterator : public UCharCharacterIterator {
49 public:
57 StringCharacterIterator(const UnicodeString& textStr);
58
68 StringCharacterIterator(const UnicodeString& textStr,
69 int32_t textPos);
70
87 StringCharacterIterator(const UnicodeString& textStr,
88 int32_t textBegin,
89 int32_t textEnd,
90 int32_t textPos);
91
100 StringCharacterIterator(const StringCharacterIterator& that);
101
106 virtual ~StringCharacterIterator();
107
116 StringCharacterIterator&
117 operator=(const StringCharacterIterator& that);
118
127 virtual bool operator==(const ForwardCharacterIterator& that) const override;
128
136 virtual StringCharacterIterator* clone() const override;
137
143 void setText(const UnicodeString& newText);
144
152 virtual void getText(UnicodeString& result) override;
153
159 virtual UClassID getDynamicClassID(void) const override;
160
166 static UClassID U_EXPORT2 getStaticClassID(void);
167
168 protected:
173 StringCharacterIterator();
174
181 void setText(const char16_t* newText, int32_t newTextLength);
182
187 UnicodeString text;
188
189 };
190
191 U_NAMESPACE_END
192
193 #endif /* U_SHOW_CPLUSPLUS_API */
194
195 #endif
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::UCharCharacterIterator::operator=
UCharCharacterIterator & operator=(const UCharCharacterIterator &that)
Assignment operator.
U_COMMON_API
#define U_COMMON_API
Definition: utypes.h:300
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:295
icu::StringCharacterIterator
A concrete subclass of CharacterIterator that iterates over the characters (code units or code points...
Definition: schriter.h:48
icu::UCharCharacterIterator::getDynamicClassID
virtual UClassID getDynamicClassID(void) const override
Return a class ID for this object (not really public)
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
icu::ForwardCharacterIterator
Abstract class that defines an API for forward-only iteration on text objects.
Definition: chariter.h:94
icu::UCharCharacterIterator::clone
virtual UCharCharacterIterator * clone() const override
Returns a new UCharCharacterIterator referring to the same character in the same range of the same st...
icu::StringCharacterIterator::text
UnicodeString text
Copy of the iterated string object.
Definition: schriter.h:187
uchriter.h
C++ API: char16_t Character Iterator.
icu::UCharCharacterIterator::operator==
virtual bool operator==(const ForwardCharacterIterator &that) const override
Returns true if the iterators iterate over the same range of the same string and are pointing at the ...
icu::UCharCharacterIterator::getStaticClassID
static UClassID getStaticClassID(void)
Return a class ID for this class (not really public)
chariter.h
C++ API: Character Iterator.
icu::UCharCharacterIterator
A concrete subclass of CharacterIterator that iterates over the characters (code units or code points...
Definition: uchriter.h:38
icu::UCharCharacterIterator::setText
void setText(ConstChar16Ptr newText, int32_t newTextLength)
Sets the iterator to iterate over a new range of text.
icu::UCharCharacterIterator::getText
virtual void getText(UnicodeString &result) override
Copies the char16_t array under iteration into the UnicodeString referred to by "result".