Logo Search packages:      
Sourcecode: icu version File versions

UnicodeSetIterator Class Reference

#include <usetiter.h>

Inheritance diagram for UnicodeSetIterator:

UObject UMemory

List of all members.


Detailed Description

UnicodeSetIterator iterates over the contents of a UnicodeSet. It iterates over either code points or code point ranges. After all code points or ranges have been returned, it returns the multicharacter strings of the UnicodeSet, if any.

This class is not intended to be subclassed. Consider any fields or methods declared as "protected" to be private. The use of protected in this class is an artifact of history.

To iterate over code points and strings, use a loop like this:

 UnicodeSetIterator it(set);
 while (it.next()) {
     processItem(it.getString());
 }
 

Each item in the set is accessed as a string. Set elements consisting of single code points are returned as strings containing just the one code point.

To iterate over code point ranges, instead of individual code points, use a loop like this:

 UnicodeSetIterator it(set);
 while (it.nextRange()) {
   if (it.isString()) {
     processString(it.getString());
   } else {
     processCodepointRange(it.getCodepoint(), it.getCodepointEnd());
   }
 }
 
Author:
M. Davis ICU 2.4

Definition at line 61 of file usetiter.h.


Public Member Functions

UChar32 getCodepoint () const
UChar32 getCodepointEnd () const
virtual UClassID getDynamicClassID () const
const UnicodeStringgetString ()
UBool isString () const
UBool next ()
UBool nextRange ()
void reset ()
void reset (const UnicodeSet &set)
 UnicodeSetIterator ()
 UnicodeSetIterator (const UnicodeSet &set)
virtual ~UnicodeSetIterator ()

Static Public Member Functions

static UClassID U_EXPORT2 getStaticClassID ()
static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW

Protected Types

enum  { IS_STRING = -1 }

Protected Member Functions

virtual void loadRange (int32_t range)
UnicodeSetIteratoroperator= (const UnicodeSetIterator &)
 UnicodeSetIterator (const UnicodeSetIterator &)

Protected Attributes

UChar32 codepoint
UChar32 codepointEnd
UnicodeStringcpString
int32_t endElement
int32_t endRange
int32_t nextElement
int32_t nextString
int32_t range
const UnicodeSetset
const UnicodeStringstring
int32_t stringCount

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index