xref: /aosp_15_r20/external/icu/libicu/cts_headers/unicode/usetiter.h (revision 0e209d3975ff4a8c132096b14b0e9364a753506e)
1*0e209d39SAndroid Build Coastguard Worker // © 2016 and later: Unicode, Inc. and others.
2*0e209d39SAndroid Build Coastguard Worker // License & terms of use: http://www.unicode.org/copyright.html
3*0e209d39SAndroid Build Coastguard Worker /*
4*0e209d39SAndroid Build Coastguard Worker **********************************************************************
5*0e209d39SAndroid Build Coastguard Worker * Copyright (c) 2002-2014, International Business Machines
6*0e209d39SAndroid Build Coastguard Worker * Corporation and others.  All Rights Reserved.
7*0e209d39SAndroid Build Coastguard Worker **********************************************************************
8*0e209d39SAndroid Build Coastguard Worker */
9*0e209d39SAndroid Build Coastguard Worker #ifndef USETITER_H
10*0e209d39SAndroid Build Coastguard Worker #define USETITER_H
11*0e209d39SAndroid Build Coastguard Worker 
12*0e209d39SAndroid Build Coastguard Worker #include "unicode/utypes.h"
13*0e209d39SAndroid Build Coastguard Worker 
14*0e209d39SAndroid Build Coastguard Worker #if U_SHOW_CPLUSPLUS_API
15*0e209d39SAndroid Build Coastguard Worker 
16*0e209d39SAndroid Build Coastguard Worker #include "unicode/uobject.h"
17*0e209d39SAndroid Build Coastguard Worker #include "unicode/unistr.h"
18*0e209d39SAndroid Build Coastguard Worker 
19*0e209d39SAndroid Build Coastguard Worker /**
20*0e209d39SAndroid Build Coastguard Worker  * \file
21*0e209d39SAndroid Build Coastguard Worker  * \brief C++ API: UnicodeSetIterator iterates over the contents of a UnicodeSet.
22*0e209d39SAndroid Build Coastguard Worker  */
23*0e209d39SAndroid Build Coastguard Worker 
24*0e209d39SAndroid Build Coastguard Worker U_NAMESPACE_BEGIN
25*0e209d39SAndroid Build Coastguard Worker 
26*0e209d39SAndroid Build Coastguard Worker class UnicodeSet;
27*0e209d39SAndroid Build Coastguard Worker class UnicodeString;
28*0e209d39SAndroid Build Coastguard Worker 
29*0e209d39SAndroid Build Coastguard Worker /**
30*0e209d39SAndroid Build Coastguard Worker  *
31*0e209d39SAndroid Build Coastguard Worker  * UnicodeSetIterator iterates over the contents of a UnicodeSet.  It
32*0e209d39SAndroid Build Coastguard Worker  * iterates over either code points or code point ranges.  After all
33*0e209d39SAndroid Build Coastguard Worker  * code points or ranges have been returned, it returns the
34*0e209d39SAndroid Build Coastguard Worker  * multicharacter strings of the UnicodeSet, if any.
35*0e209d39SAndroid Build Coastguard Worker  *
36*0e209d39SAndroid Build Coastguard Worker  * This class is not intended for public subclassing.
37*0e209d39SAndroid Build Coastguard Worker  *
38*0e209d39SAndroid Build Coastguard Worker  * <p>To iterate over code points and strings, use a loop like this:
39*0e209d39SAndroid Build Coastguard Worker  * <pre>
40*0e209d39SAndroid Build Coastguard Worker  * UnicodeSetIterator it(set);
41*0e209d39SAndroid Build Coastguard Worker  * while (it.next()) {
42*0e209d39SAndroid Build Coastguard Worker  *     processItem(it.getString());
43*0e209d39SAndroid Build Coastguard Worker  * }
44*0e209d39SAndroid Build Coastguard Worker  * </pre>
45*0e209d39SAndroid Build Coastguard Worker  * <p>Each item in the set is accessed as a string.  Set elements
46*0e209d39SAndroid Build Coastguard Worker  *    consisting of single code points are returned as strings containing
47*0e209d39SAndroid Build Coastguard Worker  *    just the one code point.
48*0e209d39SAndroid Build Coastguard Worker  *
49*0e209d39SAndroid Build Coastguard Worker  * <p>To iterate over code point ranges, instead of individual code points,
50*0e209d39SAndroid Build Coastguard Worker  *    use a loop like this:
51*0e209d39SAndroid Build Coastguard Worker  * <pre>
52*0e209d39SAndroid Build Coastguard Worker  * UnicodeSetIterator it(set);
53*0e209d39SAndroid Build Coastguard Worker  * while (it.nextRange()) {
54*0e209d39SAndroid Build Coastguard Worker  *   if (it.isString()) {
55*0e209d39SAndroid Build Coastguard Worker  *     processString(it.getString());
56*0e209d39SAndroid Build Coastguard Worker  *   } else {
57*0e209d39SAndroid Build Coastguard Worker  *     processCodepointRange(it.getCodepoint(), it.getCodepointEnd());
58*0e209d39SAndroid Build Coastguard Worker  *   }
59*0e209d39SAndroid Build Coastguard Worker  * }
60*0e209d39SAndroid Build Coastguard Worker  * </pre>
61*0e209d39SAndroid Build Coastguard Worker  *
62*0e209d39SAndroid Build Coastguard Worker  * To iterate over only the strings, start with <code>skipToStrings()</code>.
63*0e209d39SAndroid Build Coastguard Worker  *
64*0e209d39SAndroid Build Coastguard Worker  * @author M. Davis
65*0e209d39SAndroid Build Coastguard Worker  * @stable ICU 2.4
66*0e209d39SAndroid Build Coastguard Worker  */
67*0e209d39SAndroid Build Coastguard Worker class U_COMMON_API UnicodeSetIterator final : public UObject {
68*0e209d39SAndroid Build Coastguard Worker     /**
69*0e209d39SAndroid Build Coastguard Worker      * Value of <tt>codepoint</tt> if the iterator points to a string.
70*0e209d39SAndroid Build Coastguard Worker      * If <tt>codepoint == IS_STRING</tt>, then examine
71*0e209d39SAndroid Build Coastguard Worker      * <tt>string</tt> for the current iteration result.
72*0e209d39SAndroid Build Coastguard Worker      */
73*0e209d39SAndroid Build Coastguard Worker     enum { IS_STRING = -1 };
74*0e209d39SAndroid Build Coastguard Worker 
75*0e209d39SAndroid Build Coastguard Worker     /**
76*0e209d39SAndroid Build Coastguard Worker      * Current code point, or the special value <tt>IS_STRING</tt>, if
77*0e209d39SAndroid Build Coastguard Worker      * the iterator points to a string.
78*0e209d39SAndroid Build Coastguard Worker      */
79*0e209d39SAndroid Build Coastguard Worker     UChar32 codepoint;
80*0e209d39SAndroid Build Coastguard Worker 
81*0e209d39SAndroid Build Coastguard Worker     /**
82*0e209d39SAndroid Build Coastguard Worker      * When iterating over ranges using <tt>nextRange()</tt>,
83*0e209d39SAndroid Build Coastguard Worker      * <tt>codepointEnd</tt> contains the inclusive end of the
84*0e209d39SAndroid Build Coastguard Worker      * iteration range, if <tt>codepoint != IS_STRING</tt>.  If
85*0e209d39SAndroid Build Coastguard Worker      * iterating over code points using <tt>next()</tt>, or if
86*0e209d39SAndroid Build Coastguard Worker      * <tt>codepoint == IS_STRING</tt>, then the value of
87*0e209d39SAndroid Build Coastguard Worker      * <tt>codepointEnd</tt> is undefined.
88*0e209d39SAndroid Build Coastguard Worker      */
89*0e209d39SAndroid Build Coastguard Worker     UChar32 codepointEnd;
90*0e209d39SAndroid Build Coastguard Worker 
91*0e209d39SAndroid Build Coastguard Worker     /**
92*0e209d39SAndroid Build Coastguard Worker      * If <tt>codepoint == IS_STRING</tt>, then <tt>string</tt> points
93*0e209d39SAndroid Build Coastguard Worker      * to the current string.  If <tt>codepoint != IS_STRING</tt>, the
94*0e209d39SAndroid Build Coastguard Worker      * value of <tt>string</tt> is undefined.
95*0e209d39SAndroid Build Coastguard Worker      */
96*0e209d39SAndroid Build Coastguard Worker     const UnicodeString* string;
97*0e209d39SAndroid Build Coastguard Worker 
98*0e209d39SAndroid Build Coastguard Worker  public:
99*0e209d39SAndroid Build Coastguard Worker 
100*0e209d39SAndroid Build Coastguard Worker     /**
101*0e209d39SAndroid Build Coastguard Worker      * Create an iterator over the given set.  The iterator is valid
102*0e209d39SAndroid Build Coastguard Worker      * only so long as <tt>set</tt> is valid.
103*0e209d39SAndroid Build Coastguard Worker      * @param set set to iterate over
104*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
105*0e209d39SAndroid Build Coastguard Worker      */
106*0e209d39SAndroid Build Coastguard Worker     UnicodeSetIterator(const UnicodeSet& set);
107*0e209d39SAndroid Build Coastguard Worker 
108*0e209d39SAndroid Build Coastguard Worker     /**
109*0e209d39SAndroid Build Coastguard Worker      * Create an iterator over nothing.  <tt>next()</tt> and
110*0e209d39SAndroid Build Coastguard Worker      * <tt>nextRange()</tt> return false. This is a convenience
111*0e209d39SAndroid Build Coastguard Worker      * constructor allowing the target to be set later.
112*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
113*0e209d39SAndroid Build Coastguard Worker      */
114*0e209d39SAndroid Build Coastguard Worker     UnicodeSetIterator();
115*0e209d39SAndroid Build Coastguard Worker 
116*0e209d39SAndroid Build Coastguard Worker     /**
117*0e209d39SAndroid Build Coastguard Worker      * Destructor.
118*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
119*0e209d39SAndroid Build Coastguard Worker      */
120*0e209d39SAndroid Build Coastguard Worker     virtual ~UnicodeSetIterator();
121*0e209d39SAndroid Build Coastguard Worker 
122*0e209d39SAndroid Build Coastguard Worker     /**
123*0e209d39SAndroid Build Coastguard Worker      * Returns true if the current element is a string.  If so, the
124*0e209d39SAndroid Build Coastguard Worker      * caller can retrieve it with <tt>getString()</tt>.  If this
125*0e209d39SAndroid Build Coastguard Worker      * method returns false, the current element is a code point or
126*0e209d39SAndroid Build Coastguard Worker      * code point range, depending on whether <tt>next()</tt> or
127*0e209d39SAndroid Build Coastguard Worker      * <tt>nextRange()</tt> was called.
128*0e209d39SAndroid Build Coastguard Worker      * Elements of types string and codepoint can both be retrieved
129*0e209d39SAndroid Build Coastguard Worker      * with the function <tt>getString()</tt>.
130*0e209d39SAndroid Build Coastguard Worker      * Elements of type codepoint can also be retrieved with
131*0e209d39SAndroid Build Coastguard Worker      * <tt>getCodepoint()</tt>.
132*0e209d39SAndroid Build Coastguard Worker      * For ranges, <tt>getCodepoint()</tt> returns the starting codepoint
133*0e209d39SAndroid Build Coastguard Worker      * of the range, and <tt>getCodepointEnd()</tt> returns the end
134*0e209d39SAndroid Build Coastguard Worker      * of the range.
135*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
136*0e209d39SAndroid Build Coastguard Worker      */
137*0e209d39SAndroid Build Coastguard Worker     inline UBool isString() const;
138*0e209d39SAndroid Build Coastguard Worker 
139*0e209d39SAndroid Build Coastguard Worker     /**
140*0e209d39SAndroid Build Coastguard Worker      * Returns the current code point, if <tt>isString()</tt> returned
141*0e209d39SAndroid Build Coastguard Worker      * false.  Otherwise returns an undefined result.
142*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
143*0e209d39SAndroid Build Coastguard Worker      */
144*0e209d39SAndroid Build Coastguard Worker     inline UChar32 getCodepoint() const;
145*0e209d39SAndroid Build Coastguard Worker 
146*0e209d39SAndroid Build Coastguard Worker     /**
147*0e209d39SAndroid Build Coastguard Worker      * Returns the end of the current code point range, if
148*0e209d39SAndroid Build Coastguard Worker      * <tt>isString()</tt> returned false and <tt>nextRange()</tt> was
149*0e209d39SAndroid Build Coastguard Worker      * called.  Otherwise returns an undefined result.
150*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
151*0e209d39SAndroid Build Coastguard Worker      */
152*0e209d39SAndroid Build Coastguard Worker     inline UChar32 getCodepointEnd() const;
153*0e209d39SAndroid Build Coastguard Worker 
154*0e209d39SAndroid Build Coastguard Worker     /**
155*0e209d39SAndroid Build Coastguard Worker      * Returns the current string, if <tt>isString()</tt> returned
156*0e209d39SAndroid Build Coastguard Worker      * true.  If the current iteration item is a code point, a UnicodeString
157*0e209d39SAndroid Build Coastguard Worker      * containing that single code point is returned.
158*0e209d39SAndroid Build Coastguard Worker      *
159*0e209d39SAndroid Build Coastguard Worker      * Ownership of the returned string remains with the iterator.
160*0e209d39SAndroid Build Coastguard Worker      * The string is guaranteed to remain valid only until the iterator is
161*0e209d39SAndroid Build Coastguard Worker      *   advanced to the next item, or until the iterator is deleted.
162*0e209d39SAndroid Build Coastguard Worker      *
163*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
164*0e209d39SAndroid Build Coastguard Worker      */
165*0e209d39SAndroid Build Coastguard Worker     const UnicodeString& getString();
166*0e209d39SAndroid Build Coastguard Worker 
167*0e209d39SAndroid Build Coastguard Worker     /**
168*0e209d39SAndroid Build Coastguard Worker      * Skips over the remaining code points/ranges, if any.
169*0e209d39SAndroid Build Coastguard Worker      * A following call to next() or nextRange() will yield a string, if there is one.
170*0e209d39SAndroid Build Coastguard Worker      * No-op if next() would return false, or if it would yield a string anyway.
171*0e209d39SAndroid Build Coastguard Worker      *
172*0e209d39SAndroid Build Coastguard Worker      * @return *this
173*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 70
174*0e209d39SAndroid Build Coastguard Worker      * @see UnicodeSet#strings()
175*0e209d39SAndroid Build Coastguard Worker      */
skipToStrings()176*0e209d39SAndroid Build Coastguard Worker     inline UnicodeSetIterator &skipToStrings() {
177*0e209d39SAndroid Build Coastguard Worker         // Finish code point/range iteration.
178*0e209d39SAndroid Build Coastguard Worker         range = endRange;
179*0e209d39SAndroid Build Coastguard Worker         endElement = -1;
180*0e209d39SAndroid Build Coastguard Worker         nextElement = 0;
181*0e209d39SAndroid Build Coastguard Worker         return *this;
182*0e209d39SAndroid Build Coastguard Worker     }
183*0e209d39SAndroid Build Coastguard Worker 
184*0e209d39SAndroid Build Coastguard Worker     /**
185*0e209d39SAndroid Build Coastguard Worker      * Advances the iteration position to the next element in the set,
186*0e209d39SAndroid Build Coastguard Worker      * which can be either a single code point or a string.
187*0e209d39SAndroid Build Coastguard Worker      * If there are no more elements in the set, return false.
188*0e209d39SAndroid Build Coastguard Worker      *
189*0e209d39SAndroid Build Coastguard Worker      * <p>
190*0e209d39SAndroid Build Coastguard Worker      * If <tt>isString() == true</tt>, the value is a
191*0e209d39SAndroid Build Coastguard Worker      * string, otherwise the value is a
192*0e209d39SAndroid Build Coastguard Worker      * single code point.  Elements of either type can be retrieved
193*0e209d39SAndroid Build Coastguard Worker      * with the function <tt>getString()</tt>, while elements of
194*0e209d39SAndroid Build Coastguard Worker      * consisting of a single code point can be retrieved with
195*0e209d39SAndroid Build Coastguard Worker      * <tt>getCodepoint()</tt>
196*0e209d39SAndroid Build Coastguard Worker      *
197*0e209d39SAndroid Build Coastguard Worker      * <p>The order of iteration is all code points in sorted order,
198*0e209d39SAndroid Build Coastguard Worker      * followed by all strings sorted order.    Do not mix
199*0e209d39SAndroid Build Coastguard Worker      * calls to <tt>next()</tt> and <tt>nextRange()</tt> without
200*0e209d39SAndroid Build Coastguard Worker      * calling <tt>reset()</tt> between them.  The results of doing so
201*0e209d39SAndroid Build Coastguard Worker      * are undefined.
202*0e209d39SAndroid Build Coastguard Worker      *
203*0e209d39SAndroid Build Coastguard Worker      * @return true if there was another element in the set.
204*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
205*0e209d39SAndroid Build Coastguard Worker      */
206*0e209d39SAndroid Build Coastguard Worker     UBool next();
207*0e209d39SAndroid Build Coastguard Worker 
208*0e209d39SAndroid Build Coastguard Worker     /**
209*0e209d39SAndroid Build Coastguard Worker      * Returns the next element in the set, either a code point range
210*0e209d39SAndroid Build Coastguard Worker      * or a string.  If there are no more elements in the set, return
211*0e209d39SAndroid Build Coastguard Worker      * false.  If <tt>isString() == true</tt>, the value is a
212*0e209d39SAndroid Build Coastguard Worker      * string and can be accessed with <tt>getString()</tt>.  Otherwise the value is a
213*0e209d39SAndroid Build Coastguard Worker      * range of one or more code points from <tt>getCodepoint()</tt> to
214*0e209d39SAndroid Build Coastguard Worker      * <tt>getCodepointeEnd()</tt> inclusive.
215*0e209d39SAndroid Build Coastguard Worker      *
216*0e209d39SAndroid Build Coastguard Worker      * <p>The order of iteration is all code points ranges in sorted
217*0e209d39SAndroid Build Coastguard Worker      * order, followed by all strings sorted order.  Ranges are
218*0e209d39SAndroid Build Coastguard Worker      * disjoint and non-contiguous.  The value returned from <tt>getString()</tt>
219*0e209d39SAndroid Build Coastguard Worker      * is undefined unless <tt>isString() == true</tt>.  Do not mix calls to
220*0e209d39SAndroid Build Coastguard Worker      * <tt>next()</tt> and <tt>nextRange()</tt> without calling
221*0e209d39SAndroid Build Coastguard Worker      * <tt>reset()</tt> between them.  The results of doing so are
222*0e209d39SAndroid Build Coastguard Worker      * undefined.
223*0e209d39SAndroid Build Coastguard Worker      *
224*0e209d39SAndroid Build Coastguard Worker      * @return true if there was another element in the set.
225*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
226*0e209d39SAndroid Build Coastguard Worker      */
227*0e209d39SAndroid Build Coastguard Worker     UBool nextRange();
228*0e209d39SAndroid Build Coastguard Worker 
229*0e209d39SAndroid Build Coastguard Worker     /**
230*0e209d39SAndroid Build Coastguard Worker      * Sets this iterator to visit the elements of the given set and
231*0e209d39SAndroid Build Coastguard Worker      * resets it to the start of that set.  The iterator is valid only
232*0e209d39SAndroid Build Coastguard Worker      * so long as <tt>set</tt> is valid.
233*0e209d39SAndroid Build Coastguard Worker      * @param set the set to iterate over.
234*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
235*0e209d39SAndroid Build Coastguard Worker      */
236*0e209d39SAndroid Build Coastguard Worker     void reset(const UnicodeSet& set);
237*0e209d39SAndroid Build Coastguard Worker 
238*0e209d39SAndroid Build Coastguard Worker     /**
239*0e209d39SAndroid Build Coastguard Worker      * Resets this iterator to the start of the set.
240*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
241*0e209d39SAndroid Build Coastguard Worker      */
242*0e209d39SAndroid Build Coastguard Worker     void reset();
243*0e209d39SAndroid Build Coastguard Worker 
244*0e209d39SAndroid Build Coastguard Worker     /**
245*0e209d39SAndroid Build Coastguard Worker      * ICU "poor man's RTTI", returns a UClassID for this class.
246*0e209d39SAndroid Build Coastguard Worker      *
247*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
248*0e209d39SAndroid Build Coastguard Worker      */
249*0e209d39SAndroid Build Coastguard Worker     static UClassID U_EXPORT2 getStaticClassID();
250*0e209d39SAndroid Build Coastguard Worker 
251*0e209d39SAndroid Build Coastguard Worker     /**
252*0e209d39SAndroid Build Coastguard Worker      * ICU "poor man's RTTI", returns a UClassID for the actual class.
253*0e209d39SAndroid Build Coastguard Worker      *
254*0e209d39SAndroid Build Coastguard Worker      * @stable ICU 2.4
255*0e209d39SAndroid Build Coastguard Worker      */
256*0e209d39SAndroid Build Coastguard Worker     virtual UClassID getDynamicClassID() const override;
257*0e209d39SAndroid Build Coastguard Worker 
258*0e209d39SAndroid Build Coastguard Worker     // ======================= PRIVATES ===========================
259*0e209d39SAndroid Build Coastguard Worker 
260*0e209d39SAndroid Build Coastguard Worker private:
261*0e209d39SAndroid Build Coastguard Worker 
262*0e209d39SAndroid Build Coastguard Worker     // endElement and nextElements are really UChar32's, but we keep
263*0e209d39SAndroid Build Coastguard Worker     // them as signed int32_t's so we can do comparisons with
264*0e209d39SAndroid Build Coastguard Worker     // endElement set to -1.  Leave them as int32_t's.
265*0e209d39SAndroid Build Coastguard Worker     /** The set
266*0e209d39SAndroid Build Coastguard Worker      */
267*0e209d39SAndroid Build Coastguard Worker     const UnicodeSet* set;
268*0e209d39SAndroid Build Coastguard Worker     /** End range
269*0e209d39SAndroid Build Coastguard Worker      */
270*0e209d39SAndroid Build Coastguard Worker     int32_t endRange;
271*0e209d39SAndroid Build Coastguard Worker     /** Range
272*0e209d39SAndroid Build Coastguard Worker      */
273*0e209d39SAndroid Build Coastguard Worker     int32_t range;
274*0e209d39SAndroid Build Coastguard Worker     /** End element
275*0e209d39SAndroid Build Coastguard Worker      */
276*0e209d39SAndroid Build Coastguard Worker     int32_t endElement;
277*0e209d39SAndroid Build Coastguard Worker     /** Next element
278*0e209d39SAndroid Build Coastguard Worker      */
279*0e209d39SAndroid Build Coastguard Worker     int32_t nextElement;
280*0e209d39SAndroid Build Coastguard Worker     /** Next string
281*0e209d39SAndroid Build Coastguard Worker      */
282*0e209d39SAndroid Build Coastguard Worker     int32_t nextString;
283*0e209d39SAndroid Build Coastguard Worker     /** String count
284*0e209d39SAndroid Build Coastguard Worker      */
285*0e209d39SAndroid Build Coastguard Worker     int32_t stringCount;
286*0e209d39SAndroid Build Coastguard Worker 
287*0e209d39SAndroid Build Coastguard Worker     /**
288*0e209d39SAndroid Build Coastguard Worker      *  Points to the string to use when the caller asks for a
289*0e209d39SAndroid Build Coastguard Worker      *  string and the current iteration item is a code point, not a string.
290*0e209d39SAndroid Build Coastguard Worker      */
291*0e209d39SAndroid Build Coastguard Worker     UnicodeString *cpString;
292*0e209d39SAndroid Build Coastguard Worker 
293*0e209d39SAndroid Build Coastguard Worker     /** Copy constructor. Disallowed.
294*0e209d39SAndroid Build Coastguard Worker      */
295*0e209d39SAndroid Build Coastguard Worker     UnicodeSetIterator(const UnicodeSetIterator&) = delete;
296*0e209d39SAndroid Build Coastguard Worker 
297*0e209d39SAndroid Build Coastguard Worker     /** Assignment operator. Disallowed.
298*0e209d39SAndroid Build Coastguard Worker      */
299*0e209d39SAndroid Build Coastguard Worker     UnicodeSetIterator& operator=(const UnicodeSetIterator&) = delete;
300*0e209d39SAndroid Build Coastguard Worker 
301*0e209d39SAndroid Build Coastguard Worker     /** Load range
302*0e209d39SAndroid Build Coastguard Worker      */
303*0e209d39SAndroid Build Coastguard Worker     void loadRange(int32_t range);
304*0e209d39SAndroid Build Coastguard Worker };
305*0e209d39SAndroid Build Coastguard Worker 
isString()306*0e209d39SAndroid Build Coastguard Worker inline UBool UnicodeSetIterator::isString() const {
307*0e209d39SAndroid Build Coastguard Worker     return codepoint < 0;
308*0e209d39SAndroid Build Coastguard Worker }
309*0e209d39SAndroid Build Coastguard Worker 
getCodepoint()310*0e209d39SAndroid Build Coastguard Worker inline UChar32 UnicodeSetIterator::getCodepoint() const {
311*0e209d39SAndroid Build Coastguard Worker     return codepoint;
312*0e209d39SAndroid Build Coastguard Worker }
313*0e209d39SAndroid Build Coastguard Worker 
getCodepointEnd()314*0e209d39SAndroid Build Coastguard Worker inline UChar32 UnicodeSetIterator::getCodepointEnd() const {
315*0e209d39SAndroid Build Coastguard Worker     return codepointEnd;
316*0e209d39SAndroid Build Coastguard Worker }
317*0e209d39SAndroid Build Coastguard Worker 
318*0e209d39SAndroid Build Coastguard Worker 
319*0e209d39SAndroid Build Coastguard Worker U_NAMESPACE_END
320*0e209d39SAndroid Build Coastguard Worker 
321*0e209d39SAndroid Build Coastguard Worker #endif /* U_SHOW_CPLUSPLUS_API */
322*0e209d39SAndroid Build Coastguard Worker 
323*0e209d39SAndroid Build Coastguard Worker #endif
324