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 class 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/ucoleitr.h"

Go to the source code of this file.

Defines

#define U_COL_SAFECLONE_BUFFERSIZE   384

Typedefs

typedef struct collIterate collIterate
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_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_ON_WITHOUT_HANGUL = 28,
  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_CAPI void U_EXPORT2 ucol_close (UCollator *coll)
U_CAPI int32_t U_EXPORT2 ucol_countAvailable (void)
U_CAPI UBool U_EXPORT2 ucol_equal (const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
U_CAPI UColAttributeValue U_EXPORT2 ucol_getAttribute (const UCollator *coll, UColAttribute attr, UErrorCode *status)
U_CAPI const char *U_EXPORT2 ucol_getAvailable (int32_t index)
U_CAPI 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_CAPI int32_t U_EXPORT2 ucol_getDisplayName (const char *objLoc, const char *dispLoc, UChar *result, int32_t resultLength, UErrorCode *status)
U_CAPI const char *U_EXPORT2 ucol_getLocale (const UCollator *coll, ULocDataLocaleType type, UErrorCode *status)
U_CAPI UNormalizationMode U_EXPORT2 ucol_getNormalization (const UCollator *coll)
U_CAPI const UChar *U_EXPORT2 ucol_getRules (const UCollator *coll, int32_t *length)
U_CAPI int32_t U_EXPORT2 ucol_getRulesEx (const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen)
U_CAPI int32_t U_EXPORT2 ucol_getSortKey (const UCollator *coll, const UChar *source, int32_t sourceLength, uint8_t *result, int32_t resultLength)
U_CAPI UCollationStrength U_EXPORT2 ucol_getStrength (const UCollator *coll)
U_CAPI uint32_t ucol_getVariableTop (const UCollator *coll, UErrorCode *status)
U_CAPI void U_EXPORT2 ucol_getVersion (const UCollator *coll, UVersionInfo info)
U_CAPI UBool U_EXPORT2 ucol_greater (const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
U_CAPI UBool U_EXPORT2 ucol_greaterOrEqual (const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)
U_CAPI 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_CAPI UCollator *U_EXPORT2 ucol_open (const char *loc, UErrorCode *status)
U_CAPI UCollator *U_EXPORT2 ucol_openRules (const UChar *rules, int32_t rulesLength, UColAttributeValue normalizationMode, UCollationStrength strength, UParseError *parseError, UErrorCode *status)
U_CAPI UCollator *U_EXPORT2 ucol_openVersion (const char *loc, UVersionInfo version, UErrorCode *status)
U_CAPI void U_EXPORT2 ucol_restoreVariableTop (UCollator *coll, const uint32_t varTop, UErrorCode *status)
U_CAPI UCollator *U_EXPORT2 ucol_safeClone (const UCollator *coll, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
U_CAPI void U_EXPORT2 ucol_setAttribute (UCollator *coll, UColAttribute attr, UColAttributeValue value, UErrorCode *status)
U_CAPI void U_EXPORT2 ucol_setNormalization (UCollator *coll, UNormalizationMode mode)
U_CAPI void U_EXPORT2 ucol_setStrength (UCollator *coll, UCollationStrength strength)
U_CAPI uint32_t U_EXPORT2 ucol_setVariableTop (UCollator *coll, const UChar *varTop, int32_t len, UErrorCode *status)
U_CAPI UCollationResult U_EXPORT2 ucol_strcoll (const UCollator *coll, const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength)


Generated by  Doxygen 1.6.0   Back to index