12e5b6d6dSopenharmony_ci// © 2016 and later: Unicode, Inc. and others. 22e5b6d6dSopenharmony_ci// License & terms of use: http://www.unicode.org/copyright.html 32e5b6d6dSopenharmony_ci/* 42e5b6d6dSopenharmony_ci********************************************************************** 52e5b6d6dSopenharmony_ci* Copyright (C) 1998-2005, International Business Machines 62e5b6d6dSopenharmony_ci* Corporation and others. All Rights Reserved. 72e5b6d6dSopenharmony_ci********************************************************************** 82e5b6d6dSopenharmony_ci*/ 92e5b6d6dSopenharmony_ci 102e5b6d6dSopenharmony_ci#ifndef UCHRITER_H 112e5b6d6dSopenharmony_ci#define UCHRITER_H 122e5b6d6dSopenharmony_ci 132e5b6d6dSopenharmony_ci#include "unicode/utypes.h" 142e5b6d6dSopenharmony_ci 152e5b6d6dSopenharmony_ci#if U_SHOW_CPLUSPLUS_API 162e5b6d6dSopenharmony_ci 172e5b6d6dSopenharmony_ci#include "unicode/chariter.h" 182e5b6d6dSopenharmony_ci 192e5b6d6dSopenharmony_ci/** 202e5b6d6dSopenharmony_ci * \file 212e5b6d6dSopenharmony_ci * \brief C++ API: char16_t Character Iterator 222e5b6d6dSopenharmony_ci */ 232e5b6d6dSopenharmony_ci 242e5b6d6dSopenharmony_ciU_NAMESPACE_BEGIN 252e5b6d6dSopenharmony_ci 262e5b6d6dSopenharmony_ci/** 272e5b6d6dSopenharmony_ci * A concrete subclass of CharacterIterator that iterates over the 282e5b6d6dSopenharmony_ci * characters (code units or code points) in a char16_t array. 292e5b6d6dSopenharmony_ci * It's possible not only to create an 302e5b6d6dSopenharmony_ci * iterator that iterates over an entire char16_t array, but also to 312e5b6d6dSopenharmony_ci * create one that iterates over only a subrange of a char16_t array 322e5b6d6dSopenharmony_ci * (iterators over different subranges of the same char16_t array don't 332e5b6d6dSopenharmony_ci * compare equal). 342e5b6d6dSopenharmony_ci * @see CharacterIterator 352e5b6d6dSopenharmony_ci * @see ForwardCharacterIterator 362e5b6d6dSopenharmony_ci * @stable ICU 2.0 372e5b6d6dSopenharmony_ci */ 382e5b6d6dSopenharmony_ciclass U_COMMON_API UCharCharacterIterator : public CharacterIterator { 392e5b6d6dSopenharmony_cipublic: 402e5b6d6dSopenharmony_ci /** 412e5b6d6dSopenharmony_ci * Create an iterator over the char16_t array referred to by "textPtr". 422e5b6d6dSopenharmony_ci * The iteration range is 0 to <code>length-1</code>. 432e5b6d6dSopenharmony_ci * text is only aliased, not adopted (the 442e5b6d6dSopenharmony_ci * destructor will not delete it). 452e5b6d6dSopenharmony_ci * @param textPtr The char16_t array to be iterated over 462e5b6d6dSopenharmony_ci * @param length The length of the char16_t array 472e5b6d6dSopenharmony_ci * @stable ICU 2.0 482e5b6d6dSopenharmony_ci */ 492e5b6d6dSopenharmony_ci UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length); 502e5b6d6dSopenharmony_ci 512e5b6d6dSopenharmony_ci /** 522e5b6d6dSopenharmony_ci * Create an iterator over the char16_t array referred to by "textPtr". 532e5b6d6dSopenharmony_ci * The iteration range is 0 to <code>length-1</code>. 542e5b6d6dSopenharmony_ci * text is only aliased, not adopted (the 552e5b6d6dSopenharmony_ci * destructor will not delete it). 562e5b6d6dSopenharmony_ci * The starting 572e5b6d6dSopenharmony_ci * position is specified by "position". If "position" is outside the valid 582e5b6d6dSopenharmony_ci * iteration range, the behavior of this object is undefined. 592e5b6d6dSopenharmony_ci * @param textPtr The char16_t array to be iterated over 602e5b6d6dSopenharmony_ci * @param length The length of the char16_t array 612e5b6d6dSopenharmony_ci * @param position The starting position of the iteration 622e5b6d6dSopenharmony_ci * @stable ICU 2.0 632e5b6d6dSopenharmony_ci */ 642e5b6d6dSopenharmony_ci UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length, 652e5b6d6dSopenharmony_ci int32_t position); 662e5b6d6dSopenharmony_ci 672e5b6d6dSopenharmony_ci /** 682e5b6d6dSopenharmony_ci * Create an iterator over the char16_t array referred to by "textPtr". 692e5b6d6dSopenharmony_ci * The iteration range is 0 to <code>end-1</code>. 702e5b6d6dSopenharmony_ci * text is only aliased, not adopted (the 712e5b6d6dSopenharmony_ci * destructor will not delete it). 722e5b6d6dSopenharmony_ci * The starting 732e5b6d6dSopenharmony_ci * position is specified by "position". If begin and end do not 742e5b6d6dSopenharmony_ci * form a valid iteration range or "position" is outside the valid 752e5b6d6dSopenharmony_ci * iteration range, the behavior of this object is undefined. 762e5b6d6dSopenharmony_ci * @param textPtr The char16_t array to be iterated over 772e5b6d6dSopenharmony_ci * @param length The length of the char16_t array 782e5b6d6dSopenharmony_ci * @param textBegin The begin position of the iteration range 792e5b6d6dSopenharmony_ci * @param textEnd The end position of the iteration range 802e5b6d6dSopenharmony_ci * @param position The starting position of the iteration 812e5b6d6dSopenharmony_ci * @stable ICU 2.0 822e5b6d6dSopenharmony_ci */ 832e5b6d6dSopenharmony_ci UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length, 842e5b6d6dSopenharmony_ci int32_t textBegin, 852e5b6d6dSopenharmony_ci int32_t textEnd, 862e5b6d6dSopenharmony_ci int32_t position); 872e5b6d6dSopenharmony_ci 882e5b6d6dSopenharmony_ci /** 892e5b6d6dSopenharmony_ci * Copy constructor. The new iterator iterates over the same range 902e5b6d6dSopenharmony_ci * of the same string as "that", and its initial position is the 912e5b6d6dSopenharmony_ci * same as "that"'s current position. 922e5b6d6dSopenharmony_ci * @param that The UCharCharacterIterator to be copied 932e5b6d6dSopenharmony_ci * @stable ICU 2.0 942e5b6d6dSopenharmony_ci */ 952e5b6d6dSopenharmony_ci UCharCharacterIterator(const UCharCharacterIterator& that); 962e5b6d6dSopenharmony_ci 972e5b6d6dSopenharmony_ci /** 982e5b6d6dSopenharmony_ci * Destructor. 992e5b6d6dSopenharmony_ci * @stable ICU 2.0 1002e5b6d6dSopenharmony_ci */ 1012e5b6d6dSopenharmony_ci virtual ~UCharCharacterIterator(); 1022e5b6d6dSopenharmony_ci 1032e5b6d6dSopenharmony_ci /** 1042e5b6d6dSopenharmony_ci * Assignment operator. *this is altered to iterate over the sane 1052e5b6d6dSopenharmony_ci * range of the same string as "that", and refers to the same 1062e5b6d6dSopenharmony_ci * character within that string as "that" does. 1072e5b6d6dSopenharmony_ci * @param that The object to be copied 1082e5b6d6dSopenharmony_ci * @return the newly created object 1092e5b6d6dSopenharmony_ci * @stable ICU 2.0 1102e5b6d6dSopenharmony_ci */ 1112e5b6d6dSopenharmony_ci UCharCharacterIterator& 1122e5b6d6dSopenharmony_ci operator=(const UCharCharacterIterator& that); 1132e5b6d6dSopenharmony_ci 1142e5b6d6dSopenharmony_ci /** 1152e5b6d6dSopenharmony_ci * Returns true if the iterators iterate over the same range of the 1162e5b6d6dSopenharmony_ci * same string and are pointing at the same character. 1172e5b6d6dSopenharmony_ci * @param that The ForwardCharacterIterator used to be compared for equality 1182e5b6d6dSopenharmony_ci * @return true if the iterators iterate over the same range of the 1192e5b6d6dSopenharmony_ci * same string and are pointing at the same character. 1202e5b6d6dSopenharmony_ci * @stable ICU 2.0 1212e5b6d6dSopenharmony_ci */ 1222e5b6d6dSopenharmony_ci virtual bool operator==(const ForwardCharacterIterator& that) const override; 1232e5b6d6dSopenharmony_ci 1242e5b6d6dSopenharmony_ci /** 1252e5b6d6dSopenharmony_ci * Generates a hash code for this iterator. 1262e5b6d6dSopenharmony_ci * @return the hash code. 1272e5b6d6dSopenharmony_ci * @stable ICU 2.0 1282e5b6d6dSopenharmony_ci */ 1292e5b6d6dSopenharmony_ci virtual int32_t hashCode(void) const override; 1302e5b6d6dSopenharmony_ci 1312e5b6d6dSopenharmony_ci /** 1322e5b6d6dSopenharmony_ci * Returns a new UCharCharacterIterator referring to the same 1332e5b6d6dSopenharmony_ci * character in the same range of the same string as this one. The 1342e5b6d6dSopenharmony_ci * caller must delete the new iterator. 1352e5b6d6dSopenharmony_ci * @return the CharacterIterator newly created 1362e5b6d6dSopenharmony_ci * @stable ICU 2.0 1372e5b6d6dSopenharmony_ci */ 1382e5b6d6dSopenharmony_ci virtual UCharCharacterIterator* clone() const override; 1392e5b6d6dSopenharmony_ci 1402e5b6d6dSopenharmony_ci /** 1412e5b6d6dSopenharmony_ci * Sets the iterator to refer to the first code unit in its 1422e5b6d6dSopenharmony_ci * iteration range, and returns that code unit. 1432e5b6d6dSopenharmony_ci * This can be used to begin an iteration with next(). 1442e5b6d6dSopenharmony_ci * @return the first code unit in its iteration range. 1452e5b6d6dSopenharmony_ci * @stable ICU 2.0 1462e5b6d6dSopenharmony_ci */ 1472e5b6d6dSopenharmony_ci virtual char16_t first(void) override; 1482e5b6d6dSopenharmony_ci 1492e5b6d6dSopenharmony_ci /** 1502e5b6d6dSopenharmony_ci * Sets the iterator to refer to the first code unit in its 1512e5b6d6dSopenharmony_ci * iteration range, returns that code unit, and moves the position 1522e5b6d6dSopenharmony_ci * to the second code unit. This is an alternative to setToStart() 1532e5b6d6dSopenharmony_ci * for forward iteration with nextPostInc(). 1542e5b6d6dSopenharmony_ci * @return the first code unit in its iteration range 1552e5b6d6dSopenharmony_ci * @stable ICU 2.0 1562e5b6d6dSopenharmony_ci */ 1572e5b6d6dSopenharmony_ci virtual char16_t firstPostInc(void) override; 1582e5b6d6dSopenharmony_ci 1592e5b6d6dSopenharmony_ci /** 1602e5b6d6dSopenharmony_ci * Sets the iterator to refer to the first code point in its 1612e5b6d6dSopenharmony_ci * iteration range, and returns that code unit, 1622e5b6d6dSopenharmony_ci * This can be used to begin an iteration with next32(). 1632e5b6d6dSopenharmony_ci * Note that an iteration with next32PostInc(), beginning with, 1642e5b6d6dSopenharmony_ci * e.g., setToStart() or firstPostInc(), is more efficient. 1652e5b6d6dSopenharmony_ci * @return the first code point in its iteration range 1662e5b6d6dSopenharmony_ci * @stable ICU 2.0 1672e5b6d6dSopenharmony_ci */ 1682e5b6d6dSopenharmony_ci virtual UChar32 first32(void) override; 1692e5b6d6dSopenharmony_ci 1702e5b6d6dSopenharmony_ci /** 1712e5b6d6dSopenharmony_ci * Sets the iterator to refer to the first code point in its 1722e5b6d6dSopenharmony_ci * iteration range, returns that code point, and moves the position 1732e5b6d6dSopenharmony_ci * to the second code point. This is an alternative to setToStart() 1742e5b6d6dSopenharmony_ci * for forward iteration with next32PostInc(). 1752e5b6d6dSopenharmony_ci * @return the first code point in its iteration range. 1762e5b6d6dSopenharmony_ci * @stable ICU 2.0 1772e5b6d6dSopenharmony_ci */ 1782e5b6d6dSopenharmony_ci virtual UChar32 first32PostInc(void) override; 1792e5b6d6dSopenharmony_ci 1802e5b6d6dSopenharmony_ci /** 1812e5b6d6dSopenharmony_ci * Sets the iterator to refer to the last code unit in its 1822e5b6d6dSopenharmony_ci * iteration range, and returns that code unit. 1832e5b6d6dSopenharmony_ci * This can be used to begin an iteration with previous(). 1842e5b6d6dSopenharmony_ci * @return the last code unit in its iteration range. 1852e5b6d6dSopenharmony_ci * @stable ICU 2.0 1862e5b6d6dSopenharmony_ci */ 1872e5b6d6dSopenharmony_ci virtual char16_t last(void) override; 1882e5b6d6dSopenharmony_ci 1892e5b6d6dSopenharmony_ci /** 1902e5b6d6dSopenharmony_ci * Sets the iterator to refer to the last code point in its 1912e5b6d6dSopenharmony_ci * iteration range, and returns that code unit. 1922e5b6d6dSopenharmony_ci * This can be used to begin an iteration with previous32(). 1932e5b6d6dSopenharmony_ci * @return the last code point in its iteration range. 1942e5b6d6dSopenharmony_ci * @stable ICU 2.0 1952e5b6d6dSopenharmony_ci */ 1962e5b6d6dSopenharmony_ci virtual UChar32 last32(void) override; 1972e5b6d6dSopenharmony_ci 1982e5b6d6dSopenharmony_ci /** 1992e5b6d6dSopenharmony_ci * Sets the iterator to refer to the "position"-th code unit 2002e5b6d6dSopenharmony_ci * in the text-storage object the iterator refers to, and 2012e5b6d6dSopenharmony_ci * returns that code unit. 2022e5b6d6dSopenharmony_ci * @param position the position within the text-storage object 2032e5b6d6dSopenharmony_ci * @return the code unit 2042e5b6d6dSopenharmony_ci * @stable ICU 2.0 2052e5b6d6dSopenharmony_ci */ 2062e5b6d6dSopenharmony_ci virtual char16_t setIndex(int32_t position) override; 2072e5b6d6dSopenharmony_ci 2082e5b6d6dSopenharmony_ci /** 2092e5b6d6dSopenharmony_ci * Sets the iterator to refer to the beginning of the code point 2102e5b6d6dSopenharmony_ci * that contains the "position"-th code unit 2112e5b6d6dSopenharmony_ci * in the text-storage object the iterator refers to, and 2122e5b6d6dSopenharmony_ci * returns that code point. 2132e5b6d6dSopenharmony_ci * The current position is adjusted to the beginning of the code point 2142e5b6d6dSopenharmony_ci * (its first code unit). 2152e5b6d6dSopenharmony_ci * @param position the position within the text-storage object 2162e5b6d6dSopenharmony_ci * @return the code unit 2172e5b6d6dSopenharmony_ci * @stable ICU 2.0 2182e5b6d6dSopenharmony_ci */ 2192e5b6d6dSopenharmony_ci virtual UChar32 setIndex32(int32_t position) override; 2202e5b6d6dSopenharmony_ci 2212e5b6d6dSopenharmony_ci /** 2222e5b6d6dSopenharmony_ci * Returns the code unit the iterator currently refers to. 2232e5b6d6dSopenharmony_ci * @return the code unit the iterator currently refers to. 2242e5b6d6dSopenharmony_ci * @stable ICU 2.0 2252e5b6d6dSopenharmony_ci */ 2262e5b6d6dSopenharmony_ci virtual char16_t current(void) const override; 2272e5b6d6dSopenharmony_ci 2282e5b6d6dSopenharmony_ci /** 2292e5b6d6dSopenharmony_ci * Returns the code point the iterator currently refers to. 2302e5b6d6dSopenharmony_ci * @return the code point the iterator currently refers to. 2312e5b6d6dSopenharmony_ci * @stable ICU 2.0 2322e5b6d6dSopenharmony_ci */ 2332e5b6d6dSopenharmony_ci virtual UChar32 current32(void) const override; 2342e5b6d6dSopenharmony_ci 2352e5b6d6dSopenharmony_ci /** 2362e5b6d6dSopenharmony_ci * Advances to the next code unit in the iteration range (toward 2372e5b6d6dSopenharmony_ci * endIndex()), and returns that code unit. If there are no more 2382e5b6d6dSopenharmony_ci * code units to return, returns DONE. 2392e5b6d6dSopenharmony_ci * @return the next code unit in the iteration range. 2402e5b6d6dSopenharmony_ci * @stable ICU 2.0 2412e5b6d6dSopenharmony_ci */ 2422e5b6d6dSopenharmony_ci virtual char16_t next(void) override; 2432e5b6d6dSopenharmony_ci 2442e5b6d6dSopenharmony_ci /** 2452e5b6d6dSopenharmony_ci * Gets the current code unit for returning and advances to the next code unit 2462e5b6d6dSopenharmony_ci * in the iteration range 2472e5b6d6dSopenharmony_ci * (toward endIndex()). If there are 2482e5b6d6dSopenharmony_ci * no more code units to return, returns DONE. 2492e5b6d6dSopenharmony_ci * @return the current code unit. 2502e5b6d6dSopenharmony_ci * @stable ICU 2.0 2512e5b6d6dSopenharmony_ci */ 2522e5b6d6dSopenharmony_ci virtual char16_t nextPostInc(void) override; 2532e5b6d6dSopenharmony_ci 2542e5b6d6dSopenharmony_ci /** 2552e5b6d6dSopenharmony_ci * Advances to the next code point in the iteration range (toward 2562e5b6d6dSopenharmony_ci * endIndex()), and returns that code point. If there are no more 2572e5b6d6dSopenharmony_ci * code points to return, returns DONE. 2582e5b6d6dSopenharmony_ci * Note that iteration with "pre-increment" semantics is less 2592e5b6d6dSopenharmony_ci * efficient than iteration with "post-increment" semantics 2602e5b6d6dSopenharmony_ci * that is provided by next32PostInc(). 2612e5b6d6dSopenharmony_ci * @return the next code point in the iteration range. 2622e5b6d6dSopenharmony_ci * @stable ICU 2.0 2632e5b6d6dSopenharmony_ci */ 2642e5b6d6dSopenharmony_ci virtual UChar32 next32(void) override; 2652e5b6d6dSopenharmony_ci 2662e5b6d6dSopenharmony_ci /** 2672e5b6d6dSopenharmony_ci * Gets the current code point for returning and advances to the next code point 2682e5b6d6dSopenharmony_ci * in the iteration range 2692e5b6d6dSopenharmony_ci * (toward endIndex()). If there are 2702e5b6d6dSopenharmony_ci * no more code points to return, returns DONE. 2712e5b6d6dSopenharmony_ci * @return the current point. 2722e5b6d6dSopenharmony_ci * @stable ICU 2.0 2732e5b6d6dSopenharmony_ci */ 2742e5b6d6dSopenharmony_ci virtual UChar32 next32PostInc(void) override; 2752e5b6d6dSopenharmony_ci 2762e5b6d6dSopenharmony_ci /** 2772e5b6d6dSopenharmony_ci * Returns false if there are no more code units or code points 2782e5b6d6dSopenharmony_ci * at or after the current position in the iteration range. 2792e5b6d6dSopenharmony_ci * This is used with nextPostInc() or next32PostInc() in forward 2802e5b6d6dSopenharmony_ci * iteration. 2812e5b6d6dSopenharmony_ci * @return false if there are no more code units or code points 2822e5b6d6dSopenharmony_ci * at or after the current position in the iteration range. 2832e5b6d6dSopenharmony_ci * @stable ICU 2.0 2842e5b6d6dSopenharmony_ci */ 2852e5b6d6dSopenharmony_ci virtual UBool hasNext() override; 2862e5b6d6dSopenharmony_ci 2872e5b6d6dSopenharmony_ci /** 2882e5b6d6dSopenharmony_ci * Advances to the previous code unit in the iteration range (toward 2892e5b6d6dSopenharmony_ci * startIndex()), and returns that code unit. If there are no more 2902e5b6d6dSopenharmony_ci * code units to return, returns DONE. 2912e5b6d6dSopenharmony_ci * @return the previous code unit in the iteration range. 2922e5b6d6dSopenharmony_ci * @stable ICU 2.0 2932e5b6d6dSopenharmony_ci */ 2942e5b6d6dSopenharmony_ci virtual char16_t previous(void) override; 2952e5b6d6dSopenharmony_ci 2962e5b6d6dSopenharmony_ci /** 2972e5b6d6dSopenharmony_ci * Advances to the previous code point in the iteration range (toward 2982e5b6d6dSopenharmony_ci * startIndex()), and returns that code point. If there are no more 2992e5b6d6dSopenharmony_ci * code points to return, returns DONE. 3002e5b6d6dSopenharmony_ci * @return the previous code point in the iteration range. 3012e5b6d6dSopenharmony_ci * @stable ICU 2.0 3022e5b6d6dSopenharmony_ci */ 3032e5b6d6dSopenharmony_ci virtual UChar32 previous32(void) override; 3042e5b6d6dSopenharmony_ci 3052e5b6d6dSopenharmony_ci /** 3062e5b6d6dSopenharmony_ci * Returns false if there are no more code units or code points 3072e5b6d6dSopenharmony_ci * before the current position in the iteration range. 3082e5b6d6dSopenharmony_ci * This is used with previous() or previous32() in backward 3092e5b6d6dSopenharmony_ci * iteration. 3102e5b6d6dSopenharmony_ci * @return false if there are no more code units or code points 3112e5b6d6dSopenharmony_ci * before the current position in the iteration range. 3122e5b6d6dSopenharmony_ci * @stable ICU 2.0 3132e5b6d6dSopenharmony_ci */ 3142e5b6d6dSopenharmony_ci virtual UBool hasPrevious() override; 3152e5b6d6dSopenharmony_ci 3162e5b6d6dSopenharmony_ci /** 3172e5b6d6dSopenharmony_ci * Moves the current position relative to the start or end of the 3182e5b6d6dSopenharmony_ci * iteration range, or relative to the current position itself. 3192e5b6d6dSopenharmony_ci * The movement is expressed in numbers of code units forward 3202e5b6d6dSopenharmony_ci * or backward by specifying a positive or negative delta. 3212e5b6d6dSopenharmony_ci * @param delta the position relative to origin. A positive delta means forward; 3222e5b6d6dSopenharmony_ci * a negative delta means backward. 3232e5b6d6dSopenharmony_ci * @param origin Origin enumeration {kStart, kCurrent, kEnd} 3242e5b6d6dSopenharmony_ci * @return the new position 3252e5b6d6dSopenharmony_ci * @stable ICU 2.0 3262e5b6d6dSopenharmony_ci */ 3272e5b6d6dSopenharmony_ci virtual int32_t move(int32_t delta, EOrigin origin) override; 3282e5b6d6dSopenharmony_ci 3292e5b6d6dSopenharmony_ci /** 3302e5b6d6dSopenharmony_ci * Moves the current position relative to the start or end of the 3312e5b6d6dSopenharmony_ci * iteration range, or relative to the current position itself. 3322e5b6d6dSopenharmony_ci * The movement is expressed in numbers of code points forward 3332e5b6d6dSopenharmony_ci * or backward by specifying a positive or negative delta. 3342e5b6d6dSopenharmony_ci * @param delta the position relative to origin. A positive delta means forward; 3352e5b6d6dSopenharmony_ci * a negative delta means backward. 3362e5b6d6dSopenharmony_ci * @param origin Origin enumeration {kStart, kCurrent, kEnd} 3372e5b6d6dSopenharmony_ci * @return the new position 3382e5b6d6dSopenharmony_ci * @stable ICU 2.0 3392e5b6d6dSopenharmony_ci */ 3402e5b6d6dSopenharmony_ci#ifdef move32 3412e5b6d6dSopenharmony_ci // One of the system headers right now is sometimes defining a conflicting macro we don't use 3422e5b6d6dSopenharmony_ci#undef move32 3432e5b6d6dSopenharmony_ci#endif 3442e5b6d6dSopenharmony_ci virtual int32_t move32(int32_t delta, EOrigin origin) override; 3452e5b6d6dSopenharmony_ci 3462e5b6d6dSopenharmony_ci /** 3472e5b6d6dSopenharmony_ci * Sets the iterator to iterate over a new range of text 3482e5b6d6dSopenharmony_ci * @stable ICU 2.0 3492e5b6d6dSopenharmony_ci */ 3502e5b6d6dSopenharmony_ci void setText(ConstChar16Ptr newText, int32_t newTextLength); 3512e5b6d6dSopenharmony_ci 3522e5b6d6dSopenharmony_ci /** 3532e5b6d6dSopenharmony_ci * Copies the char16_t array under iteration into the UnicodeString 3542e5b6d6dSopenharmony_ci * referred to by "result". Even if this iterator iterates across 3552e5b6d6dSopenharmony_ci * only a part of this string, the whole string is copied. 3562e5b6d6dSopenharmony_ci * @param result Receives a copy of the text under iteration. 3572e5b6d6dSopenharmony_ci * @stable ICU 2.0 3582e5b6d6dSopenharmony_ci */ 3592e5b6d6dSopenharmony_ci virtual void getText(UnicodeString& result) override; 3602e5b6d6dSopenharmony_ci 3612e5b6d6dSopenharmony_ci /** 3622e5b6d6dSopenharmony_ci * Return a class ID for this class (not really public) 3632e5b6d6dSopenharmony_ci * @return a class ID for this class 3642e5b6d6dSopenharmony_ci * @stable ICU 2.0 3652e5b6d6dSopenharmony_ci */ 3662e5b6d6dSopenharmony_ci static UClassID U_EXPORT2 getStaticClassID(void); 3672e5b6d6dSopenharmony_ci 3682e5b6d6dSopenharmony_ci /** 3692e5b6d6dSopenharmony_ci * Return a class ID for this object (not really public) 3702e5b6d6dSopenharmony_ci * @return a class ID for this object. 3712e5b6d6dSopenharmony_ci * @stable ICU 2.0 3722e5b6d6dSopenharmony_ci */ 3732e5b6d6dSopenharmony_ci virtual UClassID getDynamicClassID(void) const override; 3742e5b6d6dSopenharmony_ci 3752e5b6d6dSopenharmony_ciprotected: 3762e5b6d6dSopenharmony_ci /** 3772e5b6d6dSopenharmony_ci * Protected constructor 3782e5b6d6dSopenharmony_ci * @stable ICU 2.0 3792e5b6d6dSopenharmony_ci */ 3802e5b6d6dSopenharmony_ci UCharCharacterIterator(); 3812e5b6d6dSopenharmony_ci /** 3822e5b6d6dSopenharmony_ci * Protected member text 3832e5b6d6dSopenharmony_ci * @stable ICU 2.0 3842e5b6d6dSopenharmony_ci */ 3852e5b6d6dSopenharmony_ci const char16_t* text; 3862e5b6d6dSopenharmony_ci 3872e5b6d6dSopenharmony_ci}; 3882e5b6d6dSopenharmony_ci 3892e5b6d6dSopenharmony_ciU_NAMESPACE_END 3902e5b6d6dSopenharmony_ci 3912e5b6d6dSopenharmony_ci#endif /* U_SHOW_CPLUSPLUS_API */ 3922e5b6d6dSopenharmony_ci 3932e5b6d6dSopenharmony_ci#endif 394