ICU 50.1.2  50.1.2
ucol.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (c) 1996-2012, 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 
58 struct UCollator;
62 typedef struct UCollator UCollator;
63 
64 
77 typedef enum {
83  UCOL_LESS = -1
85 
86 
93 typedef enum {
96 
105  UCOL_CE_STRENGTH_LIMIT,
110  UCOL_STRENGTH_LIMIT,
111 
115  UCOL_OFF = 16,
119  UCOL_ON = 17,
120 
125 
131 
132  UCOL_ATTRIBUTE_VALUE_COUNT
133 
135 
145  typedef enum {
207 
235 
240 typedef enum {
331 } UColAttribute;
332 
336 typedef enum {
351 } UColRuleOption ;
352 
370 U_STABLE UCollator* U_EXPORT2
371 ucol_open(const char *loc, UErrorCode *status);
372 
398 U_STABLE UCollator* U_EXPORT2
399 ucol_openRules( const UChar *rules,
400  int32_t rulesLength,
401  UColAttributeValue normalizationMode,
402  UCollationStrength strength,
403  UParseError *parseError,
404  UErrorCode *status);
405 
440 U_STABLE UCollator* U_EXPORT2
441 ucol_openFromShortString( const char *definition,
442  UBool forceDefaults,
443  UParseError *parseError,
444  UErrorCode *status);
445 
446 #ifndef U_HIDE_DEPRECATED_API
447 
460 U_DEPRECATED int32_t U_EXPORT2
461 ucol_getContractions( const UCollator *coll,
462  USet *conts,
463  UErrorCode *status);
464 #endif /* U_HIDE_DEPRECATED_API */
465 
477 U_STABLE void U_EXPORT2
479  USet *contractions, USet *expansions,
480  UBool addPrefixes, UErrorCode *status);
481 
492 U_STABLE void U_EXPORT2
493 ucol_close(UCollator *coll);
494 
495 #if U_SHOW_CPLUSPLUS_API
496 
498 
509 
511 
512 #endif
513 
529 U_STABLE UCollationResult U_EXPORT2
530 ucol_strcoll( const UCollator *coll,
531  const UChar *source,
532  int32_t sourceLength,
533  const UChar *target,
534  int32_t targetLength);
535 
554 U_DRAFT UCollationResult U_EXPORT2
556  const UCollator *coll,
557  const char *source,
558  int32_t sourceLength,
559  const char *target,
560  int32_t targetLength,
561  UErrorCode *status);
562 
577 U_STABLE UBool U_EXPORT2
578 ucol_greater(const UCollator *coll,
579  const UChar *source, int32_t sourceLength,
580  const UChar *target, int32_t targetLength);
581 
596 U_STABLE UBool U_EXPORT2
597 ucol_greaterOrEqual(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_equal(const UCollator *coll,
617  const UChar *source, int32_t sourceLength,
618  const UChar *target, int32_t targetLength);
619 
632 U_STABLE UCollationResult U_EXPORT2
633 ucol_strcollIter( const UCollator *coll,
634  UCharIterator *sIter,
635  UCharIterator *tIter,
636  UErrorCode *status);
637 
647 U_STABLE UCollationStrength U_EXPORT2
648 ucol_getStrength(const UCollator *coll);
649 
659 U_STABLE void U_EXPORT2
661  UCollationStrength strength);
662 
679 U_STABLE int32_t U_EXPORT2
680 ucol_getReorderCodes(const UCollator* coll,
681  int32_t* dest,
682  int32_t destCapacity,
683  UErrorCode *pErrorCode);
719 U_STABLE void U_EXPORT2
721  const int32_t* reorderCodes,
722  int32_t reorderCodesLength,
723  UErrorCode *pErrorCode);
724 
741 U_STABLE int32_t U_EXPORT2
742 ucol_getEquivalentReorderCodes(int32_t reorderCode,
743  int32_t* dest,
744  int32_t destCapacity,
745  UErrorCode *pErrorCode);
746 
759 U_STABLE int32_t U_EXPORT2
760 ucol_getDisplayName( const char *objLoc,
761  const char *dispLoc,
762  UChar *result,
763  int32_t resultLength,
764  UErrorCode *status);
765 
775 U_STABLE const char* U_EXPORT2
776 ucol_getAvailable(int32_t localeIndex);
777 
786 U_STABLE int32_t U_EXPORT2
787 ucol_countAvailable(void);
788 
789 #if !UCONFIG_NO_SERVICE
790 
798 U_STABLE UEnumeration* U_EXPORT2
800 #endif
801 
811 U_STABLE UEnumeration* U_EXPORT2
813 
825 U_STABLE UEnumeration* U_EXPORT2
826 ucol_getKeywordValues(const char *keyword, UErrorCode *status);
827 
844 U_STABLE UEnumeration* U_EXPORT2
845 ucol_getKeywordValuesForLocale(const char* key,
846  const char* locale,
847  UBool commonlyUsed,
848  UErrorCode* status);
849 
880 U_STABLE int32_t U_EXPORT2
881 ucol_getFunctionalEquivalent(char* result, int32_t resultCapacity,
882  const char* keyword, const char* locale,
883  UBool* isAvailable, UErrorCode* status);
884 
893 U_STABLE const UChar* U_EXPORT2
894 ucol_getRules( const UCollator *coll,
895  int32_t *length);
896 
917 U_STABLE int32_t U_EXPORT2
919  const char *locale,
920  char *buffer,
921  int32_t capacity,
922  UErrorCode *status);
923 
944 U_STABLE int32_t U_EXPORT2
945 ucol_normalizeShortDefinitionString(const char *source,
946  char *destination,
947  int32_t capacity,
948  UParseError *parseError,
949  UErrorCode *status);
950 
951 
971 U_STABLE int32_t U_EXPORT2
972 ucol_getSortKey(const UCollator *coll,
973  const UChar *source,
974  int32_t sourceLength,
975  uint8_t *result,
976  int32_t resultLength);
977 
978 
999 U_STABLE int32_t U_EXPORT2
1000 ucol_nextSortKeyPart(const UCollator *coll,
1001  UCharIterator *iter,
1002  uint32_t state[2],
1003  uint8_t *dest, int32_t count,
1004  UErrorCode *status);
1005 
1013 typedef enum {
1020  UCOL_BOUND_VALUE_COUNT
1021 } UColBoundMode;
1022 
1060 U_STABLE int32_t U_EXPORT2
1061 ucol_getBound(const uint8_t *source,
1062  int32_t sourceLength,
1063  UColBoundMode boundType,
1064  uint32_t noOfLevels,
1065  uint8_t *result,
1066  int32_t resultLength,
1067  UErrorCode *status);
1068 
1077 U_STABLE void U_EXPORT2
1078 ucol_getVersion(const UCollator* coll, UVersionInfo info);
1079 
1087 U_STABLE void U_EXPORT2
1088 ucol_getUCAVersion(const UCollator* coll, UVersionInfo info);
1089 
1112 U_STABLE int32_t U_EXPORT2
1113 ucol_mergeSortkeys(const uint8_t *src1, int32_t src1Length,
1114  const uint8_t *src2, int32_t src2Length,
1115  uint8_t *dest, int32_t destCapacity);
1116 
1128 U_STABLE void U_EXPORT2
1130 
1142 U_STABLE UColAttributeValue U_EXPORT2
1143 ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status);
1144 
1164 U_STABLE uint32_t U_EXPORT2
1166  const UChar *varTop, int32_t len,
1167  UErrorCode *status);
1168 
1180 U_STABLE uint32_t U_EXPORT2 ucol_getVariableTop(const UCollator *coll, UErrorCode *status);
1181 
1193 U_STABLE void U_EXPORT2
1194 ucol_restoreVariableTop(UCollator *coll, const uint32_t varTop, UErrorCode *status);
1195 
1218 U_STABLE UCollator* U_EXPORT2
1219 ucol_safeClone(const UCollator *coll,
1220  void *stackBuffer,
1221  int32_t *pBufferSize,
1222  UErrorCode *status);
1223 
1227 #define U_COL_SAFECLONE_BUFFERSIZE 528
1228 
1244 U_STABLE int32_t U_EXPORT2
1245 ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen);
1246 
1247 #ifndef U_HIDE_DEPRECATED_API
1248 
1262 U_DEPRECATED const char * U_EXPORT2
1263 ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
1264 #endif /* U_HIDE_DEPRECATED_API */
1265 
1280 U_STABLE const char * U_EXPORT2
1281 ucol_getLocaleByType(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
1282 
1293 U_STABLE USet * U_EXPORT2
1294 ucol_getTailoredSet(const UCollator *coll, UErrorCode *status);
1295 
1296 #ifndef U_HIDE_INTERNAL_API
1297 
1309 ucol_getAttributeOrDefault(const UCollator *coll, UColAttribute attr, UErrorCode *status);
1310 
1319 U_INTERNAL UBool U_EXPORT2
1320 ucol_equals(const UCollator *source, const UCollator *target);
1321 
1333 U_INTERNAL int32_t U_EXPORT2
1334 ucol_getUnsafeSet( const UCollator *coll,
1335  USet *unsafe,
1336  UErrorCode *status);
1337 
1341 U_INTERNAL void U_EXPORT2
1342 ucol_forgetUCA(void);
1343 
1364 U_INTERNAL void U_EXPORT2
1365 ucol_prepareShortStringOpen( const char *definition,
1366  UBool forceDefaults,
1367  UParseError *parseError,
1368  UErrorCode *status);
1369 #endif /* U_HIDE_INTERNAL_API */
1370 
1382 U_STABLE int32_t U_EXPORT2
1383 ucol_cloneBinary(const UCollator *coll,
1384  uint8_t *buffer, int32_t capacity,
1385  UErrorCode *status);
1386 
1404 U_STABLE UCollator* U_EXPORT2
1405 ucol_openBinary(const uint8_t *bin, int32_t length,
1406  const UCollator *base,
1407  UErrorCode *status);
1408 
1409 
1410 #endif /* #if !UCONFIG_NO_COLLATION */
1411 
1412 #endif