65 #if !UCONFIG_NO_COLLATION
675 CHARINDEX = 0x70000000,
677 EXPANDCHARINDEX = 0x7E000000,
679 CONTRACTCHARINDEX = 0x7F000000,
681 UNMAPPED = 0xFFFFFFFF,
683 PRIMARYORDERINCREMENT = 0x00010000,
685 SECONDARYORDERINCREMENT = 0x00000100,
687 TERTIARYORDERINCREMENT = 0x00000001,
689 PRIMARYORDERMASK = 0xffff0000,
691 SECONDARYORDERMASK = 0x0000ff00,
693 TERTIARYORDERMASK = 0x000000ff,
695 IGNORABLEMASK = 0x0000ffff,
697 PRIMARYDIFFERENCEONLY = 0xffff0000,
699 SECONDARYDIFFERENCEONLY = 0xffffff00,
701 PRIMARYORDERSHIFT = 16,
703 SECONDARYORDERSHIFT = 8,
705 COLELEMENTSTART = 0x02020202,
707 PRIMARYLOWZEROMASK = 0x00FF0000,
709 RESETSECONDARYTERTIARY = 0x00000202,
711 RESETTERTIARY = 0x00000002,
713 PRIMIGNORABLE = 0x0202
720 UBool isWriteThroughAlias;
798 void setUCollator(
const char* locale,
UErrorCode& status);
830 void checkOwned(
void);
833 void setRuleStringFromCollator();
863 inline void RuleBasedCollator::setUCollator(
const Locale &locale,
866 setUCollator(locale.
getName(), status);
870 inline void RuleBasedCollator::setUCollator(
UCollator *collator)
873 if (ucollator && dataIsOwned) {
876 ucollator = collator;
878 isWriteThroughAlias =
TRUE;
879 setRuleStringFromCollator();
893 return Collator::LESS;
895 return Collator::EQUAL;
897 return Collator::GREATER;
907 return Collator::PRIMARY;
909 return Collator::SECONDARY;
911 return Collator::TERTIARY;
913 return Collator::QUATERNARY;
915 return Collator::IDENTICAL;
924 case Collator::PRIMARY :
926 case Collator::SECONDARY :
928 case Collator::TERTIARY :
930 case Collator::QUATERNARY :
uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]
The binary form of a version on ICU APIs is an array of 4 uint8_t.
virtual UnicodeSet * getTailoredSet(UErrorCode &status) const
Get an UnicodeSet that contains all the characters and sequences tailored in this collator...
virtual Collator * safeClone(void)=0
Thread safe cloning operation.
The RuleBasedCollator class provides the simple implementation of Collator, using data-driven tables...
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.
The CollationElementIterator class is used as an iterator to walk through each character of an intern...
virtual UBool operator!=(const Collator &other) const
Returns true if "other" is not the same as "this".
UCollationResult
UCOL_LESS is returned if source string is compared to be less than target string in the u_strcoll() m...
A mutable set of Unicode characters and multicharacter strings.
C++ API: Unicode Normalization.
virtual void setLocales(const Locale &requestedLocale, const Locale &validLocale, const Locale &actualLocale)
Used internally by registraton to define the requested and valid locales.
virtual const Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const =0
Gets the locale of the Collator.
virtual uint32_t getVariableTop(UErrorCode &status) const =0
Gets the variable top value of a Collator.
C API for code unit iteration.
EComparisonResult
LESS is returned if source string is compared to be less than target string in the compare() method...
const char * getName() const
Returns the programmatic name of the entire locale, with the language, country and variant separated ...
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.
unsigned char uint8_t
Define 64 bit limits.
virtual EComparisonResult compare(const UnicodeString &source, const UnicodeString &target) const
The comparison function compares the character data stored in two different strings.
unsigned int uint32_t
Define 64 bit limits.
virtual UClassID getDynamicClassID(void) const =0
Returns a unique class ID POLYMORPHICALLY.
UColAttribute
Attributes that collation service understands.
Abstract class that defines an API for iteration on text objects.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Collation keys are generated by the Collator class.
C++ API: Collation Service.
Secondary collation strength.
virtual void getVersion(UVersionInfo info) const =0
Gets the version information for a Collator.
C++ API: Keys for comparing strings multiple times.
The Collator class performs locale-sensitive string comparison.
void ucol_close(UCollator *coll)
Close a UCollator.
virtual ECollationStrength getStrength(void) const =0
Determines the minimum strength that will be use in comparison or transformation. ...
Tertiary collation strength.
#define TRUE
The TRUE value of a UBool.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
virtual UBool operator==(const Collator &other) const
Returns true if "other" is the same as "this".
virtual UColAttributeValue getAttribute(UColAttribute attr, UErrorCode &status)=0
Universal attribute getter.
virtual int32_t hashCode(void) const =0
Generates the hash code for the collation object.
uint16_t UChar
Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API If the compiler doesn't support namespaces...
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.
virtual void setAttribute(UColAttribute attr, UColAttributeValue value, UErrorCode &status)=0
Universal attribute setter.
void * UClassID
UClassID is used to identify classes without using RTTI, since RTTI is not yet supported by all C++ c...
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
Basic definitions for ICU, for both C and C++ APIs.
Identical collation strength.
virtual Collator * clone(void) const =0
Makes a shallow copy of the current object.
Quaternary collation strength.
#define FALSE
The FALSE value of a UBool.
UColAttributeValue
Enum containing attribute values for controling collation behavior.
A Locale object represents a specific geographical, political, or cultural region.
UColRuleOption
Options for retrieving the rule string.
ECollationStrength
Base letter represents a primary difference.
Primary collation strength.
StringSearch is a SearchIterator that provides language-sensitive text searching based on the compari...
signed int int32_t
Define 64 bit limits.
const UCollator * getUCollator()
Get UCollator data struct.
int8_t UBool
The ICU boolean type.
virtual void setStrength(ECollationStrength newStrength)=0
Sets the minimum strength to be used in comparison or transformation.