📄 ucol.h
字号:
/********************************************************************************* Copyright (c) 1996-2005, International Business Machines Corporation and others.* All Rights Reserved.********************************************************************************/#ifndef UCOL_H#define UCOL_H#include "unicode/utypes.h"#if !UCONFIG_NO_COLLATION#include "unicode/unorm.h"#include "unicode/parseerr.h"#include "unicode/uloc.h"#include "unicode/uset.h"/** * \file * \brief C API: Collator * * <h2> Collator C API </h2> * * The C API for Collator performs locale-sensitive * string comparison. You use this service to build * searching and sorting routines for natural language text. * <em>Important: </em>The ICU collation service has been reimplemented * in order to achieve better performance and UCA compliance. * For details, see the * <a href="http://icu.sourceforge.net/cvs/icu/~checkout~/icuhtml/design/collation/ICU_collation_design.htm"> * collation design document</a>. * <p> * For more information about the collation service see * <a href="http://icu.sourceforge.net/icu/userguide/Collate_Intro.html">the users guide</a>. * <p> * 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 <a href="http://www.unicode.org/unicode/reports/tr10/">UCA sort order</a>. * <p> * Sort ordering may be customized by providing your own set of rules. For more on * this subject see the * <a href="http://icu.sourceforge.net/icu/userguide/Collate_Customization.html"> * Collation customization</a> section of the users guide. * <p> * @see UCollationResult * @see UNormalizationMode * @see UCollationStrength * @see UCollationElements *//** A collation element iterator.* For usage in C programs.*/struct collIterate;/** structure representing collation element iterator instance * @stable ICU 2.0 */typedef struct collIterate collIterate;/** A collator.* For usage in C programs.*/struct UCollator;/** structure representing a collator object instance * @stable ICU 2.0 */typedef struct UCollator UCollator;/** * UCOL_LESS is returned if source string is compared to be less than target * string in the u_strcoll() method. * UCOL_EQUAL is returned if source string is compared to be equal to target * string in the u_strcoll() method. * UCOL_GREATER is returned if source string is compared to be greater than * target string in the u_strcoll() method. * @see u_strcoll() * <p> * Possible values for a comparison result * @stable ICU 2.0 */typedef enum { /** string a == string b */ UCOL_EQUAL = 0, /** string a > string b */ UCOL_GREATER = 1, /** string a < string b */ UCOL_LESS = -1} UCollationResult ;/** Enum containing attribute values for controling collation behavior. * Here are all the allowable values. Not every attribute can take every value. The only * universal value is UCOL_DEFAULT, which resets the attribute value to the predefined * value for that locale * @stable ICU 2.0 */typedef enum { /** accepted by most attributes */ UCOL_DEFAULT = -1, /** Primary collation strength */ UCOL_PRIMARY = 0, /** Secondary collation strength */ UCOL_SECONDARY = 1, /** Tertiary collation strength */ UCOL_TERTIARY = 2, /** Default collation strength */ UCOL_DEFAULT_STRENGTH = UCOL_TERTIARY, UCOL_CE_STRENGTH_LIMIT, /** Quaternary collation strength */ UCOL_QUATERNARY=3, /** Identical collation strength */ UCOL_IDENTICAL=15, UCOL_STRENGTH_LIMIT, /** Turn the feature off - works for UCOL_FRENCH_COLLATION, UCOL_CASE_LEVEL, UCOL_HIRAGANA_QUATERNARY_MODE & UCOL_DECOMPOSITION_MODE*/ UCOL_OFF = 16, /** Turn the feature on - works for UCOL_FRENCH_COLLATION, UCOL_CASE_LEVEL, UCOL_HIRAGANA_QUATERNARY_MODE & UCOL_DECOMPOSITION_MODE*/ UCOL_ON = 17, /** Valid for UCOL_ALTERNATE_HANDLING. Alternate handling will be shifted */ UCOL_SHIFTED = 20, /** Valid for UCOL_ALTERNATE_HANDLING. Alternate handling will be non ignorable */ UCOL_NON_IGNORABLE = 21, /** Valid for UCOL_CASE_FIRST - lower case sorts before upper case */ UCOL_LOWER_FIRST = 24, /** upper case sorts before lower case */ UCOL_UPPER_FIRST = 25, UCOL_ATTRIBUTE_VALUE_COUNT} UColAttributeValue;/** * Base letter represents a primary difference. Set comparison * level to UCOL_PRIMARY to ignore secondary and tertiary differences. * Use this to set the strength of a Collator object. * Example of primary difference, "abc" < "abd" * * Diacritical differences on the same base letter represent a secondary * difference. Set comparison level to UCOL_SECONDARY to ignore tertiary * differences. Use this to set the strength of a Collator object. * Example of secondary difference, "
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -