65#if !UCONFIG_NO_COLLATION
312 const UChar* target, int32_t targetLength,
360 int32_t sourceLength,
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();
819inline void RuleBasedCollator::setUCollator(
const Locale &locale,
822 setUCollator(locale.
getName(), status);
826inline void RuleBasedCollator::setUCollator(
UCollator *collator)
829 if (ucollator && dataIsOwned) {
832 ucollator = collator;
834 isWriteThroughAlias =
TRUE;
835 setRuleStringFromCollator();
838#ifndef U_HIDE_INTERNAL_API
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...
Collation keys are generated by the Collator class.
ECollationStrength
Base letter represents a primary difference.
virtual EComparisonResult compare(const UnicodeString &source, const UnicodeString &target) const
The comparison function compares the character data stored in two different strings.
A Locale object represents a specific geographical, political, or cultural region.
const char * getName() const
Returns the programmatic name of the entire locale, with the language, country and variant separated ...
virtual CollationElementIterator * createCollationElementIterator(const UnicodeString &source) const
Creates a collation element iterator for the source string.
static UClassID getStaticClassID(void)
Returns the class ID for this class.
virtual UColAttributeValue getAttribute(UColAttribute attr, UErrorCode &status) const
Universal attribute getter.
virtual UnicodeSet * getTailoredSet(UErrorCode &status) const
Get an UnicodeSet that contains all the characters and sequences tailored in this collator.
virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status)
Sets the variable top to a collation element value of a string supplied.
virtual UCollationResult compare(const UnicodeString &source, const UnicodeString &target, int32_t length, UErrorCode &status) const
Does the same thing as compare but limits the comparison to a specified length.
friend class CollationElementIterator
Used to iterate over collation elements in a character source.
virtual UBool operator==(const Collator &other) const
Returns true if argument is the same as this object.
virtual uint32_t setVariableTop(const UnicodeString &varTop, UErrorCode &status)
Sets the variable top to a collation element value of a string supplied.
virtual ~RuleBasedCollator()
Destructor.
virtual UCollationResult compare(const UnicodeString &source, const UnicodeString &target, UErrorCode &status) const
The comparison function compares the character data stored in two different strings.
virtual CollationKey & getCollationKey(const UChar *source, int32_t sourceLength, CollationKey &key, UErrorCode &status) const
Transforms a specified region of the string into a series of characters that can be compared with Col...
RuleBasedCollator & operator=(const RuleBasedCollator &other)
Assignment operator.
RuleBasedCollator(const RuleBasedCollator &other)
Copy constructor.
friend class StringSearch
Searching over collation elements in a character source.
void getRules(UColRuleOption delta, UnicodeString &buffer)
Returns current rules.
uint8_t * cloneRuleData(int32_t &length, UErrorCode &status)
Returns the binary format of the class's rules.
virtual CollationElementIterator * createCollationElementIterator(const CharacterIterator &source) const
Creates a collation element iterator for the source.
virtual void setVariableTop(uint32_t varTop, UErrorCode &status)
Sets the variable top to a collation element value supplied.
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.
const UCollator * getUCollator()
Get UCollator data struct.
RuleBasedCollator(const UnicodeString &rules, UErrorCode &status)
RuleBasedCollator constructor.
const UnicodeString & getRules(void) const
Gets the tailoring rules for this collator.
RuleBasedCollator(const uint8_t *bin, int32_t length, const RuleBasedCollator *base, UErrorCode &status)
Opens a collator from a collator binary image created using cloneBinary.
virtual int32_t getSortKey(const UnicodeString &source, uint8_t *result, int32_t resultLength) const
Get the sort key as an array of bytes from an UnicodeString.
int32_t getMaxExpansion(int32_t order) const
Return the maximum length of any expansion sequences that end with the specified comparison order.
virtual uint32_t getVariableTop(UErrorCode &status) const
Gets the variable top value of a Collator.
virtual void setReorderCodes(const int32_t *reorderCodes, int32_t reorderCodesLength, UErrorCode &status)
Sets the ordering of scripts for this collator.
virtual UCollationResult compare(const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength, UErrorCode &status) const
The comparison function compares the character data stored in two different string arrays.
RuleBasedCollator(const UnicodeString &rules, UColAttributeValue decompositionMode, UErrorCode &status)
RuleBasedCollator constructor.
virtual CollationKey & getCollationKey(const UnicodeString &source, CollationKey &key, UErrorCode &status) const
Transforms a specified region of the string into a series of characters that can be compared with Col...
RuleBasedCollator(const UnicodeString &rules, ECollationStrength collationStrength, UColAttributeValue decompositionMode, UErrorCode &status)
RuleBasedCollator constructor.
int32_t cloneBinary(uint8_t *buffer, int32_t capacity, UErrorCode &status)
Creates a binary image of a collator.
virtual Collator * clone(void) const
Makes a copy of this object.
virtual void setAttribute(UColAttribute attr, UColAttributeValue value, UErrorCode &status)
Universal attribute setter.
virtual void setLocales(const Locale &requestedLocale, const Locale &validLocale, const Locale &actualLocale)
Used internally by registraton to define the requested and valid locales.
virtual void getVersion(UVersionInfo info) const
Gets the version information for a Collator.
virtual int32_t getReorderCodes(int32_t *dest, int32_t destCapacity, UErrorCode &status) const
Retrieves the reordering codes for this collator.
virtual UCollationResult compare(UCharIterator &sIter, UCharIterator &tIter, UErrorCode &status) const
Compares two strings using the Collator.
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const
Gets the locale of the Collator.
RuleBasedCollator(const UnicodeString &rules, ECollationStrength collationStrength, UErrorCode &status)
RuleBasedCollator constructor.
virtual int32_t getSortKey(const UChar *source, int32_t sourceLength, uint8_t *result, int32_t resultLength) const
Get the sort key as an array of bytes from an UChar buffer.
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
virtual int32_t hashCode(void) const
Generates the hash code for the rule-based collation object.
friend class Collator
Collator ONLY needs access to RuleBasedCollator(const Locale&, ...
virtual int32_t internalGetShortDefinitionString(const char *locale, char *buffer, int32_t capacity, UErrorCode &status) const
Get the short definition string for a collator.
StringSearch is a SearchIterator that provides language-sensitive text searching based on the compari...
A mutable set of Unicode characters and multicharacter strings.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
C++ API: Collation Service.
C++ API: Unicode Normalization.
C++ API: Keys for comparing strings multiple times.
C API for code unit iteration.
struct UCollator UCollator
structure representing a collator object instance
UColRuleOption
Options for retrieving the rule string.
UColAttribute
Attributes that collation service understands.
void ucol_close(UCollator *coll)
Close a UCollator.
UCollationResult
UCOL_LESS is returned if source string is compared to be less than target string in the u_strcoll() m...
UColAttributeValue
Enum containing attribute values for controling collation behavior.
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested,...
int8_t UBool
The ICU boolean type.
#define TRUE
The TRUE value of a UBool.
#define FALSE
The FALSE value of a UBool.
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
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
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]
The binary form of a version on ICU APIs is an array of 4 uint8_t.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.