Go to the documentation of this file.
57 #if U_SHOW_CPLUSPLUS_API
59 #if !UCONFIG_NO_COLLATION
72 class StringEnumeration;
74 #if !UCONFIG_NO_SERVICE
78 class CollatorFactory;
209 #ifndef U_FORCE_HIDE_DEPRECATED_API
226 #endif // U_FORCE_HIDE_DEPRECATED_API
272 virtual Collator* clone()
const = 0;
330 #ifndef U_FORCE_HIDE_DEPRECATED_API
342 virtual EComparisonResult compare(
const UnicodeString& source,
344 #endif // U_FORCE_HIDE_DEPRECATED_API
362 #ifndef U_FORCE_HIDE_DEPRECATED_API
375 virtual EComparisonResult compare(
const UnicodeString& source,
377 int32_t length)
const;
378 #endif // U_FORCE_HIDE_DEPRECATED_API
398 #ifndef U_FORCE_HIDE_DEPRECATED_API
432 virtual EComparisonResult compare(
const char16_t* source, int32_t sourceLength,
433 const char16_t* target, int32_t targetLength)
435 #endif // U_FORCE_HIDE_DEPRECATED_API
453 virtual UCollationResult compare(
const char16_t* source, int32_t sourceLength,
454 const char16_t* target, int32_t targetLength,
530 virtual CollationKey& getCollationKey(
const char16_t*source,
531 int32_t sourceLength,
538 virtual int32_t hashCode(
void)
const = 0;
540 #ifndef U_FORCE_HIDE_DEPRECATED_API
554 #endif // U_FORCE_HIDE_DEPRECATED_API
591 #ifndef U_FORCE_HIDE_DEPRECATED_API
602 virtual ECollationStrength getStrength(
void)
const;
622 virtual void setStrength(ECollationStrength newStrength);
623 #endif // U_FORCE_HIDE_DEPRECATED_API
640 virtual int32_t getReorderCodes(int32_t *dest,
641 int32_t destCapacity,
659 virtual void setReorderCodes(
const int32_t* reorderCodes,
660 int32_t reorderCodesLength,
683 static int32_t U_EXPORT2 getEquivalentReorderCodes(int32_t reorderCode,
685 int32_t destCapacity,
698 const Locale& displayLocale,
723 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
805 static Locale U_EXPORT2 getFunctionalEquivalent(
const char* keyword,
const Locale& locale,
808 #if !UCONFIG_NO_SERVICE
921 #ifndef U_FORCE_HIDE_DEPRECATED_API
938 virtual uint32_t setVariableTop(
const char16_t *varTop, int32_t len,
UErrorCode &status) = 0;
968 virtual void setVariableTop(uint32_t varTop,
UErrorCode &status) = 0;
969 #endif // U_FORCE_HIDE_DEPRECATED_API
978 virtual uint32_t getVariableTop(
UErrorCode &status)
const = 0;
991 #ifndef U_FORCE_HIDE_DEPRECATED_API
999 virtual Collator* safeClone()
const;
1000 #endif // U_FORCE_HIDE_DEPRECATED_API
1020 int32_t resultLength)
const = 0;
1041 virtual int32_t getSortKey(
const char16_t*source, int32_t sourceLength,
1042 uint8_t*result, int32_t resultLength)
const = 0;
1081 static int32_t U_EXPORT2 getBound(
const uint8_t *source,
1082 int32_t sourceLength,
1084 uint32_t noOfLevels,
1086 int32_t resultLength,
1103 #ifndef U_HIDE_DEPRECATED_API
1134 virtual void setLocales(
const Locale& requestedLocale,
const Locale& validLocale,
const Locale& actualLocale);
1159 virtual int32_t internalGetShortDefinitionString(
const char *locale,
1169 const char *left, int32_t leftLength,
1170 const char *right, int32_t rightLength,
1178 internalNextSortKeyPart(
1180 uint8_t *dest, int32_t count,
UErrorCode &errorCode)
const;
1182 #ifndef U_HIDE_INTERNAL_API
1185 return reinterpret_cast<Collator *
>(uc);
1189 return reinterpret_cast<const Collator *
>(uc);
1193 return reinterpret_cast<UCollator *
>(
this);
1197 return reinterpret_cast<const UCollator *
>(
this);
1199 #endif // U_HIDE_INTERNAL_API
1207 friend class CFactory;
1208 friend class SimpleCFactory;
1209 friend class ICUCollatorFactory;
1210 friend class ICUCollatorService;
1215 #if !UCONFIG_NO_SERVICE
1248 virtual UBool visible(
void)
const;
1270 const Locale& displayLocale,
@ UCOL_IDENTICAL
Identical collation strength.
@ UCOL_QUATERNARY
Quaternary collation strength.
@ UCOL_EQUAL
string a == string b
Collation keys are generated by the Collator class.
UColAttribute
Attributes that collation service understands.
Basic definitions for ICU, for both C and C++ APIs.
static const Collator * fromUCollator(const UCollator *uc)
A mutable set of Unicode characters and multicharacter strings.
ECollationStrength
Base letter represents a primary difference.
int8_t UBool
The ICU boolean type, a signed-byte integer.
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested,...
@ UCOL_LESS
string a < string b
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
@ UCOL_PRIMARY
Primary collation strength.
The Collator class performs locale-sensitive string comparison.
UColAttributeValue
Enum containing attribute values for controlling collation behavior.
UCollationResult
UCOL_LESS is returned if source string is compared to be less than target string in the ucol_strcoll(...
@ UCOL_SECONDARY
Secondary collation strength.
C++ API: StringPiece: Read-only byte string wrapper class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UCollator * toUCollator()
UObject is the common ICU "boilerplate" class.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Base class for 'pure' C++ implementations of uenum api.
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
UColBoundMode
enum that is taken by ucol_getBound API See below for explanation do not change the values assigned...
UNormalizationMode
Constants for normalization modes.
const UCollator * toUCollator() const
struct UCollator UCollator
structure representing a collator object instance
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
C API: Unicode Normalization.
C API for code unit iteration.
@ UCOL_TERTIARY
Tertiary collation strength.
C API: Unicode Character Iteration.
static Collator * fromUCollator(UCollator *uc)
uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]
The binary form of a version on ICU APIs is an array of 4 uint8_t.
C++ API: Locale ID object.
C++ API: Common ICU base class UObject.
A string-like object that points to a sized piece of memory.
A factory, used with registerFactory, the creates multiple collators and provides display names for t...
EComparisonResult
LESS is returned if source string is compared to be less than target string in the compare() method.
A Locale object represents a specific geographical, political, or cultural region.
@ UCOL_GREATER
string a > string b
UColReorderCode
Enum containing the codes for reordering segments of the collation table that are not script codes.
const typedef void * URegistryKey
Opaque type returned by registerInstance, registerFactory and unregister for service registration.