ICU 4.8.1.1  4.8.1.1
 All Data Structures 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-2011, 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 
144  typedef enum {
199 
227 
232 typedef enum {
295  UCOL_ATTRIBUTE_COUNT
296 } UColAttribute;
297 
301 typedef enum {
306 } UColRuleOption ;
307 
326 ucol_open(const char *loc, UErrorCode *status);
327 
354 ucol_openRules( const UChar *rules,
355  int32_t rulesLength,
356  UColAttributeValue normalizationMode,
357  UCollationStrength strength,
358  UParseError *parseError,
359  UErrorCode *status);
360 
396 ucol_openFromShortString( const char *definition,
397  UBool forceDefaults,
398  UParseError *parseError,
399  UErrorCode *status);
400 
414 U_DEPRECATED int32_t U_EXPORT2
415 ucol_getContractions( const UCollator *coll,
416  USet *conts,
417  UErrorCode *status);
418 
430 U_STABLE void U_EXPORT2
432  USet *contractions, USet *expansions,
433  UBool addPrefixes, UErrorCode *status);
434 
445 U_STABLE void U_EXPORT2
446 ucol_close(UCollator *coll);
447 
448 #if U_SHOW_CPLUSPLUS_API
449 
451 
461 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCollatorPointer, UCollator, ucol_close);
462 
464 
465 #endif
466 
483 ucol_strcoll( const UCollator *coll,
484  const UChar *source,
485  int32_t sourceLength,
486  const UChar *target,
487  int32_t targetLength);
488 
504 ucol_greater(const UCollator *coll,
505  const UChar *source, int32_t sourceLength,
506  const UChar *target, int32_t targetLength);
507 
523 ucol_greaterOrEqual(const UCollator *coll,
524  const UChar *source, int32_t sourceLength,
525  const UChar *target, int32_t targetLength);
526 
542 ucol_equal(const UCollator *coll,
543  const UChar *source, int32_t sourceLength,
544  const UChar *target, int32_t targetLength);
545 
559 ucol_strcollIter( const UCollator *coll,
560  UCharIterator *sIter,
561  UCharIterator *tIter,
562  UErrorCode *status);
563 
574 ucol_getStrength(const UCollator *coll);
575 
585 U_STABLE void U_EXPORT2
587  UCollationStrength strength);
588 
603 U_DRAFT int32_t U_EXPORT2
604 ucol_getReorderCodes(const UCollator* coll,
605  int32_t* dest,
606  int32_t destCapacity,
607  UErrorCode *pErrorCode);
641 U_DRAFT void U_EXPORT2
643  const int32_t* reorderCodes,
644  int32_t reorderCodesLength,
645  UErrorCode *pErrorCode);
646 
661 U_DRAFT int32_t U_EXPORT2
662 ucol_getEquivalentReorderCodes(int32_t reorderCode,
663  int32_t* dest,
664  int32_t destCapacity,
665  UErrorCode *pErrorCode);
666 
679 U_STABLE int32_t U_EXPORT2
680 ucol_getDisplayName( const char *objLoc,
681  const char *dispLoc,
682  UChar *result,
683  int32_t resultLength,
684  UErrorCode *status);
685 
695 U_STABLE const char* U_EXPORT2
696 ucol_getAvailable(int32_t localeIndex);
697 
706 U_STABLE int32_t U_EXPORT2
707 ucol_countAvailable(void);
708 
709 #if !UCONFIG_NO_SERVICE
710 
720 #endif
721 
733 
746 ucol_getKeywordValues(const char *keyword, UErrorCode *status);
747 
765 ucol_getKeywordValuesForLocale(const char* key,
766  const char* locale,
767  UBool commonlyUsed,
768  UErrorCode* status);
769 
800 U_STABLE int32_t U_EXPORT2
801 ucol_getFunctionalEquivalent(char* result, int32_t resultCapacity,
802  const char* keyword, const char* locale,
803  UBool* isAvailable, UErrorCode* status);
804 
813 U_STABLE const UChar* U_EXPORT2
814 ucol_getRules( const UCollator *coll,
815  int32_t *length);
816 
837 U_STABLE int32_t U_EXPORT2
839  const char *locale,
840  char *buffer,
841  int32_t capacity,
842  UErrorCode *status);
843 
864 U_STABLE int32_t U_EXPORT2
865 ucol_normalizeShortDefinitionString(const char *source,
866  char *destination,
867  int32_t capacity,
868  UParseError *parseError,
869  UErrorCode *status);
870 
871 
891 U_STABLE int32_t U_EXPORT2
892 ucol_getSortKey(const UCollator *coll,
893  const UChar *source,
894  int32_t sourceLength,
895  uint8_t *result,
896  int32_t resultLength);
897 
898 
919 U_STABLE int32_t U_EXPORT2
920 ucol_nextSortKeyPart(const UCollator *coll,
921  UCharIterator *iter,
922  uint32_t state[2],
923  uint8_t *dest, int32_t count,
924  UErrorCode *status);
925 
933 typedef enum {
940  UCOL_BOUND_VALUE_COUNT
941 } UColBoundMode;
942 
980 U_STABLE int32_t U_EXPORT2
981 ucol_getBound(const uint8_t *source,
982  int32_t sourceLength,
983  UColBoundMode boundType,
984  uint32_t noOfLevels,
985  uint8_t *result,
986  int32_t resultLength,
987  UErrorCode *status);
988 
997 U_STABLE void U_EXPORT2
998 ucol_getVersion(const UCollator* coll, UVersionInfo info);
999 
1007 U_STABLE void U_EXPORT2
1008 ucol_getUCAVersion(const UCollator* coll, UVersionInfo info);
1009 
1032 U_STABLE int32_t U_EXPORT2
1033 ucol_mergeSortkeys(const uint8_t *src1, int32_t src1Length,
1034  const uint8_t *src2, int32_t src2Length,
1035  uint8_t *dest, int32_t destCapacity);
1036 
1048 U_STABLE void U_EXPORT2
1050 
1063 ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status);
1064 
1084 U_STABLE uint32_t U_EXPORT2
1086  const UChar *varTop, int32_t len,
1087  UErrorCode *status);
1088 
1100 U_STABLE uint32_t U_EXPORT2 ucol_getVariableTop(const UCollator *coll, UErrorCode *status);
1101 
1113 U_STABLE void U_EXPORT2
1114 ucol_restoreVariableTop(UCollator *coll, const uint32_t varTop, UErrorCode *status);
1115 
1139 ucol_safeClone(const UCollator *coll,
1140  void *stackBuffer,
1141  int32_t *pBufferSize,
1142  UErrorCode *status);
1143 
1147 #define U_COL_SAFECLONE_BUFFERSIZE 512
1148 
1160 U_STABLE int32_t U_EXPORT2
1161 ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen);
1162 
1177 U_DEPRECATED const char * U_EXPORT2
1178 ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
1179 
1180 
1195 U_STABLE const char * U_EXPORT2
1196 ucol_getLocaleByType(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
1197 
1209 ucol_getTailoredSet(const UCollator *coll, UErrorCode *status);
1210 
1223 ucol_getAttributeOrDefault(const UCollator *coll, UColAttribute attr, UErrorCode *status);
1224 
1234 ucol_equals(const UCollator *source, const UCollator *target);
1235 
1247 U_INTERNAL int32_t U_EXPORT2
1248 ucol_getUnsafeSet( const UCollator *coll,
1249  USet *unsafe,
1250  UErrorCode *status);
1251 
1255 U_INTERNAL void U_EXPORT2
1256 ucol_forgetUCA(void);
1257 
1278 U_INTERNAL void U_EXPORT2
1279 ucol_prepareShortStringOpen( const char *definition,
1280  UBool forceDefaults,
1281  UParseError *parseError,
1282  UErrorCode *status);
1283 
1295 U_STABLE int32_t U_EXPORT2
1296 ucol_cloneBinary(const UCollator *coll,
1297  uint8_t *buffer, int32_t capacity,
1298  UErrorCode *status);
1299 
1318 ucol_openBinary(const uint8_t *bin, int32_t length,
1319  const UCollator *base,
1320  UErrorCode *status);
1321 
1322 
1323 #endif /* #if !UCONFIG_NO_COLLATION */
1324 
1325 #endif