Logo Search packages:      
Sourcecode: icu version File versions

ucol.h File Reference


Detailed Description

C API: Collator.

Collator C API

The C API for Collator performs locale-sensitive string comparison. You use this service to build searching and sorting routines for natural language text. Important: The ICU collation service has been reimplemented in order to achieve better performance and UCA compliance. For details, see the collation design document.

For more information about the collation service see the users guide.

Collation service provides correct sorting orders for most locales supported in ICU. If specific data for a locale is not available, the orders eventually falls back to the UCA sort order.

Sort ordering may be customized by providing your own set of rules. For more on this subject see the Collation customization section of the users guide.

See also:
UCollationResult

UNormalizationMode

UCollationStrength

UCollationElements

Definition in file ucol.h.

#include "unicode/utypes.h"
#include "unicode/unorm.h"
#include "unicode/parseerr.h"
#include "unicode/uloc.h"
#include "unicode/uset.h"

Go to the source code of this file.

Defines

#define U_COL_SAFECLONE_BUFFERSIZE   512

Typedefs

typedef UColAttributeValue UCollationStrength
typedef struct UCollator UCollator

Enumerations

enum  UColAttribute {
  UCOL_FRENCH_COLLATION, UCOL_ALTERNATE_HANDLING, UCOL_CASE_FIRST, UCOL_CASE_LEVEL,
  UCOL_NORMALIZATION_MODE, UCOL_DECOMPOSITION_MODE = UCOL_NORMALIZATION_MODE, UCOL_STRENGTH, UCOL_HIRAGANA_QUATERNARY_MODE,
  UCOL_NUMERIC_COLLATION, UCOL_ATTRIBUTE_COUNT
}
enum  UColAttributeValue {
  UCOL_DEFAULT = -1, UCOL_PRIMARY = 0, UCOL_SECONDARY = 1, UCOL_TERTIARY = 2,
  UCOL_DEFAULT_STRENGTH = UCOL_TERTIARY, UCOL_CE_STRENGTH_LIMIT, UCOL_QUATERNARY = 3, UCOL_IDENTICAL = 15,
  UCOL_STRENGTH_LIMIT, UCOL_OFF = 16, UCOL_ON = 17, UCOL_SHIFTED = 20,
  UCOL_NON_IGNORABLE = 21, UCOL_LOWER_FIRST = 24, UCOL_UPPER_FIRST = 25, UCOL_ATTRIBUTE_VALUE_COUNT
}
enum  UColBoundMode { UCOL_BOUND_LOWER = 0, UCOL_BOUND_UPPER = 1, UCOL_BOUND_UPPER_LONG = 2, UCOL_BOUND_VALUE_COUNT }
enum  UCollationResult { UCOL_EQUAL = 0, UCOL_GREATER = 1, UCOL_LESS = -1 }
enum  UColRuleOption { UCOL_TAILORING_ONLY, UCOL_FULL_RULES }

Functions

