00001
00002
00003
00004
00005
00006
00007
00008
#ifndef UCOL_H
00009
#define UCOL_H
00010
00011
#include "unicode/utypes.h"
00012
00013
#if !UCONFIG_NO_COLLATION
00014
00015
#include "unicode/unorm.h"
00016
#include "unicode/parseerr.h"
00017
#include "unicode/uloc.h"
00018
#include "unicode/uset.h"
00019
00056
struct collIterate;
00060
typedef struct collIterate collIterate;
00061
00065
struct UCollator;
00069
typedef struct UCollator UCollator;
00070
00071
00084
typedef enum {
00086
UCOL_EQUAL = 0,
00088
UCOL_GREATER = 1,
00090
UCOL_LESS = -1
00091 }
UCollationResult ;
00092
00093
00100
typedef enum {
00102
UCOL_DEFAULT = -1,
00103
00105
UCOL_PRIMARY = 0,
00107
UCOL_SECONDARY = 1,
00109
UCOL_TERTIARY = 2,
00111
UCOL_DEFAULT_STRENGTH =
UCOL_TERTIARY,
00112
UCOL_CE_STRENGTH_LIMIT,
00114
UCOL_QUATERNARY=3,
00116
UCOL_IDENTICAL=15,
00117
UCOL_STRENGTH_LIMIT,
00118
00122
UCOL_OFF = 16,
00126
UCOL_ON = 17,
00127
00129
UCOL_SHIFTED = 20,
00131
UCOL_NON_IGNORABLE = 21,
00132
00135
UCOL_LOWER_FIRST = 24,
00137
UCOL_UPPER_FIRST = 25,
00138
00139
UCOL_ATTRIBUTE_VALUE_COUNT
00140
00141 }
UColAttributeValue;
00142
00169
typedef UColAttributeValue UCollationStrength;
00170
00175
typedef enum {
00180
UCOL_FRENCH_COLLATION,
00189
UCOL_ALTERNATE_HANDLING,
00196
UCOL_CASE_FIRST,
00204
UCOL_CASE_LEVEL,
00212
UCOL_NORMALIZATION_MODE,
00214
UCOL_DECOMPOSITION_MODE =
UCOL_NORMALIZATION_MODE,
00225
UCOL_STRENGTH,
00231
UCOL_HIRAGANA_QUATERNARY_MODE,
00237
UCOL_NUMERIC_COLLATION,
00238
UCOL_ATTRIBUTE_COUNT
00239 }
UColAttribute;
00240
00244
typedef enum {
00246
UCOL_TAILORING_ONLY,
00248
UCOL_FULL_RULES
00249 }
UColRuleOption ;
00250
00268
U_STABLE UCollator*
U_EXPORT2
00269
ucol_open(
const char *loc, UErrorCode *status);
00270
00296
U_STABLE UCollator*
U_EXPORT2
00297
ucol_openRules(
const UChar *rules,
00298 int32_t rulesLength,
00299 UColAttributeValue normalizationMode,
00300 UCollationStrength strength,
00301
UParseError *parseError,
00302 UErrorCode *status);
00303
00338
U_CAPI UCollator*
U_EXPORT2
00339
ucol_openFromShortString(
const char *definition,
00340 UBool forceDefaults,
00341
UParseError *parseError,
00342 UErrorCode *status);
00343
00357
U_CAPI int32_t U_EXPORT2
00358
ucol_getContractions(
const UCollator *coll,
00359 USet *conts,
00360 UErrorCode *status);
00361
00362
00373
U_STABLE void U_EXPORT2
00374
ucol_close(UCollator *coll);
00375
00391
U_STABLE UCollationResult U_EXPORT2
00392
ucol_strcoll(
const UCollator *coll,
00393
const UChar *source,
00394 int32_t sourceLength,
00395
const UChar *target,
00396 int32_t targetLength);
00397
00412
U_STABLE UBool U_EXPORT2
00413
ucol_greater(
const UCollator *coll,
00414
const UChar *source, int32_t sourceLength,
00415
const UChar *target, int32_t targetLength);
00416
00431
U_STABLE UBool U_EXPORT2
00432
ucol_greaterOrEqual(
const UCollator *coll,
00433
const UChar *source, int32_t sourceLength,
00434
const UChar *target, int32_t targetLength);
00435
00450
U_STABLE UBool U_EXPORT2
00451
ucol_equal(
const UCollator *coll,
00452
const UChar *source, int32_t sourceLength,
00453
const UChar *target, int32_t targetLength);
00454
00467
U_DRAFT UCollationResult U_EXPORT2
00468
ucol_strcollIter(
const UCollator *coll,
00469
UCharIterator *sIter,
00470
UCharIterator *tIter,
00471 UErrorCode *status);
00472
00482
U_STABLE UCollationStrength U_EXPORT2
00483
ucol_getStrength(
const UCollator *coll);
00484
00494
U_STABLE void U_EXPORT2
00495
ucol_setStrength(UCollator *coll,
00496 UCollationStrength strength);
00497
00510
U_STABLE int32_t U_EXPORT2
00511
ucol_getDisplayName(
const char *objLoc,
00512
const char *dispLoc,
00513 UChar *result,
00514 int32_t resultLength,
00515 UErrorCode *status);
00516
00526
U_STABLE const char*
U_EXPORT2
00527
ucol_getAvailable(int32_t index);
00528
00537
U_STABLE int32_t U_EXPORT2
00538
ucol_countAvailable(
void);
00539
00548
U_DRAFT UEnumeration*
U_EXPORT2
00549
ucol_openAvailableLocales(UErrorCode *status);
00550
00560
U_DRAFT UEnumeration*
U_EXPORT2
00561
ucol_getKeywords(UErrorCode *status);
00562
00574
U_DRAFT UEnumeration*
U_EXPORT2
00575
ucol_getKeywordValues(
const char *keyword, UErrorCode *status);
00576
00607
U_DRAFT int32_t U_EXPORT2
00608
ucol_getFunctionalEquivalent(
char* result, int32_t resultCapacity,
00609
const char* keyword,
const char* locale,
00610 UBool* isAvailable, UErrorCode* status);
00611
00620
U_STABLE const UChar*
U_EXPORT2
00621
ucol_getRules(
const UCollator *coll,
00622 int32_t *length);
00623
00644
U_CAPI int32_t U_EXPORT2
00645
ucol_getShortDefinitionString(
const UCollator *coll,
00646
const char *locale,
00647
char *buffer,
00648 int32_t capacity,
00649 UErrorCode *status);
00650
00671
U_CAPI int32_t U_EXPORT2
00672
ucol_normalizeShortDefinitionString(
const char *source,
00673
char *destination,
00674 int32_t capacity,
00675
UParseError *parseError,
00676 UErrorCode *status);
00677
00678
00691
U_STABLE int32_t U_EXPORT2
00692
ucol_getSortKey(
const UCollator *coll,
00693
const UChar *source,
00694 int32_t sourceLength,
00695 uint8_t *result,
00696 int32_t resultLength);
00697
00698
00719
U_DRAFT int32_t U_EXPORT2
00720
ucol_nextSortKeyPart(
const UCollator *coll,
00721
UCharIterator *iter,
00722 uint32_t state[2],
00723 uint8_t *dest, int32_t count,
00724 UErrorCode *status);
00725
00733
typedef enum {
00735
UCOL_BOUND_LOWER = 0,
00737
UCOL_BOUND_UPPER = 1,
00739
UCOL_BOUND_UPPER_LONG = 2,
00740
UCOL_BOUND_VALUE_COUNT
00741 }
UColBoundMode;
00742
00780
U_STABLE int32_t U_EXPORT2
00781
ucol_getBound(
const uint8_t *source,
00782 int32_t sourceLength,
00783 UColBoundMode boundType,
00784 uint32_t noOfLevels,
00785 uint8_t *result,
00786 int32_t resultLength,
00787 UErrorCode *status);
00788
00797
U_STABLE void U_EXPORT2
00798
ucol_getVersion(
const UCollator* coll, UVersionInfo info);
00799
00807
U_DRAFT void U_EXPORT2
00808
ucol_getUCAVersion(
const UCollator* coll, UVersionInfo info);
00809
00832
U_STABLE int32_t U_EXPORT2
00833
ucol_mergeSortkeys(
const uint8_t *src1, int32_t src1Length,
00834
const uint8_t *src2, int32_t src2Length,
00835 uint8_t *dest, int32_t destCapacity);
00836
00848
U_STABLE void U_EXPORT2
00849
ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value, UErrorCode *status);
00850
00862
U_STABLE UColAttributeValue U_EXPORT2
00863
ucol_getAttribute(
const UCollator *coll, UColAttribute attr, UErrorCode *status);
00864
00884
U_STABLE uint32_t U_EXPORT2
00885
ucol_setVariableTop(UCollator *coll,
00886
const UChar *varTop, int32_t len,
00887 UErrorCode *status);
00888
00900
U_STABLE uint32_t U_EXPORT2 ucol_getVariableTop(
const UCollator *coll, UErrorCode *status);
00901
00913
U_STABLE void U_EXPORT2
00914
ucol_restoreVariableTop(UCollator *coll,
const uint32_t varTop, UErrorCode *status);
00915
00938
U_STABLE UCollator*
U_EXPORT2
00939
ucol_safeClone(
const UCollator *coll,
00940
void *stackBuffer,
00941 int32_t *pBufferSize,
00942 UErrorCode *status);
00943
00947
#define U_COL_SAFECLONE_BUFFERSIZE 512
00948
00960
U_STABLE int32_t U_EXPORT2
00961
ucol_getRulesEx(
const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen);
00962
00977
U_DEPRECATED const char *
U_EXPORT2
00978
ucol_getLocale(
const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
00979
00980
00995
U_DRAFT const char *
U_EXPORT2
00996
ucol_getLocaleByType(
const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
00997
01008
U_STABLE USet *
U_EXPORT2
01009
ucol_getTailoredSet(
const UCollator *coll, UErrorCode *status);
01010
01016
#define UCOL_SIT_COLLATOR_NOT_ENCODABLE 0x80000000
01017
01031
U_INTERNAL uint32_t U_EXPORT2
01032
ucol_collatorToIdentifier(
const UCollator *coll,
01033
const char *locale,
01034 UErrorCode *status);
01035
01052
U_INTERNAL UCollator*
U_EXPORT2
01053
ucol_openFromIdentifier(uint32_t identifier,
01054 UBool forceDefaults,
01055 UErrorCode *status);
01056
01057
01074
U_INTERNAL int32_t U_EXPORT2
01075
ucol_identifierToShortString(uint32_t identifier,
01076
char *buffer,
01077 int32_t capacity,
01078 UBool forceDefaults,
01079 UErrorCode *status);
01080
01095
U_INTERNAL uint32_t U_EXPORT2
01096
ucol_shortStringToIdentifier(
const char *definition,
01097 UBool forceDefaults,
01098 UErrorCode *status);
01099
01100
01101
01113
U_INTERNAL UColAttributeValue U_EXPORT2
01114
ucol_getAttributeOrDefault(
const UCollator *coll, UColAttribute attr, UErrorCode *status);
01115
01124
U_INTERNAL UBool U_EXPORT2
01125
ucol_equals(
const UCollator *source,
const UCollator *target);
01126
01134
U_INTERNAL int32_t U_EXPORT2
01135
ucol_getUnsafeSet(
const UCollator *coll,
01136 USet *unsafe,
01137 UErrorCode *status);
01138
01139
#endif
01140
01141
#endif
01142