65 #if !UCONFIG_NO_COLLATION
75 struct CollationSettings;
76 struct CollationTailoring;
84 class CollationElementIterator;
86 class SortKeyByteSink;
167 #ifndef U_HIDE_INTERNAL_API
314 const UChar* target, int32_t targetLength,
379 int32_t sourceLength,
416 #ifndef U_HIDE_DEPRECATED_API
433 int32_t getMaxExpansion(int32_t order)
const;
459 static UClassID U_EXPORT2 getStaticClassID(
void);
461 #ifndef U_HIDE_DEPRECATED_API
472 uint8_t *cloneRuleData(int32_t &length,
UErrorCode &status)
const;
485 int32_t cloneBinary(uint8_t *buffer, int32_t capacity,
UErrorCode &status)
const;
625 int32_t resultLength)
const;
640 uint8_t *result, int32_t resultLength)
const;
656 int32_t destCapacity,
670 int32_t reorderCodesLength,
678 const char *left, int32_t leftLength,
679 const char *right, int32_t rightLength,
716 uint8_t *dest, int32_t count,
UErrorCode &errorCode)
const;
718 #ifndef U_HIDE_INTERNAL_API
745 void internalGetContractionsAndExpansions(
760 void internalBuildTailoring(
781 #endif // U_HIDE_INTERNAL_API
809 void adoptTailoring(CollationTailoring *t);
813 const UChar *right, int32_t rightLength,
816 const uint8_t *right, int32_t rightLength,
819 void writeSortKey(
const UChar *s, int32_t length,
820 SortKeyByteSink &sink,
UErrorCode &errorCode)
const;
822 void writeIdenticalLevel(
const UChar *s,
const UChar *limit,
823 SortKeyByteSink &sink,
UErrorCode &errorCode)
const;
825 const CollationSettings &getDefaultSettings()
const;
827 void setAttributeDefault(int32_t attribute) {
828 explicitlySetAttributes &= ~((uint32_t)1 << attribute);
830 void setAttributeExplicitly(int32_t attribute) {
831 explicitlySetAttributes |= (uint32_t)1 << attribute;
833 UBool attributeHasBeenSetExplicitly(int32_t attribute)
const {
835 return (
UBool)((explicitlySetAttributes & ((uint32_t)1 << attribute)) != 0);
847 static void computeMaxExpansions(
const CollationTailoring *t,
UErrorCode &errorCode);
850 void setFastLatinOptions(CollationSettings &ownedSettings)
const;
852 const CollationData *data;
853 const CollationSettings *settings;
854 const CollationTailoring *tailoring;
856 uint32_t explicitlySetAttributes;
858 UBool actualLocaleIsSameAsValid;
863 #endif // !UCONFIG_NO_COLLATION
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.
virtual UCollationResult internalCompareUTF8(const char *left, int32_t leftLength, const char *right, int32_t rightLength, UErrorCode &errorCode) const
Implements ucol_strcollUTF8().
virtual Collator & setMaxVariable(UColReorderCode group, UErrorCode &errorCode)
Sets the variable top to the top of the specified reordering group.
UCollationResult
UCOL_LESS is returned if source string is compared to be less than target string in the ucol_strcoll(...
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.
static const RuleBasedCollator * rbcFromUCollator(const UCollator *uc)
UColReorderCode
Enum containing the codes for reordering segments of the collation table that are not script codes...
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 the primary weight of the specified string.
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 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.
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...
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
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 registration to define the requested and valid locales.
Collation keys are generated by the Collator class.
virtual UColReorderCode getMaxVariable() const
Returns the maximum reordering group whose characters are affected by UCOL_ALTERNATE_HANDLING.
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 a 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.
virtual EComparisonResult compare(const UnicodeString &source, const UnicodeString &target) const
The comparison function compares the character data stored in two different strings.
A mutable set of Unicode characters and multicharacter strings.
C API: Unicode Character Iteration.
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 a 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...
static RuleBasedCollator * rbcFromUCollator(UCollator *uc)
C++ API: Locale ID object.
struct UCollator UCollator
structure representing a collator object instance
virtual void setAttribute(UColAttribute attr, UColAttributeValue value, UErrorCode &status)=0
Universal attribute setter.
A UParseError struct is used to returned detailed information about parsing errors.
Basic definitions for ICU, for both C and C++ APIs.
static Collator * fromUCollator(UCollator *uc)
virtual int32_t internalNextSortKeyPart(UCharIterator *iter, uint32_t state[2], uint8_t *dest, int32_t count, UErrorCode &errorCode) const
Implements ucol_nextSortKeyPart().
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UColAttributeValue
Enum containing attribute values for controling collation behavior.
A string-like object that points to a sized piece of memory.
UColRuleOption
Options for retrieving the rule string.
The number of UColAttribute constants.
int8_t UBool
The ICU boolean type.
virtual UCollationResult compareUTF8(const StringPiece &source, const StringPiece &target, UErrorCode &status) const
Compares two UTF-8 strings using the Collator.
A Locale object represents a specific geographical, political, or cultural region.