Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ucol.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 * Copyright (c) {1996-2001}, International Business Machines Corporation and others. All Rights Reserved.
00004 *******************************************************************************
00005 */
00006 
00007 #ifndef UCOL_H
00008 #define UCOL_H
00009 
00010 #include "unicode/utypes.h"
00011 #include "unicode/unorm.h"
00012 
00110 struct collIterate;
00111 typedef struct collIterate collIterate;
00112 
00113 struct incrementalContext;
00114 typedef struct incrementalContext incrementalContext;
00115 
00119 struct UCollator;
00120 typedef struct UCollator UCollator;
00121 
00122 
00133 typedef enum {
00135   UCOL_EQUAL    = 0,
00137   UCOL_GREATER    = 1,
00139   UCOL_LESS    = -1
00140 } UCollationResult ;
00141 
00142 
00143 typedef enum {
00144   /* accepted by most attributes */
00145   UCOL_DEFAULT = -1,
00146 
00147   /* for UCOL_STRENGTH */
00149   UCOL_PRIMARY = 0,
00151   UCOL_SECONDARY = 1,
00153   UCOL_TERTIARY = 2,
00155   UCOL_DEFAULT_STRENGTH = UCOL_TERTIARY,
00156   UCOL_CE_STRENGTH_LIMIT,
00158   UCOL_QUATERNARY=3,
00160   UCOL_IDENTICAL=15,
00161   UCOL_STRENGTH_LIMIT,
00162 
00163   /* for UCOL_FRENCH_COLLATION, UCOL_CASE_LEVEL & UCOL_DECOMPOSITION_MODE*/
00164   UCOL_OFF = 16,
00165   UCOL_ON = 17,
00166   
00167   /* for UCOL_ALTERNATE_HANDLING */
00168   UCOL_SHIFTED = 20,
00169   UCOL_NON_IGNORABLE = 21,
00170 
00171   /* for UCOL_CASE_FIRST */
00172   UCOL_LOWER_FIRST = 24,
00173   UCOL_UPPER_FIRST = 25,
00174 
00175   /* for UCOL_NORMALIZATION_MODE */
00176   UCOL_ON_WITHOUT_HANGUL = 28,
00177 
00179   UCOL_ATTRIBUTE_VALUE_COUNT
00180 
00181 } UColAttributeValue;
00182 
00208 typedef UColAttributeValue UCollationStrength;
00209 
00210 typedef enum {
00211      UCOL_FRENCH_COLLATION, /* attribute for direction of secondary weights*/
00212      UCOL_ALTERNATE_HANDLING, /* attribute for handling variable elements*/
00213      UCOL_CASE_FIRST, /* who goes first, lower case or uppercase */
00214      UCOL_CASE_LEVEL, /* do we have an extra case level */
00215      UCOL_NORMALIZATION_MODE, /* attribute for normalization */
00216      UCOL_STRENGTH,         /* attribute for strength */
00217      UCOL_ATTRIBUTE_COUNT
00218 } UColAttribute;
00219 
00220 typedef enum {
00221         UCOL_TAILORING_ONLY,
00222         UCOL_FULL_RULES
00223 }  UColRuleOption ;
00224 
00235 U_CAPI UCollator*
00236 ucol_open(    const    char         *loc,
00237         UErrorCode      *status);
00238 
00260 U_CAPI UCollator * U_EXPORT2
00261 ucol_openVersion(const char *loc,
00262                  UVersionInfo version,
00263                  UErrorCode *status);
00264 
00280 U_CAPI UCollator*
00281 ucol_openRules(    const    UChar        *rules,
00282         int32_t                 rulesLength,
00283         UNormalizationMode      mode,
00284         UCollationStrength      strength,
00285         UErrorCode              *status);
00286 
00293 U_CAPI void
00294 ucol_close(UCollator *coll);
00295 
00313 U_CAPI UCollationResult
00314 ucol_strcoll(    const    UCollator    *coll,
00315         const    UChar        *source,
00316         int32_t            sourceLength,
00317         const    UChar        *target,
00318         int32_t            targetLength);
00319 
00334 U_CAPI UBool
00335 ucol_greater(    const    UCollator    *coll,
00336         const    UChar        *source,
00337         int32_t            sourceLength,
00338         const    UChar        *target,
00339         int32_t            targetLength);
00340 
00355 U_CAPI UBool
00356 ucol_greaterOrEqual(    const    UCollator    *coll,
00357             const    UChar        *source,
00358             int32_t            sourceLength,
00359             const    UChar        *target,
00360             int32_t            targetLength);
00361 
00376 U_CAPI UBool
00377 ucol_equal(    const    UCollator    *coll,
00378         const    UChar        *source,
00379         int32_t            sourceLength,
00380         const    UChar        *target,
00381         int32_t            targetLength);
00382 
00392 U_CAPI UCollationStrength
00393 ucol_getStrength(const UCollator *coll);
00394 
00418 U_CAPI void
00419 ucol_setStrength(    UCollator            *coll,
00420             UCollationStrength        strength);
00421 
00432 U_CAPI UNormalizationMode
00433 ucol_getNormalization(const UCollator* coll);
00434 
00445 U_CAPI void
00446 ucol_setNormalization(  UCollator        *coll,
00447             UNormalizationMode    mode);
00448 
00461 U_CAPI int32_t
00462 ucol_getDisplayName(    const    char        *objLoc,
00463             const    char        *dispLoc,
00464             UChar             *result,
00465             int32_t         resultLength,
00466             UErrorCode        *status);
00467 
00477 U_CAPI const char*
00478 ucol_getAvailable(int32_t index);
00479 
00488 U_CAPI int32_t
00489 ucol_countAvailable(void);
00490 
00499 U_CAPI const UChar*
00500 ucol_getRules(    const    UCollator    *coll, 
00501         int32_t            *length);
00502 
00515 U_CAPI int32_t
00516 ucol_getSortKey(const    UCollator    *coll,
00517         const    UChar        *source,
00518         int32_t        sourceLength,
00519         uint8_t        *result,
00520         int32_t        resultLength);
00521 
00522 
00523 
00529 U_CAPI void U_EXPORT2
00530 ucol_getVersion(const UCollator* coll, UVersionInfo info);
00531 
00532 
00533 /* Following are the new APIs for 1.7. They are all draft and most are not even implemented */
00534 
00543 U_CAPI void ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value, UErrorCode *status);
00544 
00553 U_CAPI UColAttributeValue ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status);
00554 
00574 U_CAPI UCollator * ucol_safeClone(
00575           const UCollator     *coll,
00576           void                *stackBuffer,
00577           int32_t        *pBufferSize,
00578           UErrorCode          *status);
00579 
00580 #define U_COL_SAFECLONE_BUFFERSIZE 256
00581 
00582 /* declaration for forward iterating function */
00583 U_CDECL_BEGIN
00584 typedef UChar UCharForwardIterator(void *context);
00585 U_CDECL_END
00586 
00599 U_CAPI UCollationResult ucol_strcollinc(const UCollator *coll, 
00600                                                                  UCharForwardIterator *source, void *sourceContext,
00601                                                                  UCharForwardIterator *target, void *targetContext);
00602 
00612 U_CAPI int32_t ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen);
00613 
00614 /* This is the C API wrapper for CollationIterator that got booted out from here, including just for */
00615 /* include backward compatibility */
00616 #include "unicode/ucoleitr.h"
00617 
00618 #endif

Generated at Thu Mar 22 16:12:39 2001 for ICU 1.8 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000