/*
**********************************************************************
-* Copyright (C) 1998-2003, International Business Machines
+* Copyright (C) 1998-2005, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*/
#include "unicode/utypes.h"
#include "unicode/chariter.h"
+/**
+ * \file
+ * \brief C++ API: UChar Character Iterator
+ */
+
U_NAMESPACE_BEGIN
/**
/**
* Copy constructor. The new iterator iterates over the same range
* of the same string as "that", and its initial position is the
- * same as "that"'s current position.
+ * same as "that"'s current position.
* @param that The UCharCharacterIterator to be copied
* @stable ICU 2.0
*/
UCharCharacterIterator(const UCharCharacterIterator& that);
/**
- * Destructor.
+ * Destructor.
* @stable ICU 2.0
*/
- ~UCharCharacterIterator();
+ virtual ~UCharCharacterIterator();
/**
* Assignment operator. *this is altered to iterate over the sane
* range of the same string as "that", and refers to the same
- * character within that string as "that" does.
+ * character within that string as "that" does.
* @param that The object to be copied
- * @return the newly created object
+ * @return the newly created object
* @stable ICU 2.0
*/
UCharCharacterIterator&
/**
* Returns true if the iterators iterate over the same range of the
- * same string and are pointing at the same character.
+ * same string and are pointing at the same character.
* @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.
virtual UBool operator==(const ForwardCharacterIterator& that) const;
/**
- * Generates a hash code for this iterator.
+ * Generates a hash code for this iterator.
* @return the hash code.
* @stable ICU 2.0
*/
/**
* Returns a new UCharCharacterIterator referring to the same
* character in the same range of the same string as this one. The
- * caller must delete the new iterator.
+ * caller must delete the new iterator.
* @return the CharacterIterator newly created
* @stable ICU 2.0
*/
virtual CharacterIterator* clone(void) const;
-
+
/**
* Sets the iterator to refer to the first code unit in its
* iteration range, and returns that code unit.
/**
* Sets the iterator to refer to the "position"-th code unit
* in the text-storage object the iterator refers to, and
- * returns that code unit.
- * @position the position within the text-storage object
+ * returns that code unit.
+ * @param position the position within the text-storage object
* @return the code unit
* @stable ICU 2.0
*/
* returns that code point.
* The current position is adjusted to the beginning of the code point
* (its first code unit).
- * @position the position within the text-storage object
+ * @param position the position within the text-storage object
* @return the code unit
* @stable ICU 2.0
*/
virtual UChar32 setIndex32(int32_t position);
/**
- * Returns the code unit the iterator currently refers to.
+ * Returns the code unit the iterator currently refers to.
* @return the code unit the iterator currently refers to.
* @stable ICU 2.0
*/
virtual UChar current(void) const;
/**
- * Returns the code point the iterator currently refers to.
+ * Returns the code point the iterator currently refers to.
* @return the code point the iterator currently refers to.
* @stable ICU 2.0
*/
/**
* Advances to the next code unit in the iteration range (toward
* endIndex()), and returns that code unit. If there are no more
- * code units to return, returns DONE.
- * @return the next code unit in the iteration range.
+ * code units to return, returns DONE.
+ * @return the next code unit in the iteration range.
* @stable ICU 2.0
*/
virtual UChar next(void);
* @stable ICU 2.0
*/
virtual UChar nextPostInc(void);
-
+
/**
* Advances to the next code point in the iteration range (toward
* endIndex()), and returns that code point. If there are no more
- * code points to return, returns DONE.
+ * code points to return, returns DONE.
* Note that iteration with "pre-increment" semantics is less
* efficient than iteration with "post-increment" semantics
* that is provided by next32PostInc().
* @stable ICU 2.0
*/
virtual UChar32 next32PostInc(void);
-
+
/**
* Returns FALSE if there are no more code units or code points
* at or after the current position in the iteration range.
/**
* Advances to the previous code unit in the iteration range (toward
* startIndex()), and returns that code unit. If there are no more
- * code units to return, returns DONE.
+ * code units to return, returns DONE.
* @return the previous code unit in the iteration range.
* @stable ICU 2.0
*/
* Advances to the previous code point in the iteration range (toward
* startIndex()), and returns that code point. If there are no more
* code points to return, returns DONE.
- * @return the previous code point in the iteration range.
+ * @return the previous code point in the iteration range.
* @stable ICU 2.0
*/
virtual UChar32 previous32(void);
* 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.
- * @delta the position relative to origin. A positive delta means forward;
+ * @param delta the position relative to origin. A positive delta means forward;
* a negative delta means backward.
- * @origin Origin enumeration {kStart, kCurrent, kEnd}
+ * @param origin Origin enumeration {kStart, kCurrent, kEnd}
* @return the new position
* @stable ICU 2.0
*/
* 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.
- * @delta the position relative to origin. A positive delta means forward;
+ * @param delta the position relative to origin. A positive delta means forward;
* a negative delta means backward.
- * @origin Origin enumeration {kStart, kCurrent, kEnd}
+ * @param origin Origin enumeration {kStart, kCurrent, kEnd}
* @return the new position
* @stable ICU 2.0
*/
* @stable ICU 2.0
*/
void setText(const UChar* newText, int32_t newTextLength);
-
+
/**
* Copies the UChar array under iteration into the UnicodeString
* referred to by "result". Even if this iterator iterates across
* only a part of this string, the whole string is copied.
- * @param result Receives a copy of the text under iteration.
+ * @param result Receives a copy of the text under iteration.
* @stable ICU 2.0
*/
virtual void getText(UnicodeString& result);
/**
- * Return a class ID for this object (not really public)
- * @return a class ID for this object.
+ * Return a class ID for this class (not really public)
+ * @return a class ID for this class
* @stable ICU 2.0
*/
- virtual UClassID getDynamicClassID(void) const;
+ static UClassID U_EXPORT2 getStaticClassID(void);
/**
- * Return a class ID for this class (not really public)
- * @return a class ID for this class
+ * Return a class ID for this object (not really public)
+ * @return a class ID for this object.
* @stable ICU 2.0
*/
- static inline UClassID getStaticClassID(void);
+ virtual UClassID getDynamicClassID(void) const;
protected:
/**
/**
* Protected member text
* @stable ICU 2.0
- */
+ */
const UChar* text;
-private:
- static const char fgClassID;
};
-inline UClassID
-UCharCharacterIterator::getStaticClassID(void)
-{ return (UClassID)(&fgClassID); }
-
-inline UClassID
-UCharCharacterIterator::getDynamicClassID(void) const
-{ return UCharCharacterIterator::getStaticClassID(); }
-
U_NAMESPACE_END
#endif