2016-06-15 18:58:17 +00:00
|
|
|
// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
|
|
|
// License & terms of use: http://www.unicode.org/copyright.html
|
1999-12-28 23:39:02 +00:00
|
|
|
/*
|
|
|
|
**********************************************************************
|
2016-05-31 21:45:07 +00:00
|
|
|
* Copyright (C) 1998-2005, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
1999-12-28 23:39:02 +00:00
|
|
|
**********************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef UCHRITER_H
|
|
|
|
#define UCHRITER_H
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
|
|
|
#include "unicode/chariter.h"
|
|
|
|
|
2005-06-22 22:39:36 +00:00
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* \brief C++ API: UChar Character Iterator
|
|
|
|
*/
|
|
|
|
|
2001-10-08 23:26:58 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
1999-12-28 23:39:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A concrete subclass of CharacterIterator that iterates over the
|
2000-04-12 19:36:30 +00:00
|
|
|
* characters (code units or code points) in a UChar array.
|
|
|
|
* It's possible not only to create an
|
|
|
|
* iterator that iterates over an entire UChar array, but also to
|
|
|
|
* create one that iterates over only a subrange of a UChar array
|
|
|
|
* (iterators over different subranges of the same UChar array don't
|
|
|
|
* compare equal).
|
2000-04-20 23:02:20 +00:00
|
|
|
* @see CharacterIterator
|
|
|
|
* @see ForwardCharacterIterator
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-12 19:36:30 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
class U_COMMON_API UCharCharacterIterator : public CharacterIterator {
|
|
|
|
public:
|
|
|
|
/**
|
2000-09-27 23:39:36 +00:00
|
|
|
* Create an iterator over the UChar array referred to by "textPtr".
|
|
|
|
* The iteration range is 0 to <code>length-1</code>.
|
2000-04-12 19:36:30 +00:00
|
|
|
* text is only aliased, not adopted (the
|
|
|
|
* destructor will not delete it).
|
2002-07-03 12:05:56 +00:00
|
|
|
* @param textPtr The UChar array to be iterated over
|
|
|
|
* @param length The length of the UChar array
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2000-09-27 23:39:36 +00:00
|
|
|
UCharCharacterIterator(const UChar* textPtr, int32_t length);
|
1999-12-28 23:39:02 +00:00
|
|
|
|
2000-04-12 19:36:30 +00:00
|
|
|
/**
|
2000-09-27 23:39:36 +00:00
|
|
|
* Create an iterator over the UChar array referred to by "textPtr".
|
|
|
|
* The iteration range is 0 to <code>length-1</code>.
|
2000-04-12 19:36:30 +00:00
|
|
|
* text is only aliased, not adopted (the
|
|
|
|
* destructor will not delete it).
|
|
|
|
* The starting
|
2000-09-27 23:39:36 +00:00
|
|
|
* position is specified by "position". If "position" is outside the valid
|
2000-04-12 19:36:30 +00:00
|
|
|
* iteration range, the behavior of this object is undefined.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @param textPtr The UChar array to be iteratd over
|
|
|
|
* @param length The length of the UChar array
|
|
|
|
* @param position The starting position of the iteration
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-12 19:36:30 +00:00
|
|
|
*/
|
2000-09-27 23:39:36 +00:00
|
|
|
UCharCharacterIterator(const UChar* textPtr, int32_t length,
|
2002-03-12 01:32:42 +00:00
|
|
|
int32_t position);
|
2000-04-12 19:36:30 +00:00
|
|
|
|
|
|
|
/**
|
2000-09-27 23:39:36 +00:00
|
|
|
* Create an iterator over the UChar array referred to by "textPtr".
|
2000-04-12 19:36:30 +00:00
|
|
|
* The iteration range is 0 to <code>end-1</code>.
|
|
|
|
* text is only aliased, not adopted (the
|
|
|
|
* destructor will not delete it).
|
|
|
|
* The starting
|
2000-09-27 23:39:36 +00:00
|
|
|
* position is specified by "position". If begin and end do not
|
|
|
|
* form a valid iteration range or "position" is outside the valid
|
2000-04-12 19:36:30 +00:00
|
|
|
* iteration range, the behavior of this object is undefined.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @param textPtr The UChar array to be iterated over
|
|
|
|
* @param length The length of the UChar array
|
|
|
|
* @param textBegin The begin position of the iteration range
|
|
|
|
* @param textEnd The end position of the iteration range
|
|
|
|
* @param position The starting position of the iteration
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-12 19:36:30 +00:00
|
|
|
*/
|
2000-09-27 23:39:36 +00:00
|
|
|
UCharCharacterIterator(const UChar* textPtr, int32_t length,
|
2002-03-12 01:32:42 +00:00
|
|
|
int32_t textBegin,
|
|
|
|
int32_t textEnd,
|
|
|
|
int32_t position);
|
2000-04-12 19:36:30 +00:00
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
/**
|
|
|
|
* Copy constructor. The new iterator iterates over the same range
|
|
|
|
* of the same string as "that", and its initial position is the
|
2004-08-24 17:21:14 +00:00
|
|
|
* same as "that"'s current position.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @param that The UCharCharacterIterator to be copied
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
UCharCharacterIterator(const UCharCharacterIterator& that);
|
|
|
|
|
|
|
|
/**
|
2004-08-24 17:21:14 +00:00
|
|
|
* Destructor.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2004-08-26 20:39:32 +00:00
|
|
|
virtual ~UCharCharacterIterator();
|
1999-12-28 23:39:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Assignment operator. *this is altered to iterate over the sane
|
|
|
|
* range of the same string as "that", and refers to the same
|
2004-08-24 17:21:14 +00:00
|
|
|
* character within that string as "that" does.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @param that The object to be copied
|
2004-08-24 17:21:14 +00:00
|
|
|
* @return the newly created object
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
UCharCharacterIterator&
|
|
|
|
operator=(const UCharCharacterIterator& that);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the iterators iterate over the same range of the
|
2004-08-24 17:21:14 +00:00
|
|
|
* same string and are pointing at the same character.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @param that The ForwardCharacterIterator used to be compared for equality
|
|
|
|
* @return true if the iterators iterate over the same range of the
|
|
|
|
* same string and are pointing at the same character.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2000-05-18 22:08:39 +00:00
|
|
|
virtual UBool operator==(const ForwardCharacterIterator& that) const;
|
1999-12-28 23:39:02 +00:00
|
|
|
|
|
|
|
/**
|
2004-08-24 17:21:14 +00:00
|
|
|
* Generates a hash code for this iterator.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the hash code.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
virtual int32_t hashCode(void) const;
|
|
|
|
|
|
|
|
/**
|
2000-04-12 19:36:30 +00:00
|
|
|
* Returns a new UCharCharacterIterator referring to the same
|
1999-12-28 23:39:02 +00:00
|
|
|
* character in the same range of the same string as this one. The
|
2004-08-24 17:21:14 +00:00
|
|
|
* caller must delete the new iterator.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the CharacterIterator newly created
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
virtual CharacterIterator* clone(void) const;
|
2004-08-24 17:21:14 +00:00
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
/**
|
2000-04-12 19:36:30 +00:00
|
|
|
* Sets the iterator to refer to the first code unit in its
|
2000-04-20 23:02:20 +00:00
|
|
|
* iteration range, and returns that code unit.
|
|
|
|
* This can be used to begin an iteration with next().
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the first code unit in its iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
virtual UChar first(void);
|
|
|
|
|
2000-04-20 23:02:20 +00:00
|
|
|
/**
|
|
|
|
* Sets the iterator to refer to the first code unit in its
|
|
|
|
* iteration range, returns that code unit, and moves the position
|
|
|
|
* to the second code unit. This is an alternative to setToStart()
|
|
|
|
* for forward iteration with nextPostInc().
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the first code unit in its iteration range
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-20 23:02:20 +00:00
|
|
|
*/
|
|
|
|
virtual UChar firstPostInc(void);
|
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
/**
|
2000-04-12 19:36:30 +00:00
|
|
|
* Sets the iterator to refer to the first code point in its
|
2000-04-20 23:02:20 +00:00
|
|
|
* iteration range, and returns that code unit,
|
|
|
|
* This can be used to begin an iteration with next32().
|
|
|
|
* Note that an iteration with next32PostInc(), beginning with,
|
|
|
|
* e.g., setToStart() or firstPostInc(), is more efficient.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the first code point in its iteration range
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-12 19:36:30 +00:00
|
|
|
*/
|
|
|
|
virtual UChar32 first32(void);
|
|
|
|
|
2000-04-20 23:02:20 +00:00
|
|
|
/**
|
|
|
|
* Sets the iterator to refer to the first code point in its
|
|
|
|
* iteration range, returns that code point, and moves the position
|
|
|
|
* to the second code point. This is an alternative to setToStart()
|
|
|
|
* for forward iteration with next32PostInc().
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the first code point in its iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-20 23:02:20 +00:00
|
|
|
*/
|
|
|
|
virtual UChar32 first32PostInc(void);
|
2000-04-12 19:36:30 +00:00
|
|
|
|
|
|
|
/**
|
2000-04-20 23:02:20 +00:00
|
|
|
* Sets the iterator to refer to the last code unit in its
|
|
|
|
* iteration range, and returns that code unit.
|
|
|
|
* This can be used to begin an iteration with previous().
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the last code unit in its iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
virtual UChar last(void);
|
|
|
|
|
|
|
|
/**
|
2000-04-20 23:02:20 +00:00
|
|
|
* Sets the iterator to refer to the last code point in its
|
|
|
|
* iteration range, and returns that code unit.
|
|
|
|
* This can be used to begin an iteration with previous32().
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the last code point in its iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-12 19:36:30 +00:00
|
|
|
*/
|
|
|
|
virtual UChar32 last32(void);
|
|
|
|
|
|
|
|
/**
|
2000-04-20 23:02:20 +00:00
|
|
|
* Sets the iterator to refer to the "position"-th code unit
|
|
|
|
* in the text-storage object the iterator refers to, and
|
2004-08-24 17:21:14 +00:00
|
|
|
* returns that code unit.
|
2004-06-08 22:39:23 +00:00
|
|
|
* @param position the position within the text-storage object
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the code unit
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2002-03-12 01:32:42 +00:00
|
|
|
virtual UChar setIndex(int32_t position);
|
1999-12-28 23:39:02 +00:00
|
|
|
|
|
|
|
/**
|
2000-04-20 23:02:20 +00:00
|
|
|
* Sets the iterator to refer to the beginning of the code point
|
|
|
|
* that contains the "position"-th code unit
|
|
|
|
* in the text-storage object the iterator refers to, and
|
|
|
|
* returns that code point.
|
|
|
|
* The current position is adjusted to the beginning of the code point
|
|
|
|
* (its first code unit).
|
2004-06-08 22:39:23 +00:00
|
|
|
* @param position the position within the text-storage object
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the code unit
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-12 19:36:30 +00:00
|
|
|
*/
|
2002-03-12 01:32:42 +00:00
|
|
|
virtual UChar32 setIndex32(int32_t position);
|
2000-04-12 19:36:30 +00:00
|
|
|
|
|
|
|
/**
|
2004-08-24 17:21:14 +00:00
|
|
|
* Returns the code unit the iterator currently refers to.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the code unit the iterator currently refers to.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
virtual UChar current(void) const;
|
|
|
|
|
|
|
|
/**
|
2004-08-24 17:21:14 +00:00
|
|
|
* Returns the code point the iterator currently refers to.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the code point the iterator currently refers to.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-12 19:36:30 +00:00
|
|
|
*/
|
|
|
|
virtual UChar32 current32(void) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Advances to the next code unit in the iteration range (toward
|
2000-04-20 23:02:20 +00:00
|
|
|
* endIndex()), and returns that code unit. If there are no more
|
2004-08-24 17:21:14 +00:00
|
|
|
* code units to return, returns DONE.
|
|
|
|
* @return the next code unit in the iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
virtual UChar next(void);
|
|
|
|
|
2000-04-20 23:02:20 +00:00
|
|
|
/**
|
|
|
|
* Gets the current code unit for returning and advances to the next code unit
|
|
|
|
* in the iteration range
|
|
|
|
* (toward endIndex()). If there are
|
|
|
|
* no more code units to return, returns DONE.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the current code unit.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-20 23:02:20 +00:00
|
|
|
*/
|
2000-04-12 19:36:30 +00:00
|
|
|
virtual UChar nextPostInc(void);
|
2004-08-24 17:21:14 +00:00
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
/**
|
2000-04-12 19:36:30 +00:00
|
|
|
* Advances to the next code point in the iteration range (toward
|
2000-04-20 23:02:20 +00:00
|
|
|
* endIndex()), and returns that code point. If there are no more
|
2004-08-24 17:21:14 +00:00
|
|
|
* code points to return, returns DONE.
|
2000-04-20 23:02:20 +00:00
|
|
|
* Note that iteration with "pre-increment" semantics is less
|
|
|
|
* efficient than iteration with "post-increment" semantics
|
|
|
|
* that is provided by next32PostInc().
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the next code point in the iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-12 19:36:30 +00:00
|
|
|
*/
|
|
|
|
virtual UChar32 next32(void);
|
|
|
|
|
2000-04-20 23:02:20 +00:00
|
|
|
/**
|
|
|
|
* Gets the current code point for returning and advances to the next code point
|
|
|
|
* in the iteration range
|
|
|
|
* (toward endIndex()). If there are
|
|
|
|
* no more code points to return, returns DONE.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the current point.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-20 23:02:20 +00:00
|
|
|
*/
|
2000-04-12 19:36:30 +00:00
|
|
|
virtual UChar32 next32PostInc(void);
|
2004-08-24 17:21:14 +00:00
|
|
|
|
2000-04-20 23:02:20 +00:00
|
|
|
/**
|
|
|
|
* Returns FALSE if there are no more code units or code points
|
|
|
|
* at or after the current position in the iteration range.
|
|
|
|
* This is used with nextPostInc() or next32PostInc() in forward
|
|
|
|
* iteration.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return FALSE if there are no more code units or code points
|
|
|
|
* at or after the current position in the iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-20 23:02:20 +00:00
|
|
|
*/
|
2004-03-30 22:39:45 +00:00
|
|
|
virtual UBool hasNext();
|
2000-04-12 19:36:30 +00:00
|
|
|
|
|
|
|
/**
|
2002-07-03 12:05:56 +00:00
|
|
|
* Advances to the previous code unit in the iteration range (toward
|
2000-04-20 23:02:20 +00:00
|
|
|
* startIndex()), and returns that code unit. If there are no more
|
2004-08-24 17:21:14 +00:00
|
|
|
* code units to return, returns DONE.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the previous code unit in the iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
virtual UChar previous(void);
|
|
|
|
|
|
|
|
/**
|
2002-07-03 12:05:56 +00:00
|
|
|
* Advances to the previous code point in the iteration range (toward
|
2000-04-20 23:02:20 +00:00
|
|
|
* startIndex()), and returns that code point. If there are no more
|
2002-07-03 12:05:56 +00:00
|
|
|
* code points to return, returns DONE.
|
2004-08-24 17:21:14 +00:00
|
|
|
* @return the previous code point in the iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-04-12 19:36:30 +00:00
|
|
|
*/
|
|
|
|
virtual UChar32 previous32(void);
|
|
|
|
|
|
|
|
/**
|
2000-04-20 23:02:20 +00:00
|
|
|
* Returns FALSE if there are no more code units or code points
|
|
|
|
* before the current position in the iteration range.
|
|
|
|
* This is used with previous() or previous32() in backward
|
|
|
|
* iteration.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return FALSE if there are no more code units or code points
|
|
|
|
* before the current position in the iteration range.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2004-03-30 22:39:45 +00:00
|
|
|
virtual UBool hasPrevious();
|
1999-12-28 23:39:02 +00:00
|
|
|
|
|
|
|
/**
|
2000-04-20 23:02:20 +00:00
|
|
|
* Moves the current position relative to the start or end of the
|
|
|
|
* iteration range, or relative to the current position itself.
|
|
|
|
* The movement is expressed in numbers of code units forward
|
|
|
|
* or backward by specifying a positive or negative delta.
|
2004-06-08 22:39:23 +00:00
|
|
|
* @param delta the position relative to origin. A positive delta means forward;
|
2002-07-03 12:05:56 +00:00
|
|
|
* a negative delta means backward.
|
2004-06-08 22:39:23 +00:00
|
|
|
* @param origin Origin enumeration {kStart, kCurrent, kEnd}
|
2000-04-20 23:02:20 +00:00
|
|
|
* @return the new position
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2002-03-12 01:32:42 +00:00
|
|
|
virtual int32_t move(int32_t delta, EOrigin origin);
|
1999-12-28 23:39:02 +00:00
|
|
|
|
|
|
|
/**
|
2000-04-20 23:02:20 +00:00
|
|
|
* Moves the current position relative to the start or end of the
|
|
|
|
* iteration range, or relative to the current position itself.
|
|
|
|
* The movement is expressed in numbers of code points forward
|
|
|
|
* or backward by specifying a positive or negative delta.
|
2004-06-08 22:39:23 +00:00
|
|
|
* @param delta the position relative to origin. A positive delta means forward;
|
2002-07-03 12:05:56 +00:00
|
|
|
* a negative delta means backward.
|
2004-06-08 22:39:23 +00:00
|
|
|
* @param origin Origin enumeration {kStart, kCurrent, kEnd}
|
2000-04-20 23:02:20 +00:00
|
|
|
* @return the new position
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2002-03-12 01:32:42 +00:00
|
|
|
virtual int32_t move32(int32_t delta, EOrigin origin);
|
1999-12-28 23:39:02 +00:00
|
|
|
|
2000-01-08 02:05:05 +00:00
|
|
|
/**
|
|
|
|
* Sets the iterator to iterate over a new range of text
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-01-08 02:05:05 +00:00
|
|
|
*/
|
2000-04-12 19:36:30 +00:00
|
|
|
void setText(const UChar* newText, int32_t newTextLength);
|
2004-08-24 17:21:14 +00:00
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
/**
|
2000-04-12 19:36:30 +00:00
|
|
|
* Copies the UChar array under iteration into the UnicodeString
|
1999-12-28 23:39:02 +00:00
|
|
|
* referred to by "result". Even if this iterator iterates across
|
2000-04-20 23:02:20 +00:00
|
|
|
* only a part of this string, the whole string is copied.
|
2004-08-24 17:21:14 +00:00
|
|
|
* @param result Receives a copy of the text under iteration.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2004-03-30 22:39:45 +00:00
|
|
|
virtual void getText(UnicodeString& result);
|
1999-12-28 23:39:02 +00:00
|
|
|
|
|
|
|
/**
|
2004-08-24 17:21:14 +00:00
|
|
|
* Return a class ID for this class (not really public)
|
|
|
|
* @return a class ID for this class
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2004-08-24 17:21:14 +00:00
|
|
|
static UClassID U_EXPORT2 getStaticClassID(void);
|
1999-12-28 23:39:02 +00:00
|
|
|
|
|
|
|
/**
|
2004-08-24 17:21:14 +00:00
|
|
|
* Return a class ID for this object (not really public)
|
|
|
|
* @return a class ID for this object.
|
2002-12-04 23:39:56 +00:00
|
|
|
* @stable ICU 2.0
|
2000-03-22 18:31:40 +00:00
|
|
|
*/
|
2003-08-27 01:01:42 +00:00
|
|
|
virtual UClassID getDynamicClassID(void) const;
|
1999-12-28 23:39:02 +00:00
|
|
|
|
2000-04-12 19:36:30 +00:00
|
|
|
protected:
|
2002-12-18 22:59:35 +00:00
|
|
|
/**
|
|
|
|
* Protected constructor
|
|
|
|
* @stable ICU 2.0
|
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
UCharCharacterIterator();
|
2002-12-18 22:59:35 +00:00
|
|
|
/**
|
|
|
|
* Protected member text
|
2003-06-10 17:59:40 +00:00
|
|
|
* @stable ICU 2.0
|
2004-08-24 17:21:14 +00:00
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
const UChar* text;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2001-10-08 23:26:58 +00:00
|
|
|
U_NAMESPACE_END
|
1999-12-28 23:39:02 +00:00
|
|
|
#endif
|