38 #if U_SHOW_CPLUSPLUS_API
40 #if !UCONFIG_NO_COLLATION
52 class CharacterIterator;
53 class CollationIterator;
54 class RuleBasedCollator;
131 NULLORDER =
static_cast<int32_t
>(0xffffffff)
200 static inline int32_t primaryOrder(int32_t order);
208 static inline int32_t secondaryOrder(int32_t order);
216 static inline int32_t tertiaryOrder(int32_t order);
259 static inline UBool isIgnorable(int32_t order);
291 #ifndef U_HIDE_INTERNAL_API
312 friend class UCollationPCE;
357 inline int8_t normalizeDir()
const {
return dir_ == 1 ? 0 : dir_; }
361 static int32_t getMaxExpansion(
const UHashtable *maxExpansions, int32_t order);
365 CollationIterator *iter_;
366 const RuleBasedCollator *rbc_;
380 UnicodeString string_;
385 inline int32_t CollationElementIterator::primaryOrder(int32_t order)
387 return (order >> 16) & 0xffff;
390 inline int32_t CollationElementIterator::secondaryOrder(int32_t order)
392 return (order >> 8) & 0xff;
395 inline int32_t CollationElementIterator::tertiaryOrder(int32_t order)
400 inline UBool CollationElementIterator::isIgnorable(int32_t order)
402 return (order & 0xffff0000) == 0;
Abstract class that defines an API for iteration on text objects.
The CollationElementIterator class is used as an iterator to walk through each character of an inte...
static CollationElementIterator * fromUCollationElements(UCollationElements *uc)
UCollationElements * toUCollationElements()
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
int32_t strengthOrder(int32_t order) const
Gets the comparison order in the desired strength.
int32_t previous(UErrorCode &status)
Get the ordering priority of the previous collation element in the string.
virtual UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
bool operator==(const CollationElementIterator &other) const
Returns true if "other" is the same as "this".
const UCollationElements * toUCollationElements() const
void setText(CharacterIterator &str, UErrorCode &status)
Sets the source string.
bool operator!=(const CollationElementIterator &other) const
Returns true if "other" is not the same as "this".
int32_t getOffset() const
Gets the offset of the currently processed character in the source string.
CollationElementIterator(const CollationElementIterator &other)
Copy constructor.
void setText(const UnicodeString &str, UErrorCode &status)
Sets the source string.
int32_t getMaxExpansion(int32_t order) const
Return the maximum length of any expansion sequences that end with the specified comparison order.
int32_t next(UErrorCode &status)
Gets the ordering priority of the next character in the string.
static const CollationElementIterator * fromUCollationElements(const UCollationElements *uc)
void reset()
Resets the cursor to the beginning of the string.
void setOffset(int32_t newOffset, UErrorCode &status)
Sets the offset of the currently processed character in the source string.
virtual ~CollationElementIterator()
Destructor.
The RuleBasedCollator class provides the implementation of Collator, using data-driven tables.
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
struct UHashtable UHashtable
struct UCollationElements UCollationElements
The UCollationElements struct.
int8_t UBool
The ICU boolean type, a signed-byte integer.
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.