#include <tblcoll.h>
Inheritance diagram for RuleBasedCollator:
Public Member Functions | |
RuleBasedCollator (const UnicodeString &rules, UErrorCode &status) | |
RuleBasedCollator constructor. | |
RuleBasedCollator (const UnicodeString &rules, ECollationStrength collationStrength, UErrorCode &status) | |
RuleBasedCollator constructor. | |
RuleBasedCollator (const UnicodeString &rules, UColAttributeValue decompositionMode, UErrorCode &status) | |
RuleBasedCollator constructor. | |
RuleBasedCollator (const UnicodeString &rules, ECollationStrength collationStrength, UColAttributeValue decompositionMode, UErrorCode &status) | |
RuleBasedCollator constructor. | |
RuleBasedCollator (const RuleBasedCollator &other) | |
Copy constructor. | |
virtual | ~RuleBasedCollator () |
Destructor. | |
RuleBasedCollator & | operator= (const RuleBasedCollator &other) |
Assignment operator. | |
virtual UBool | operator== (const Collator &other) const |
Returns true if argument is the same as this object. | |
virtual UBool | operator!= (const Collator &other) const |
Returns true if argument is not the same as this object. | |
virtual Collator * | clone (void) const |
Makes a deep copy of the object. | |
virtual CollationElementIterator * | createCollationElementIterator (const UnicodeString &source) const |
Creates a collation element iterator for the source string. | |
virtual CollationElementIterator * | createCollationElementIterator (const CharacterIterator &source) const |
Creates a collation element iterator for the source. | |
virtual EComparisonResult | compare (const UnicodeString &source, const UnicodeString &target) const |
Compares a range of character data stored in two different strings based on the collation rules. | |
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 EComparisonResult | compare (const UnicodeString &source, const UnicodeString &target, int32_t length) const |
Compares a range of character data stored in two different strings based on the collation rules up to the specified length. | |
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. | |
virtual EComparisonResult | compare (const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength) const |
The comparison function compares the character data stored in two different string arrays. | |
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. | |
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 CollationKey.compare. | |
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 CollationKey.compare. | |
virtual int32_t | hashCode (void) const |
Generates the hash code for the rule-based collation object. | |
virtual const Locale | getLocale (ULocDataLocaleType type, UErrorCode &status) const |
Gets the locale of the Collator. | |
const UnicodeString & | getRules (void) const |
Gets the table-based rules for the collation object. | |
virtual void | getVersion (UVersionInfo info) const |
Gets the version information for a Collator. | |
int32_t | getMaxExpansion (int32_t order) const |
Return the maximum length of any expansion sequences that end with the specified comparison order. | |
virtual UClassID | getDynamicClassID (void) const |
Returns a unique class ID POLYMORPHICALLY. | |
uint8_t * | cloneRuleData (int32_t &length, UErrorCode &status) |
Returns the binary format of the class's rules. | |
void | getRules (UColRuleOption delta, UnicodeString &buffer) |
Returns current rules. | |
virtual void | setAttribute (UColAttribute attr, UColAttributeValue value, UErrorCode &status) |
Universal attribute setter. | |
virtual UColAttributeValue | getAttribute (UColAttribute attr, UErrorCode &status) |
Universal attribute getter. | |
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 uint32_t | setVariableTop (const UnicodeString varTop, UErrorCode &status) |
Sets the variable top to a collation element value of a string supplied. | |
virtual void | setVariableTop (const uint32_t varTop, UErrorCode &status) |
Sets the variable top to a collation element value supplied. | |
virtual uint32_t | getVariableTop (UErrorCode &status) const |
Gets the variable top value of a Collator. | |
virtual UnicodeSet * | getTailoredSet (UErrorCode &status) const |
Get an UnicodeSet that contains all the characters and sequences tailored in this collator. | |
virtual Collator * | safeClone (void) |
Thread safe cloning operation. | |
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. | |
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 ECollationStrength | getStrength (void) const |
Determines the minimum strength that will be use in comparison or transformation. | |
virtual void | setStrength (ECollationStrength newStrength) |
Sets the minimum strength to be used in comparison or transformation. | |
const UCollator * | getUCollator () |
Get UCollator data struct. | |
Static Public Member Functions | |
UClassID | getStaticClassID (void) |
Returns the class ID for this class. | |
Protected Member Functions | |
virtual void | setLocales (const Locale &requestedLocale, const Locale &validLocale) |
Used internally by registraton to define the requested and valid locales. | |
Friends | |
class | CollationElementIterator |
Used to iterate over collation elements in a character source. | |
class | Collator |
Collator ONLY needs access to RuleBasedCollator(const Locale&, UErrorCode&). | |
class | StringSearch |
Searching over collation elements in a character source. |
The user can create a customized table-based collation.
Important: The ICU collation service has been reimplemented in order to achieve better performance and UCA compliance. For details, see the collation design document.
RuleBasedCollator is a thin C++ wrapper over the C implementation.
For more information about the collation service see the users guide.
Collation service provides correct sorting orders for most locales supported in ICU. If specific data for a locale is not available, the orders eventually falls back to the UCA sort order.
Sort ordering may be customized by providing your own set of rules. For more on this subject see the Collation customization section of the users guide.
Note, RuleBasedCollator is not to be subclassed.
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
Copy constructor.
|
|
Destructor. ICU 2.0 |
|
Makes a deep copy of the object. The caller owns the returned object.
Implements Collator. |
|
Returns the binary format of the class's rules. The format is that of .col files.
|
|
The comparison function compares the character data stored in two different string arrays. Returns information about whether a string array is less than, greater than or equal to another string array.
Implements Collator. |
|
The comparison function compares the character data stored in two different string arrays. Returns information about whether a string array is less than, greater than or equal to another string array. Example of use:
Reimplemented from Collator. |
|
Does the same thing as compare but limits the comparison to a specified length.
Implements Collator. |
|
Compares a range of character data stored in two different strings based on the collation rules up to the specified length. Returns information about whether a string is less than, greater than or equal to another string in a language. This can be overriden in a subclass.
Reimplemented from Collator. |
|
The comparison function compares the character data stored in two different strings. Returns information about whether a string is less than, greater than or equal to another string.
Implements Collator. |
|
Compares a range of character data stored in two different strings based on the collation rules. Returns information about whether a string is less than, greater than or equal to another string in a language. This can be overriden in a subclass.
Reimplemented from Collator. |
|
Creates a collation element iterator for the source. The caller of this method is responsible for the memory management of the returned pointer.
|
|
Creates a collation element iterator for the source string. The caller of this method is responsible for the memory management of the return pointer.
|
|
Universal attribute getter.
Implements Collator. |
|
Transforms a specified region of the string into a series of characters that can be compared with CollationKey.compare. Use a CollationKey when you need to do repeated comparisions on the same string. For a single comparison the compare method will be faster.
Implements Collator. |
|
Transforms a specified region of the string into a series of characters that can be compared with CollationKey.compare. Use a CollationKey when you need to do repeated comparisions on the same string. For a single comparison the compare method will be faster.
Implements Collator. |
|
Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This method is to implement a simple version of RTTI, since not all C++ compilers support genuine RTTI. Polymorphic operator==() and clone() methods call this method.
Implements Collator. |
|
Gets the locale of the Collator.
Implements Collator. |
|
Return the maximum length of any expansion sequences that end with the specified comparison order.
|
|
Returns current rules. Delta defines whether full rules are returned or just the tailoring.
|
|
Gets the table-based rules for the collation object.
|
|
Get the sort key as an array of bytes from an UChar buffer.
Implements Collator. |
|
Get the sort key as an array of bytes from an UnicodeString.
Implements Collator. |
|
Returns the class ID for this class. This is useful only for comparing to a return value from getDynamicClassID(). For example:
|
|
Determines the minimum strength that will be use in comparison or transformation. E.g. with strength == SECONDARY, the tertiary difference is ignored E.g. with strength == PRIMARY, the secondary and tertiary difference are ignored.
Implements Collator. |
|
Get an UnicodeSet that contains all the characters and sequences tailored in this collator.
Reimplemented from Collator. |
|
Get UCollator data struct. Used only by StringSearch & intltest.
For internal use only.
|
|
Gets the variable top value of a Collator. Lower 16 bits are undefined and should be ignored.
Implements Collator. |
|
Gets the version information for a Collator.
Implements Collator. |
|
Generates the hash code for the rule-based collation object.
Implements Collator. |
|
Returns true if argument is not the same as this object.
Reimplemented from Collator. |
|
Assignment operator.
|
|
Returns true if argument is the same as this object.
Reimplemented from Collator. |
|
Thread safe cloning operation.
Implements Collator. |
|
Universal attribute setter.
Implements Collator. |
|
Used internally by registraton to define the requested and valid locales.
For internal use only.
Reimplemented from Collator. |
|
Sets the minimum strength to be used in comparison or transformation.
Implements Collator. |
|
Sets the variable top to a collation element value supplied. Variable top is set to the upper 16 bits. Lower 16 bits are ignored.
Implements Collator. |
|
Sets the variable top to a collation element value of a string supplied.
Implements Collator. |
|
Sets the variable top to a collation element value of a string supplied.
Implements Collator. |