U_STABLE int32_t U_EXPORT2 ucol_cloneBinary (const UCollator *coll, uint8_t *buffer, int32_t capacity, UErrorCode *status)
U_STABLE void U_EXPORT2 ucol_close (UCollator *coll)
U_STABLE int32_t U_EXPORT2 ucol_countAvailable (void)
U_STABLE UBool U_EXPORT2 ucol_equal (const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
U_INTERNAL UBool U_EXPORT2 ucol_equals (const UCollator *source, const UCollator *target)
U_INTERNAL void U_EXPORT2 ucol_forgetUCA (void)
U_STABLE UColAttributeValue
U_EXPORT2 
ucol_getAttribute (const UCollator *coll, UColAttribute attr, UErrorCode *status)
U_INTERNAL UColAttributeValue
U_EXPORT2 
ucol_getAttributeOrDefault (const UCollator *coll, UColAttribute attr, UErrorCode *status)
U_STABLE const char *U_EXPORT2 ucol_getAvailable (int32_t localeIndex)
U_STABLE int32_t U_EXPORT2 ucol_getBound (const uint8_t *source, int32_t sourceLength, UColBoundMode boundType, uint32_t noOfLevels, uint8_t *result, int32_t resultLength, UErrorCode *status)
U_DEPRECATED int32_t U_EXPORT2 ucol_getContractions (const UCollator *coll, USet *conts, UErrorCode *status)
U_STABLE void U_EXPORT2 ucol_getContractionsAndExpansions (const UCollator *coll, USet *contractions, USet *expansions, UBool addPrefixes, UErrorCode *status)
U_STABLE int32_t U_EXPORT2 ucol_getDisplayName (const char *objLoc, const char *dispLoc, UChar *result, int32_t resultLength, UErrorCode *status)
U_STABLE int32_t U_EXPORT2 ucol_getFunctionalEquivalent (char *result, int32_t resultCapacity, const char *keyword, const char *locale, UBool *isAvailable, UErrorCode *status)
U_STABLE UEnumeration *U_EXPORT2 ucol_getKeywords (UErrorCode *status)
U_STABLE UEnumeration *U_EXPORT2 ucol_getKeywordValues (const char *keyword, UErrorCode *status)
U_DRAFT UEnumeration *U_EXPORT2 ucol_getKeywordValuesForLocale (const char *key, const char *locale, UBool commonlyUsed, UErrorCode *status)
U_DEPRECATED const char *U_EXPORT2 ucol_getLocale (const UCollator *coll, ULocDataLocaleType type, UErrorCode *status)
U_STABLE const char *U_EXPORT2 ucol_getLocaleByType (const UCollator *coll, ULocDataLocaleType type, UErrorCode *status)
U_STABLE const UChar *U_EXPORT2 ucol_getRules (const UCollator *coll, int32_t *length)
U_STABLE int32_t U_EXPORT2 ucol_getRulesEx (const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen)
U_STABLE int32_t U_EXPORT2 ucol_getShortDefinitionString (const UCollator *coll, const char *locale, char *buffer, int32_t capacity, UErrorCode *status)
U_STABLE int32_t U_EXPORT2 ucol_getSortKey (const UCollator *coll, const UChar *source, int32_t sourceLength, uint8_t *result, int32_t resultLength)
U_STABLE UCollationStrength
U_EXPORT2 
ucol_getStrength (const UCollator *coll)
U_STABLE USet *U_EXPORT2 ucol_getTailoredSet (const UCollator *coll, UErrorCode *status)
U_STABLE void U_EXPORT2 ucol_getUCAVersion (const UCollator *coll, UVersionInfo info)
U_INTERNAL int32_t U_EXPORT2 ucol_getUnsafeSet (const UCollator *coll, USet *unsafe, UErrorCode *status)
U_STABLE uint32_t U_EXPORT2 ucol_getVariableTop (const UCollator *coll, UErrorCode *status)
U_STABLE void U_EXPORT2 ucol_getVersion (const UCollator *coll, UVersionInfo info)
U_STABLE UBool U_EXPORT2 ucol_greater (const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
U_STABLE UBool U_EXPORT2 ucol_greaterOrEqual (const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
U_STABLE int32_t U_EXPORT2 ucol_mergeSortkeys (const uint8_t *src1, int32_t src1Length, const uint8_t *src2, int32_t src2Length, uint8_t *dest, int32_t destCapacity)
U_STABLE int32_t U_EXPORT2 ucol_nextSortKeyPart (const UCollator *coll, UCharIterator *iter, uint32_t state[2], uint8_t *dest, int32_t count, UErrorCode *status)
U_STABLE int32_t U_EXPORT2 ucol_normalizeShortDefinitionString (const char *source, char *destination, int32_t capacity, UParseError *parseError, UErrorCode *status)
U_STABLE UCollator *U_EXPORT2 ucol_open (const char *loc, UErrorCode *status)
U_STABLE UEnumeration *U_EXPORT2 ucol_openAvailableLocales (UErrorCode *status)
U_STABLE UCollator *U_EXPORT2 ucol_openBinary (const uint8_t *bin, int32_t length, const UCollator *base, UErrorCode *status)
U_STABLE UCollator *U_EXPORT2 ucol_openFromShortString (const char *definition, UBool forceDefaults, UParseError *parseError, UErrorCode *status)
U_STABLE UCollator *U_EXPORT2 ucol_openRules (const UChar *rules, int32_t rulesLength, UColAttributeValue normalizationMode, UCollationStrength strength, UParseError *parseError, UErrorCode *status)
U_INTERNAL void U_EXPORT2 ucol_prepareShortStringOpen (const char *definition, UBool forceDefaults, UParseError *parseError, UErrorCode *status)
U_STABLE void U_EXPORT2 ucol_restoreVariableTop (UCollator *coll, const uint32_t varTop, UErrorCode *status)
U_STABLE UCollator *U_EXPORT2 ucol_safeClone (const UCollator *coll, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
U_STABLE void U_EXPORT2 ucol_setAttribute (UCollator *coll, UColAttribute attr, UColAttributeValue value, UErrorCode *status)
U_STABLE void U_EXPORT2 ucol_setStrength (UCollator *coll, UCollationStrength strength)
U_STABLE uint32_t U_EXPORT2 ucol_setVariableTop (UCollator *coll, const UChar *varTop, int32_t len, UErrorCode *status)
U_STABLE UCollationResult U_EXPORT2 ucol_strcoll (const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
U_STABLE UCollationResult U_EXPORT2 ucol_strcollIter (const UCollator *coll, UCharIterator *sIter, UCharIterator *tIter, UErrorCode *status)


Generated by  Doxygen 1.6.0   Back to index