ICU 67.1 67.1

ucol.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 * Copyright (c) 1996-2015, International Business Machines Corporation and others.
6 * All Rights Reserved.
7 *******************************************************************************
8 */
9
10 #ifndef UCOL_H
11 #define UCOL_H
12
13 #include "unicode/utypes.h"
14
15 #if !UCONFIG_NO_COLLATION
16
17 #include "unicode/unorm.h"
18 #include "unicode/localpointer.h"
19 #include "unicode/parseerr.h"
20 #include "unicode/uloc.h"
21 #include "unicode/uset.h"
22 #include "unicode/uscript.h"
23
54 struct UCollator;
58 typedef struct UCollator UCollator;
59
60
73 typedef enum {
75 UCOL_EQUAL = 0,
77 UCOL_GREATER = 1,
79 UCOL_LESS = -1
80 } UCollationResult ;
81
82
89 typedef enum {
91 UCOL_DEFAULT = -1,
92
94 UCOL_PRIMARY = 0,
96 UCOL_SECONDARY = 1,
98 UCOL_TERTIARY = 2,
100 UCOL_DEFAULT_STRENGTH = UCOL_TERTIARY,
101 UCOL_CE_STRENGTH_LIMIT,
103 UCOL_QUATERNARY=3,
105 UCOL_IDENTICAL=15,
106 UCOL_STRENGTH_LIMIT,
107
111 UCOL_OFF = 16,
115 UCOL_ON = 17,
116
118 UCOL_SHIFTED = 20,
120 UCOL_NON_IGNORABLE = 21,
121
124 UCOL_LOWER_FIRST = 24,
126 UCOL_UPPER_FIRST = 25,
127
128 #ifndef U_HIDE_DEPRECATED_API
129
133 UCOL_ATTRIBUTE_VALUE_COUNT
134 #endif /* U_HIDE_DEPRECATED_API */
135 } UColAttributeValue;
136
146 typedef enum {
152 UCOL_REORDER_CODE_DEFAULT = -1,
157 UCOL_REORDER_CODE_NONE = USCRIPT_UNKNOWN,
164 UCOL_REORDER_CODE_OTHERS = USCRIPT_UNKNOWN,
170 UCOL_REORDER_CODE_SPACE = 0x1000,
176 UCOL_REORDER_CODE_FIRST = UCOL_REORDER_CODE_SPACE,
182 UCOL_REORDER_CODE_PUNCTUATION = 0x1001,
188 UCOL_REORDER_CODE_SYMBOL = 0x1002,
194 UCOL_REORDER_CODE_CURRENCY = 0x1003,
200 UCOL_REORDER_CODE_DIGIT = 0x1004,
201 #ifndef U_HIDE_DEPRECATED_API
202
206 UCOL_REORDER_CODE_LIMIT = 0x1005
207 #endif /* U_HIDE_DEPRECATED_API */
208 } UColReorderCode;
209
236 typedef UColAttributeValue UCollationStrength;
237
242 typedef enum {
249 UCOL_FRENCH_COLLATION,
260 UCOL_ALTERNATE_HANDLING,
269 UCOL_CASE_FIRST,
279 UCOL_CASE_LEVEL,
289 UCOL_NORMALIZATION_MODE,
293 UCOL_DECOMPOSITION_MODE = UCOL_NORMALIZATION_MODE,
310 UCOL_STRENGTH,
311 #ifndef U_HIDE_DEPRECATED_API
312
323 UCOL_HIRAGANA_QUATERNARY_MODE = UCOL_STRENGTH + 1,
324 #endif /* U_HIDE_DEPRECATED_API */
325
343 UCOL_NUMERIC_COLLATION = UCOL_STRENGTH + 2,
344
345 /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
346 * it is needed for layout of RuleBasedCollator object. */
347 #ifndef U_FORCE_HIDE_DEPRECATED_API
348
352 UCOL_ATTRIBUTE_COUNT
353 #endif // U_FORCE_HIDE_DEPRECATED_API
354 } UColAttribute;
355
359 typedef enum {
365 UCOL_TAILORING_ONLY,
373 UCOL_FULL_RULES
374 } UColRuleOption ;
375
401 U_STABLE UCollator* U_EXPORT2
402 ucol_open(const char *loc, UErrorCode *status);
403
429 U_STABLE UCollator* U_EXPORT2
430 ucol_openRules( const UChar *rules,
431 int32_t rulesLength,
432 UColAttributeValue normalizationMode,
433 UCollationStrength strength,
434 UParseError *parseError,
435 UErrorCode *status);
436
437 #ifndef U_HIDE_DEPRECATED_API
438
471 U_DEPRECATED UCollator* U_EXPORT2
472 ucol_openFromShortString( const char *definition,
473 UBool forceDefaults,
474 UParseError *parseError,
475 UErrorCode *status);
476 #endif /* U_HIDE_DEPRECATED_API */
477
478 #ifndef U_HIDE_DEPRECATED_API
479
492 U_DEPRECATED int32_t U_EXPORT2
493 ucol_getContractions( const UCollator *coll,
494 USet *conts,
495 UErrorCode *status);
496 #endif /* U_HIDE_DEPRECATED_API */
497
509 U_STABLE void U_EXPORT2
510 ucol_getContractionsAndExpansions( const UCollator *coll,
511 USet *contractions, USet *expansions,
512 UBool addPrefixes, UErrorCode *status);
513
524 U_STABLE void U_EXPORT2
525 ucol_close(UCollator *coll);
526
527 #if U_SHOW_CPLUSPLUS_API
528
529 U_NAMESPACE_BEGIN
530
540 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCollatorPointer, UCollator, ucol_close);
541
542 U_NAMESPACE_END
543
544 #endif
545
561 U_STABLE UCollationResult U_EXPORT2
562 ucol_strcoll( const UCollator *coll,
563 const UChar *source,
564 int32_t sourceLength,
565 const UChar *target,
566 int32_t targetLength);
567
586 U_STABLE UCollationResult U_EXPORT2
587 ucol_strcollUTF8(
588 const UCollator *coll,
589 const char *source,
590 int32_t sourceLength,
591 const char *target,
592 int32_t targetLength,
593 UErrorCode *status);
594
609 U_STABLE UBool U_EXPORT2
610 ucol_greater(const UCollator *coll,
611 const UChar *source, int32_t sourceLength,
612 const UChar *target, int32_t targetLength);
613
628 U_STABLE UBool U_EXPORT2
629 ucol_greaterOrEqual(const UCollator *coll,
630 const UChar *source, int32_t sourceLength,
631 const UChar *target, int32_t targetLength);
632
647 U_STABLE UBool U_EXPORT2
648 ucol_equal(const UCollator *coll,
649 const UChar *source, int32_t sourceLength,
650 const UChar *target, int32_t targetLength);
651
664 U_STABLE UCollationResult U_EXPORT2
665 ucol_strcollIter( const UCollator *coll,
666 UCharIterator *sIter,
667 UCharIterator *tIter,
668 UErrorCode *status);
669
679 U_STABLE UCollationStrength U_EXPORT2
680 ucol_getStrength(const UCollator *coll);
681
691 U_STABLE void U_EXPORT2
692 ucol_setStrength(UCollator *coll,
693 UCollationStrength strength);
694
711 U_STABLE int32_t U_EXPORT2
712 ucol_getReorderCodes(const UCollator* coll,
713 int32_t* dest,
714 int32_t destCapacity,
715 UErrorCode *pErrorCode);
756 U_STABLE void U_EXPORT2
757 ucol_setReorderCodes(UCollator* coll,
758 const int32_t* reorderCodes,
759 int32_t reorderCodesLength,
760 UErrorCode *pErrorCode);
761
781 U_STABLE int32_t U_EXPORT2
782 ucol_getEquivalentReorderCodes(int32_t reorderCode,
783 int32_t* dest,
784 int32_t destCapacity,
785 UErrorCode *pErrorCode);
786
799 U_STABLE int32_t U_EXPORT2
800 ucol_getDisplayName( const char *objLoc,
801 const char *dispLoc,
802 UChar *result,
803 int32_t resultLength,
804 UErrorCode *status);
805
815 U_STABLE const char* U_EXPORT2
816 ucol_getAvailable(int32_t localeIndex);
817
826 U_STABLE int32_t U_EXPORT2
827 ucol_countAvailable(void);
828
829 #if !UCONFIG_NO_SERVICE
830
838 U_STABLE UEnumeration* U_EXPORT2
839 ucol_openAvailableLocales(UErrorCode *status);
840 #endif
841
851 U_STABLE UEnumeration* U_EXPORT2
852 ucol_getKeywords(UErrorCode *status);
853
865 U_STABLE UEnumeration* U_EXPORT2
866 ucol_getKeywordValues(const char *keyword, UErrorCode *status);
867
884 U_STABLE UEnumeration* U_EXPORT2
885 ucol_getKeywordValuesForLocale(const char* key,
886 const char* locale,
887 UBool commonlyUsed,
888 UErrorCode* status);
889
921 U_STABLE int32_t U_EXPORT2
922 ucol_getFunctionalEquivalent(char* result, int32_t resultCapacity,
923 const char* keyword, const char* locale,
924 UBool* isAvailable, UErrorCode* status);
925
934 U_STABLE const UChar* U_EXPORT2
935 ucol_getRules( const UCollator *coll,
936 int32_t *length);
937
938 #ifndef U_HIDE_DEPRECATED_API
939
959 U_DEPRECATED int32_t U_EXPORT2
960 ucol_getShortDefinitionString(const UCollator *coll,
961 const char *locale,
962 char *buffer,
963 int32_t capacity,
964 UErrorCode *status);
965
986 U_DEPRECATED int32_t U_EXPORT2
987 ucol_normalizeShortDefinitionString(const char *source,
988 char *destination,
989 int32_t capacity,
990 UParseError *parseError,
991 UErrorCode *status);
992 #endif /* U_HIDE_DEPRECATED_API */
993
994
1017 U_STABLE int32_t U_EXPORT2
1018 ucol_getSortKey(const UCollator *coll,
1019 const UChar *source,
1020 int32_t sourceLength,
1021 uint8_t *result,
1022 int32_t resultLength);
1023
1024
1045 U_STABLE int32_t U_EXPORT2
1046 ucol_nextSortKeyPart(const UCollator *coll,
1047 UCharIterator *iter,
1048 uint32_t state[2],
1049 uint8_t *dest, int32_t count,
1050 UErrorCode *status);
1051
1059 typedef enum {
1061 UCOL_BOUND_LOWER = 0,
1063 UCOL_BOUND_UPPER = 1,
1065 UCOL_BOUND_UPPER_LONG = 2,
1066 #ifndef U_HIDE_DEPRECATED_API
1067
1071 UCOL_BOUND_VALUE_COUNT
1072 #endif /* U_HIDE_DEPRECATED_API */
1073 } UColBoundMode;
1074
1112 U_STABLE int32_t U_EXPORT2
1113 ucol_getBound(const uint8_t *source,
1114 int32_t sourceLength,
1115 UColBoundMode boundType,
1116 uint32_t noOfLevels,
1117 uint8_t *result,
1118 int32_t resultLength,
1119 UErrorCode *status);
1120
1129 U_STABLE void U_EXPORT2
1130 ucol_getVersion(const UCollator* coll, UVersionInfo info);
1131
1139 U_STABLE void U_EXPORT2
1140 ucol_getUCAVersion(const UCollator* coll, UVersionInfo info);
1141
1189 U_STABLE int32_t U_EXPORT2
1190 ucol_mergeSortkeys(const uint8_t *src1, int32_t src1Length,
1191 const uint8_t *src2, int32_t src2Length,
1192 uint8_t *dest, int32_t destCapacity);
1193
1205 U_STABLE void U_EXPORT2
1206 ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value, UErrorCode *status);
1207
1219 U_STABLE UColAttributeValue U_EXPORT2
1220 ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status);
1221
1238 U_STABLE void U_EXPORT2
1239 ucol_setMaxVariable(UCollator *coll, UColReorderCode group, UErrorCode *pErrorCode);
1240
1248 U_STABLE UColReorderCode U_EXPORT2
1249 ucol_getMaxVariable(const UCollator *coll);
1250
1251 #ifndef U_HIDE_DEPRECATED_API
1252
1272 U_DEPRECATED uint32_t U_EXPORT2
1273 ucol_setVariableTop(UCollator *coll,
1274 const UChar *varTop, int32_t len,
1275 UErrorCode *status);
1276 #endif /* U_HIDE_DEPRECATED_API */
1277
1289 U_STABLE uint32_t U_EXPORT2 ucol_getVariableTop(const UCollator *coll, UErrorCode *status);
1290
1291 #ifndef U_HIDE_DEPRECATED_API
1292
1306 U_DEPRECATED void U_EXPORT2
1307 ucol_restoreVariableTop(UCollator *coll, const uint32_t varTop, UErrorCode *status);
1308 #endif /* U_HIDE_DEPRECATED_API */
1309
1333 U_STABLE UCollator* U_EXPORT2
1334 ucol_safeClone(const UCollator *coll,
1335 void *stackBuffer,
1336 int32_t *pBufferSize,
1337 UErrorCode *status);
1338
1339 #ifndef U_HIDE_DEPRECATED_API
1340
1344 #define U_COL_SAFECLONE_BUFFERSIZE 1
1345
1346 #endif /* U_HIDE_DEPRECATED_API */
1347
1363 U_STABLE int32_t U_EXPORT2
1364 ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen);
1365
1366 #ifndef U_HIDE_DEPRECATED_API
1367
1381 U_DEPRECATED const char * U_EXPORT2
1382 ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
1383 #endif /* U_HIDE_DEPRECATED_API */
1384
1399 U_STABLE const char * U_EXPORT2
1400 ucol_getLocaleByType(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
1401
1412 U_STABLE USet * U_EXPORT2
1413 ucol_getTailoredSet(const UCollator *coll, UErrorCode *status);
1414
1415 #ifndef U_HIDE_INTERNAL_API
1416
1427 U_INTERNAL int32_t U_EXPORT2
1428 ucol_getUnsafeSet( const UCollator *coll,
1429 USet *unsafe,
1430 UErrorCode *status);
1431
1452 U_INTERNAL void U_EXPORT2
1453 ucol_prepareShortStringOpen( const char *definition,
1454 UBool forceDefaults,
1455 UParseError *parseError,
1456 UErrorCode *status);
1457 #endif /* U_HIDE_INTERNAL_API */
1458
1470 U_STABLE int32_t U_EXPORT2
1471 ucol_cloneBinary(const UCollator *coll,
1472 uint8_t *buffer, int32_t capacity,
1473 UErrorCode *status);
1474
1492 U_STABLE UCollator* U_EXPORT2
1493 ucol_openBinary(const uint8_t *bin, int32_t length,
1494 const UCollator *base,
1495 UErrorCode *status);
1496
1497
1498 #endif /* #if !UCONFIG_NO_COLLATION */
1499
1500 #endif
LocalUCollatorPointer
"Smart pointer" class, closes a UCollator via ucol_close().
UVersionInfo
uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]
The binary form of a version on ICU APIs is an array of 4 uint8_t.
Definition: uversion.h:59
ucol_getRules
const UChar * ucol_getRules(const UCollator *coll, int32_t *length)
Get the collation tailoring rules from a UCollator.
UCOL_REORDER_CODE_CURRENCY
Characters with the currency property.
Definition: ucol.h:194
UCOL_LESS
string a < string b
Definition: ucol.h:79
UCOL_ON
Turn the feature on - works for UCOL_FRENCH_COLLATION, UCOL_CASE_LEVEL, UCOL_HIRAGANA_QUATERNARY_MODE...
Definition: ucol.h:115
UCOL_REORDER_CODE_SYMBOL
Characters with the symbol property.
Definition: ucol.h:188
ucol_setMaxVariable
void ucol_setMaxVariable(UCollator *coll, UColReorderCode group, UErrorCode *pErrorCode)
Sets the variable top to the top of the specified reordering group.
UCOL_FULL_RULES
Retrieves the "UCA rules" concatenated with the tailoring rules.
Definition: ucol.h:373
ucol_equal
UBool ucol_equal(const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
Compare two strings for equality.
UCOL_REORDER_CODE_OTHERS
A special reordering code that is used to specify all other codes used for reordering except for the ...
Definition: ucol.h:164
ucol_getAttribute
UColAttributeValue ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status)
Universal attribute getter.
ucol_getUCAVersion
void ucol_getUCAVersion(const UCollator *coll, UVersionInfo info)
Gets the UCA version information for a Collator.
ucol_strcoll
UCollationResult ucol_strcoll(const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
Compare two strings.
UCOL_BOUND_UPPER_LONG
upper bound that will match all the strings that have the same initial substring as the given string ...
Definition: ucol.h:1065
ucol_getSortKey
int32_t ucol_getSortKey(const UCollator *coll, const UChar *source, int32_t sourceLength, uint8_t *result, int32_t resultLength)
Get a sort key for a string from a UCollator.
UCOL_ATTRIBUTE_VALUE_COUNT
One more than the highest normal UColAttributeValue value.
Definition: ucol.h:133
UCOL_BOUND_LOWER
lower bound
Definition: ucol.h:1061
UCOL_CASE_FIRST
Controls the ordering of upper and lower case letters.
Definition: ucol.h:269
ucol_getReorderCodes
int32_t ucol_getReorderCodes(const UCollator *coll, int32_t *dest, int32_t destCapacity, UErrorCode *pErrorCode)
Retrieves the reordering codes for this collator.
UCollationResult
UCollationResult
UCOL_LESS is returned if source string is compared to be less than target string in the ucol_strcoll(...
Definition: ucol.h:73
UCOL_TAILORING_ONLY
Retrieves the tailoring rules only.
Definition: ucol.h:365
ucol_getEquivalentReorderCodes
int32_t ucol_getEquivalentReorderCodes(int32_t reorderCode, int32_t *dest, int32_t destCapacity, UErrorCode *pErrorCode)
Retrieves the reorder codes that are grouped with the given reorder code.
ucol_setVariableTop
uint32_t ucol_setVariableTop(UCollator *coll, const UChar *varTop, int32_t len, UErrorCode *status)
Sets the variable top to the primary weight of the specified string.
UCOL_NON_IGNORABLE
Valid for UCOL_ALTERNATE_HANDLING.
Definition: ucol.h:120
UCOL_NORMALIZATION_MODE
Controls whether the normalization check and necessary normalizations are performed.
Definition: ucol.h:289
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:43
ucol_countAvailable
int32_t ucol_countAvailable(void)
Determine how many locales have collation rules available.
ucol_getContractionsAndExpansions
void ucol_getContractionsAndExpansions(const UCollator *coll, USet *contractions, USet *expansions, UBool addPrefixes, UErrorCode *status)
Get a set containing the expansions defined by the collator.
UCharIterator
C API for code unit iteration.
Definition: uiter.h:341
ucol_getTailoredSet
USet * ucol_getTailoredSet(const UCollator *coll, UErrorCode *status)
Get a Unicode set that contains all the characters and sequences tailored in this collator...
UCOL_DEFAULT
accepted by most attributes
Definition: ucol.h:91
U_INTERNAL
#define U_INTERNAL
This is used to declare a function as an internal ICU C API.
Definition: umachine.h:119
UCOL_EQUAL
string a == string b
Definition: ucol.h:75
ucol_getRulesEx
int32_t ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen)
Returns current rules.
UCollationStrength
UColAttributeValue UCollationStrength
Base letter represents a primary difference.
Definition: ucol.h:236
UCOL_REORDER_CODE_DIGIT
Characters with the digit property.
Definition: ucol.h:200
UCOL_DEFAULT_STRENGTH
Default collation strength.
Definition: ucol.h:100
UCOL_LOWER_FIRST
Valid for UCOL_CASE_FIRST - lower case sorts before upper case.
Definition: ucol.h:124
uscript.h
C API: Unicode Script Information.
uset.h
C API: Unicode Set.
UColReorderCode
UColReorderCode
Enum containing the codes for reordering segments of the collation table that are not script codes...
Definition: ucol.h:146
ucol_setReorderCodes
void ucol_setReorderCodes(UCollator *coll, const int32_t *reorderCodes, int32_t reorderCodesLength, UErrorCode *pErrorCode)
Sets the reordering codes for this collator.
UColAttribute
UColAttribute
Attributes that collation service understands.
Definition: ucol.h:242
UCOL_OFF
Turn the feature off - works for UCOL_FRENCH_COLLATION, UCOL_CASE_LEVEL, UCOL_HIRAGANA_QUATERNARY_MOD...
Definition: ucol.h:111
U_DEPRECATED
#define U_DEPRECATED
This is used to declare a function as a deprecated public ICU C API.
Definition: umachine.h:115
ucol_getVariableTop
uint32_t ucol_getVariableTop(const UCollator *coll, UErrorCode *status)
Gets the variable top value of a Collator.
ucol_openAvailableLocales
UEnumeration * ucol_openAvailableLocales(UErrorCode *status)
Create a string enumerator of all locales for which a valid collator may be opened.
UCOL_REORDER_CODE_NONE
A special reordering code that is used to specify no reordering codes.
Definition: ucol.h:157
UCOL_BOUND_UPPER
upper bound that will match strings of exact size
Definition: ucol.h:1063
UCOL_FRENCH_COLLATION
Attribute for direction of secondary weights - used in Canadian French.
Definition: ucol.h:249
UCOL_STRENGTH
The strength attribute.
Definition: ucol.h:310
UCOL_NUMERIC_COLLATION
When turned on, this attribute makes substrings of digits sort according to their numeric values...
Definition: ucol.h:343
ucol_cloneBinary
int32_t ucol_cloneBinary(const UCollator *coll, uint8_t *buffer, int32_t capacity, UErrorCode *status)
Creates a binary image of a collator.
UCOL_SECONDARY
Secondary collation strength.
Definition: ucol.h:96
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:550
ucol_restoreVariableTop
void ucol_restoreVariableTop(UCollator *coll, const uint32_t varTop, UErrorCode *status)
Sets the variable top to the specified primary weight.
UCOL_HIRAGANA_QUATERNARY_MODE
When turned on, this attribute positions Hiragana before all non-ignorables on quaternary level This ...
Definition: ucol.h:323
UCOL_CASE_LEVEL
Controls whether an extra case level (positioned before the third level) is generated or not...
Definition: ucol.h:279
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
ucol_mergeSortkeys
int32_t ucol_mergeSortkeys(const uint8_t *src1, int32_t src1Length, const uint8_t *src2, int32_t src2Length, uint8_t *dest, int32_t destCapacity)
Merges two sort keys.
unorm.h
C API: Unicode Normalization.
ucol_getContractions
int32_t ucol_getContractions(const UCollator *coll, USet *conts, UErrorCode *status)
Get a set containing the contractions defined by the collator.
UCOL_UPPER_FIRST
upper case sorts before lower case
Definition: ucol.h:126
UCOL_REORDER_CODE_FIRST
The first entry in the enumeration of reordering groups.
Definition: ucol.h:176
ucol_nextSortKeyPart
int32_t ucol_nextSortKeyPart(const UCollator *coll, UCharIterator *iter, uint32_t state[2], uint8_t *dest, int32_t count, UErrorCode *status)
Gets the next count bytes of a sort key.
ucol_openBinary
UCollator * ucol_openBinary(const uint8_t *bin, int32_t length, const UCollator *base, UErrorCode *status)
Opens a collator from a collator binary image created using ucol_cloneBinary.
ucol_prepareShortStringOpen
void ucol_prepareShortStringOpen(const char *definition, UBool forceDefaults, UParseError *parseError, UErrorCode *status)
Touches all resources needed for instantiating a collator from a short string definition, thus filling up the cache.
ucol_getAvailable
const char * ucol_getAvailable(int32_t localeIndex)
Get a locale for which collation rules are available.
ucol_close
void ucol_close(UCollator *coll)
Close a UCollator.
UCOL_TERTIARY
Tertiary collation strength.
Definition: ucol.h:98
ucol_strcollIter
UCollationResult ucol_strcollIter(const UCollator *coll, UCharIterator *sIter, UCharIterator *tIter, UErrorCode *status)
Compare two UTF-8 encoded trings.
ucol_getDisplayName
int32_t ucol_getDisplayName(const char *objLoc, const char *dispLoc, UChar *result, int32_t resultLength, UErrorCode *status)
Get the display name for a UCollator.
ucol_getKeywordValuesForLocale
UEnumeration * ucol_getKeywordValuesForLocale(const char *key, const char *locale, UBool commonlyUsed, UErrorCode *status)
Given a key and a locale, returns an array of string values in a preferred order that would make a di...
UCOL_REORDER_CODE_DEFAULT
A special reordering code that is used to specify the default reordering codes for a locale...
Definition: ucol.h:152
ucol_getLocale
const char * ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status)
gets the locale name of the collator.
ucol_getVersion
void ucol_getVersion(const UCollator *coll, UVersionInfo info)
Gets the version information for a Collator.
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:376
ucol_greaterOrEqual
UBool ucol_greaterOrEqual(const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
Determine if one string is greater than or equal to another.
UCOL_GREATER
string a > string b
Definition: ucol.h:77
parseerr.h
C API: Parse Error Information.
ucol_normalizeShortDefinitionString
int32_t ucol_normalizeShortDefinitionString(const char *source, char *destination, int32_t capacity, UParseError *parseError, UErrorCode *status)
Verifies and normalizes short definition string.
ucol_openRules
UCollator * ucol_openRules(const UChar *rules, int32_t rulesLength, UColAttributeValue normalizationMode, UCollationStrength strength, UParseError *parseError, UErrorCode *status)
Produce a UCollator instance according to the rules supplied.
ucol_getShortDefinitionString
int32_t ucol_getShortDefinitionString(const UCollator *coll, const char *locale, char *buffer, int32_t capacity, UErrorCode *status)
Get the short definition string for a collator.
USCRIPT_UNKNOWN
Definition: uscript.h:287
ucol_greater
UBool ucol_greater(const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
Determine if one string is greater than another.
ucol_setAttribute
void ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value, UErrorCode *status)
Universal attribute setter.
UCOL_BOUND_VALUE_COUNT
One more than the highest normal UColBoundMode value.
Definition: ucol.h:1071
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
ULocDataLocaleType
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested...
Definition: uloc.h:338
USet
struct USet USet
USet is the C API type corresponding to C++ class UnicodeSet.
Definition: uset.h:47
ucol_getUnsafeSet
int32_t ucol_getUnsafeSet(const UCollator *coll, USet *unsafe, UErrorCode *status)
Calculates the set of unsafe code points, given a collator.
ucol_getKeywordValues
UEnumeration * ucol_getKeywordValues(const char *keyword, UErrorCode *status)
Given a keyword, create a string enumeration of all values for that keyword that are currently in use...
ucol_getLocaleByType
const char * ucol_getLocaleByType(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status)
gets the locale name of the collator.
ucol_getFunctionalEquivalent
int32_t ucol_getFunctionalEquivalent(char *result, int32_t resultCapacity, const char *keyword, const char *locale, UBool *isAvailable, UErrorCode *status)
Return the functionally equivalent locale for the specified input locale, with respect to given keywo...
UCOL_REORDER_CODE_PUNCTUATION
Characters with the punctuation property.
Definition: ucol.h:182
UColBoundMode
UColBoundMode
enum that is taken by ucol_getBound API See below for explanation do not change the values assigned t...
Definition: ucol.h:1059
ucol_setStrength
void ucol_setStrength(UCollator *coll, UCollationStrength strength)
Set the collation strength used in a UCollator.
ucol_strcollUTF8
UCollationResult ucol_strcollUTF8(const UCollator *coll, const char *source, int32_t sourceLength, const char *target, int32_t targetLength, UErrorCode *status)
Compare two strings in UTF-8.
UCollator
struct UCollator UCollator
structure representing a collator object instance
Definition: ucol.h:58
ucol_getMaxVariable
UColReorderCode ucol_getMaxVariable(const UCollator *coll)
Returns the maximum reordering group whose characters are affected by UCOL_ALTERNATE_HANDLING.
UCOL_SHIFTED
Valid for UCOL_ALTERNATE_HANDLING.
Definition: ucol.h:118
UParseError
A UParseError struct is used to returned detailed information about parsing errors.
Definition: parseerr.h:58
ucol_safeClone
UCollator * ucol_safeClone(const UCollator *coll, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
Thread safe cloning operation.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
ucol_getBound
int32_t ucol_getBound(const uint8_t *source, int32_t sourceLength, UColBoundMode boundType, uint32_t noOfLevels, uint8_t *result, int32_t resultLength, UErrorCode *status)
Produce a bound for a given sortkey and a number of levels.
UCOL_IDENTICAL
Identical collation strength.
Definition: ucol.h:105
ucol_openFromShortString
UCollator * ucol_openFromShortString(const char *definition, UBool forceDefaults, UParseError *parseError, UErrorCode *status)
Open a collator defined by a short form string.
UCOL_QUATERNARY
Quaternary collation strength.
Definition: ucol.h:103
UCOL_ALTERNATE_HANDLING
Attribute for handling variable elements.
Definition: ucol.h:260
UCOL_DECOMPOSITION_MODE
An alias for UCOL_NORMALIZATION_MODE attribute.
Definition: ucol.h:293
UColAttributeValue
UColAttributeValue
Enum containing attribute values for controling collation behavior.
Definition: ucol.h:89
ucol_getKeywords
UEnumeration * ucol_getKeywords(UErrorCode *status)
Create a string enumerator of all possible keywords that are relevant to collation.
ucol_open
UCollator * ucol_open(const char *loc, UErrorCode *status)
Open a UCollator for comparing strings.
UCOL_REORDER_CODE_SPACE
Characters with the space property.
Definition: ucol.h:170
UColRuleOption
UColRuleOption
Options for retrieving the rule string.
Definition: ucol.h:359
UCOL_ATTRIBUTE_COUNT
One more than the highest normal UColAttribute value.
Definition: ucol.h:352
ucol_getStrength
UCollationStrength ucol_getStrength(const UCollator *coll)
Get the collation strength used in a UCollator.
UCOL_PRIMARY
Primary collation strength.
Definition: ucol.h:94
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:261
UCOL_REORDER_CODE_LIMIT
One more than the highest normal UColReorderCode value.
Definition: ucol.h:206
uloc.h
C API: Locale.