65 #if !UCONFIG_NO_COLLATION
81 class CollationElementIterator;
312 const UChar* target, int32_t targetLength,
360 int32_t sourceLength,
369 virtual int32_t
hashCode(
void)
const;
407 int32_t getMaxExpansion(int32_t order)
const;
432 static UClassID U_EXPORT2 getStaticClassID(
void);
442 uint8_t *cloneRuleData(int32_t &length,
UErrorCode &status);
455 int32_t cloneBinary(uint8_t *buffer, int32_t capacity,
UErrorCode &status);
552 int32_t resultLength)
const;
567 uint8_t *result, int32_t resultLength)
const;
583 int32_t destCapacity,
597 int32_t reorderCodesLength,
618 int32_t destCapacity,
627 CHARINDEX = 0x70000000,
629 EXPANDCHARINDEX = 0x7E000000,
631 CONTRACTCHARINDEX = 0x7F000000,
633 UNMAPPED = 0xFFFFFFFF,
635 PRIMARYORDERINCREMENT = 0x00010000,
637 SECONDARYORDERINCREMENT = 0x00000100,
639 TERTIARYORDERINCREMENT = 0x00000001,
641 PRIMARYORDERMASK = 0xffff0000,
643 SECONDARYORDERMASK = 0x0000ff00,
645 TERTIARYORDERMASK = 0x000000ff,
647 IGNORABLEMASK = 0x0000ffff,
649 PRIMARYDIFFERENCEONLY = 0xffff0000,
651 SECONDARYDIFFERENCEONLY = 0xffffff00,
653 PRIMARYORDERSHIFT = 16,
655 SECONDARYORDERSHIFT = 8,
657 COLELEMENTSTART = 0x02020202,
659 PRIMARYLOWZEROMASK = 0x00FF0000,
661 RESETSECONDARYTERTIARY = 0x00000202,
663 RESETTERTIARY = 0x00000002,
665 PRIMIGNORABLE = 0x0202
672 UBool isWriteThroughAlias;
750 void setUCollator(
const char* locale,
UErrorCode& status);
761 #ifndef U_HIDE_INTERNAL_API
782 void checkOwned(
void);
785 void setRuleStringFromCollator();
819 inline void RuleBasedCollator::setUCollator(
const Locale &locale,
822 setUCollator(locale.
getName(), status);
826 inline void RuleBasedCollator::setUCollator(
UCollator *collator)
829 if (ucollator && dataIsOwned) {
832 ucollator = collator;
834 isWriteThroughAlias =
TRUE;
835 setRuleStringFromCollator();
838 #ifndef U_HIDE_INTERNAL_API
839 inline const UCollator * RuleBasedCollator::getUCollator()
uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]
The binary form of a version on ICU APIs is an array of 4 uint8_t.
virtual UBool operator==(const Collator &other) const
Returns TRUE if "other" is the same as "this".
virtual void setReorderCodes(const int32_t *reorderCodes, int32_t reorderCodesLength, UErrorCode &status)
Sets the ordering of scripts for this collator.
virtual int32_t hashCode(void) const =0
Generates the hash code for the collation object.
The Collator class performs locale-sensitive string comparison.
UCollationResult
UCOL_LESS is returned if source string is compared to be less than target string in the u_strcoll() m...
C++ API: Unicode Normalization.
virtual uint32_t getVariableTop(UErrorCode &status) const =0
Gets the variable top value of a Collator.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
C API for code unit iteration.
virtual int32_t internalGetShortDefinitionString(const char *locale, char *buffer, int32_t capacity, UErrorCode &status) const
Get the short definition string for a collator.
ECollationStrength
Base letter represents a primary difference.
UColAttribute
Attributes that collation service understands.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status)=0
Sets the variable top to a collation element value of a string supplied.
virtual UColAttributeValue getAttribute(UColAttribute attr, UErrorCode &status) const =0
Universal attribute getter.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
The RuleBasedCollator class provides the simple implementation of Collator, using data-driven tables...
C++ API: Collation Service.
Abstract class that defines an API for iteration on text objects.
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const =0
Gets the locale of the Collator.
const char * getName() const
Returns the programmatic name of the entire locale, with the language, country and variant separated ...
static int32_t getEquivalentReorderCodes(int32_t reorderCode, int32_t *dest, int32_t destCapacity, UErrorCode &status)
Retrieves the reorder codes that are grouped with the given reorder code.
virtual Collator * clone(void) const =0
Makes a copy of this object.
virtual UClassID getDynamicClassID(void) const =0
Returns a unique class ID POLYMORPHICALLY.
The CollationElementIterator class is used as an iterator to walk through each character of an intern...
virtual void getVersion(UVersionInfo info) const =0
Gets the version information for a Collator.
virtual void setLocales(const Locale &requestedLocale, const Locale &validLocale, const Locale &actualLocale)
Used internally by registraton to define the requested and valid locales.
C++ API: Keys for comparing strings multiple times.
Collation keys are generated by the Collator class.
virtual int32_t getSortKey(const UnicodeString &source, uint8_t *result, int32_t resultLength) const =0
Get the sort key as an array of bytes from an UnicodeString.
virtual CollationKey & getCollationKey(const UnicodeString &source, CollationKey &key, UErrorCode &status) const =0
Transforms the string into a series of characters that can be compared with CollationKey::compareTo.
void ucol_close(UCollator *coll)
Close a UCollator.
virtual EComparisonResult compare(const UnicodeString &source, const UnicodeString &target) const
The comparison function compares the character data stored in two different strings.
#define TRUE
The TRUE value of a UBool.
A mutable set of Unicode characters and multicharacter strings.
virtual int32_t getReorderCodes(int32_t *dest, int32_t destCapacity, UErrorCode &status) const
Retrieves the reordering codes for this collator.
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
virtual UnicodeSet * getTailoredSet(UErrorCode &status) const
Get an UnicodeSet that contains all the characters and sequences tailored in this collator...
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested...
struct UCollator UCollator
structure representing a collator object instance
virtual void setAttribute(UColAttribute attr, UColAttributeValue value, UErrorCode &status)=0
Universal attribute setter.
StringSearch is a SearchIterator that provides language-sensitive text searching based on the compari...
Basic definitions for ICU, for both C and C++ APIs.
#define FALSE
The FALSE value of a UBool.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UColAttributeValue
Enum containing attribute values for controling collation behavior.
UColRuleOption
Options for retrieving the rule string.
int8_t UBool
The ICU boolean type.
A Locale object represents a specific geographical, political, or cultural region.