ICU 54.1  54.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ucol.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (c) 1996-2014, International Business Machines Corporation and others.
4 * All Rights Reserved.
5 *******************************************************************************
6 */
7 
8 #ifndef UCOL_H
9 #define UCOL_H
10 
11 #include "unicode/utypes.h"
12 
13 #if !UCONFIG_NO_COLLATION
14 
15 #include "unicode/unorm.h"
16 #include "unicode/localpointer.h"
17 #include "unicode/parseerr.h"
18 #include "unicode/uloc.h"
19 #include "unicode/uset.h"
20 #include "unicode/uscript.h"
21 
52 struct UCollator;
56 typedef struct UCollator UCollator;
57 
58 
71 typedef enum {
77  UCOL_LESS = -1
79 
80 
87 typedef enum {
90 
99  UCOL_CE_STRENGTH_LIMIT,
104  UCOL_STRENGTH_LIMIT,
105 
109  UCOL_OFF = 16,
113  UCOL_ON = 17,
114 
119 
125 
126  UCOL_ATTRIBUTE_VALUE_COUNT
127 
129 
139  typedef enum {
201 
229 
234 typedef enum {
303 #ifndef U_HIDE_DEPRECATED_API
304 
316 #endif /* U_HIDE_DEPRECATED_API */
317 
341 } UColAttribute;
342 
346 typedef enum {
361 } UColRuleOption ;
362 
388 U_STABLE UCollator* U_EXPORT2
389 ucol_open(const char *loc, UErrorCode *status);
390 
416 U_STABLE UCollator* U_EXPORT2
417 ucol_openRules( const UChar *rules,
418  int32_t rulesLength,
419  UColAttributeValue normalizationMode,
420  UCollationStrength strength,
421  UParseError *parseError,
422  UErrorCode *status);
423 
424 #ifndef U_HIDE_DEPRECATED_API
425 
458 U_DEPRECATED UCollator* U_EXPORT2
459 ucol_openFromShortString( const char *definition,
460  UBool forceDefaults,
461  UParseError *parseError,
462  UErrorCode *status);
463 #endif /* U_HIDE_DEPRECATED_API */
464 
465 #ifndef U_HIDE_DEPRECATED_API
466 
479 U_DEPRECATED int32_t U_EXPORT2
480 ucol_getContractions( const UCollator *coll,
481  USet *conts,
482  UErrorCode *status);
483 #endif /* U_HIDE_DEPRECATED_API */
484 
496 U_STABLE void U_EXPORT2
498  USet *contractions, USet *expansions,
499  UBool addPrefixes, UErrorCode *status);
500 
511 U_STABLE void U_EXPORT2
512 ucol_close(UCollator *coll);
513 
514 #if U_SHOW_CPLUSPLUS_API
515 
517 
528 
530 
531 #endif
532 
548 U_STABLE UCollationResult U_EXPORT2
549 ucol_strcoll( const UCollator *coll,
550  const UChar *source,
551  int32_t sourceLength,
552  const UChar *target,
553  int32_t targetLength);
554 
573 U_STABLE UCollationResult U_EXPORT2
575  const UCollator *coll,
576  const char *source,
577  int32_t sourceLength,
578  const char *target,
579  int32_t targetLength,
580  UErrorCode *status);
581 
596 U_STABLE UBool U_EXPORT2
597 ucol_greater(const UCollator *coll,
598  const UChar *source, int32_t sourceLength,
599  const UChar *target, int32_t targetLength);
600 
615 U_STABLE UBool U_EXPORT2
616 ucol_greaterOrEqual(const UCollator *coll,
617  const UChar *source, int32_t sourceLength,
618  const UChar *target, int32_t targetLength);
619 
634 U_STABLE UBool U_EXPORT2
635 ucol_equal(const UCollator *coll,
636  const UChar *source, int32_t sourceLength,
637  const UChar *target, int32_t targetLength);
638 
651 U_STABLE UCollationResult U_EXPORT2
652 ucol_strcollIter( const UCollator *coll,
653  UCharIterator *sIter,
654  UCharIterator *tIter,
655  UErrorCode *status);
656 
666 U_STABLE UCollationStrength U_EXPORT2
667 ucol_getStrength(const UCollator *coll);
668 
678 U_STABLE void U_EXPORT2
680  UCollationStrength strength);
681 
698 U_STABLE int32_t U_EXPORT2
699 ucol_getReorderCodes(const UCollator* coll,
700  int32_t* dest,
701  int32_t destCapacity,
702  UErrorCode *pErrorCode);
738 U_STABLE void U_EXPORT2
740  const int32_t* reorderCodes,
741  int32_t reorderCodesLength,
742  UErrorCode *pErrorCode);
743 
760 U_STABLE int32_t U_EXPORT2
761 ucol_getEquivalentReorderCodes(int32_t reorderCode,
762  int32_t* dest,
763  int32_t destCapacity,
764  UErrorCode *pErrorCode);
765 
778 U_STABLE int32_t U_EXPORT2
779 ucol_getDisplayName( const char *objLoc,
780  const char *dispLoc,
781  UChar *result,
782  int32_t resultLength,
783  UErrorCode *status);
784 
794 U_STABLE const char* U_EXPORT2
795 ucol_getAvailable(int32_t localeIndex);
796 
805 U_STABLE int32_t U_EXPORT2
806 ucol_countAvailable(void);
807 
808 #if !UCONFIG_NO_SERVICE
809 
817 U_STABLE UEnumeration* U_EXPORT2
819 #endif
820 
830 U_STABLE UEnumeration* U_EXPORT2
832 
844 U_STABLE UEnumeration* U_EXPORT2
845 ucol_getKeywordValues(const char *keyword, UErrorCode *status);
846 
863 U_STABLE UEnumeration* U_EXPORT2
864 ucol_getKeywordValuesForLocale(const char* key,
865  const char* locale,
866  UBool commonlyUsed,
867  UErrorCode* status);
868 
900 U_STABLE int32_t U_EXPORT2
901 ucol_getFunctionalEquivalent(char* result, int32_t resultCapacity,
902  const char* keyword, const char* locale,
903  UBool* isAvailable, UErrorCode* status);
904 
913 U_STABLE const UChar* U_EXPORT2
914 ucol_getRules( const UCollator *coll,
915  int32_t *length);
916 
917 #ifndef U_HIDE_DEPRECATED_API
918 
938 U_DEPRECATED int32_t U_EXPORT2
940  const char *locale,
941  char *buffer,
942  int32_t capacity,
943  UErrorCode *status);
944 
965 U_DEPRECATED int32_t U_EXPORT2
966 ucol_normalizeShortDefinitionString(const char *source,
967  char *destination,
968  int32_t capacity,
969  UParseError *parseError,
970  UErrorCode *status);
971 #endif /* U_HIDE_DEPRECATED_API */
972 
973 
996 U_STABLE int32_t U_EXPORT2
997 ucol_getSortKey(const UCollator *coll,
998  const UChar *source,
999  int32_t sourceLength,
1000  uint8_t *result,
1001  int32_t resultLength);
1002 
1003 
1024 U_STABLE int32_t U_EXPORT2
1025 ucol_nextSortKeyPart(const UCollator *coll,
1026  UCharIterator *iter,
1027  uint32_t state[2],
1028  uint8_t *dest, int32_t count,
1029  UErrorCode *status);
1030 
1038 typedef enum {
1045  UCOL_BOUND_VALUE_COUNT
1046 } UColBoundMode;
1047 
1085 U_STABLE int32_t U_EXPORT2
1086 ucol_getBound(const uint8_t *source,
1087  int32_t sourceLength,
1088  UColBoundMode boundType,
1089  uint32_t noOfLevels,
1090  uint8_t *result,
1091  int32_t resultLength,
1092  UErrorCode *status);
1093 
1102 U_STABLE void U_EXPORT2
1103 ucol_getVersion(const UCollator* coll, UVersionInfo info);
1104 
1112 U_STABLE void U_EXPORT2
1113 ucol_getUCAVersion(const UCollator* coll, UVersionInfo info);
1114 
1162 U_STABLE int32_t U_EXPORT2
1163 ucol_mergeSortkeys(const uint8_t *src1, int32_t src1Length,
1164  const uint8_t *src2, int32_t src2Length,
1165  uint8_t *dest, int32_t destCapacity);
1166 
1178 U_STABLE void U_EXPORT2
1180 
1192 U_STABLE UColAttributeValue U_EXPORT2
1193 ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status);
1194 
1195 #ifndef U_HIDE_DRAFT_API
1196 
1213 U_DRAFT void U_EXPORT2
1214 ucol_setMaxVariable(UCollator *coll, UColReorderCode group, UErrorCode *pErrorCode);
1215 
1223 U_DRAFT UColReorderCode U_EXPORT2
1224 ucol_getMaxVariable(const UCollator *coll);
1225 
1226 #endif /* U_HIDE_DRAFT_API */
1227 
1228 #ifndef U_HIDE_DEPRECATED_API
1229 
1249 U_DEPRECATED uint32_t U_EXPORT2
1251  const UChar *varTop, int32_t len,
1252  UErrorCode *status);
1253 #endif /* U_HIDE_DEPRECATED_API */
1254 
1266 U_STABLE uint32_t U_EXPORT2 ucol_getVariableTop(const UCollator *coll, UErrorCode *status);
1267 
1281 U_DEPRECATED void U_EXPORT2
1282 ucol_restoreVariableTop(UCollator *coll, const uint32_t varTop, UErrorCode *status);
1283 
1307 U_STABLE UCollator* U_EXPORT2
1308 ucol_safeClone(const UCollator *coll,
1309  void *stackBuffer,
1310  int32_t *pBufferSize,
1311  UErrorCode *status);
1312 
1313 #ifndef U_HIDE_DEPRECATED_API
1314 
1318 #define U_COL_SAFECLONE_BUFFERSIZE 1
1319 
1320 #endif /* U_HIDE_DEPRECATED_API */
1321 
1337 U_STABLE int32_t U_EXPORT2
1338 ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen);
1339 
1340 #ifndef U_HIDE_DEPRECATED_API
1341 
1355 U_DEPRECATED const char * U_EXPORT2
1356 ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
1357 #endif /* U_HIDE_DEPRECATED_API */
1358 
1373 U_STABLE const char * U_EXPORT2
1374 ucol_getLocaleByType(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
1375 
1386 U_STABLE USet * U_EXPORT2
1387 ucol_getTailoredSet(const UCollator *coll, UErrorCode *status);
1388 
1389 #ifndef U_HIDE_INTERNAL_API
1390 
1401 U_INTERNAL int32_t U_EXPORT2
1402 ucol_getUnsafeSet( const UCollator *coll,
1403  USet *unsafe,
1404  UErrorCode *status);
1405 
1426 U_INTERNAL void U_EXPORT2
1427 ucol_prepareShortStringOpen( const char *definition,
1428  UBool forceDefaults,
1429  UParseError *parseError,
1430  UErrorCode *status);
1431 #endif /* U_HIDE_INTERNAL_API */
1432 
1444 U_STABLE int32_t U_EXPORT2
1445 ucol_cloneBinary(const UCollator *coll,
1446  uint8_t *buffer, int32_t capacity,
1447  UErrorCode *status);
1448 
1466 U_STABLE UCollator* U_EXPORT2
1467 ucol_openBinary(const uint8_t *bin, int32_t length,
1468  const UCollator *base,
1469  UErrorCode *status);
1470 
1471 
1472 #endif /* #if !UCONFIG_NO_COLLATION */
1473 
1474 #endif