65 #if !UCONFIG_NO_COLLATION
314 int32_t length)
const;
368 const UChar* target, int32_t targetLength)
388 const UChar* target, int32_t targetLength,
436 int32_t sourceLength,
445 virtual int32_t
hashCode(
void)
const;
484 int32_t getMaxExpansion(int32_t order)
const;
519 uint8_t *cloneRuleData(int32_t &length,
UErrorCode &status);
532 int32_t cloneBinary(uint8_t *buffer, int32_t capacity,
UErrorCode &status);
632 int32_t resultLength)
const;
647 uint8_t *result, int32_t resultLength)
const;
683 int32_t destCapacity,
697 int32_t reorderCodesLength,
718 int32_t destCapacity,
728 CHARINDEX = 0x70000000,
730 EXPANDCHARINDEX = 0x7E000000,
732 CONTRACTCHARINDEX = 0x7F000000,
734 UNMAPPED = 0xFFFFFFFF,
736 PRIMARYORDERINCREMENT = 0x00010000,
738 SECONDARYORDERINCREMENT = 0x00000100,
740 TERTIARYORDERINCREMENT = 0x00000001,
742 PRIMARYORDERMASK = 0xffff0000,
744 SECONDARYORDERMASK = 0x0000ff00,
746 TERTIARYORDERMASK = 0x000000ff,
748 IGNORABLEMASK = 0x0000ffff,
750 PRIMARYDIFFERENCEONLY = 0xffff0000,
752 SECONDARYDIFFERENCEONLY = 0xffffff00,
754 PRIMARYORDERSHIFT = 16,
756 SECONDARYORDERSHIFT = 8,
758 COLELEMENTSTART = 0x02020202,
760 PRIMARYLOWZEROMASK = 0x00FF0000,
762 RESETSECONDARYTERTIARY = 0x00000202,
764 RESETTERTIARY = 0x00000002,
766 PRIMIGNORABLE = 0x0202
773 UBool isWriteThroughAlias;
851 void setUCollator(
const char* locale,
UErrorCode& status);
882 void checkOwned(
void);
885 void setRuleStringFromCollator();
915 inline void RuleBasedCollator::setUCollator(
const Locale &locale,
918 setUCollator(locale.
getName(), status);
922 inline void RuleBasedCollator::setUCollator(
UCollator *collator)
925 if (ucollator && dataIsOwned) {
928 ucollator = collator;
930 isWriteThroughAlias =
TRUE;
931 setRuleStringFromCollator();
945 return Collator::LESS;
947 return Collator::EQUAL;
949 return Collator::GREATER;
959 return Collator::PRIMARY;
961 return Collator::SECONDARY;
963 return Collator::TERTIARY;
965 return Collator::QUATERNARY;
967 return Collator::IDENTICAL;
976 case Collator::PRIMARY :
978 case Collator::SECONDARY :
980 case Collator::TERTIARY :
982 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 ...
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 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 EComparisonResult compare(const UnicodeString &source, const UnicodeString &target) const
The comparison function compares the character data stored in two different strings.
virtual UClassID getDynamicClassID(void) const =0
Returns a unique class ID POLYMORPHICALLY.
virtual void setReorderCodes(const int32_t *reorderCodes, int32_t reorderCodesLength, UErrorCode &status)
Sets the ordering of scripts for this collator.
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 int32_t getReorderCodes(int32_t *dest, int32_t destCapacity, UErrorCode &status) const
Retrieves the reordering codes for this collator.
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.
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...
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.