00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __UNORM2_H__
00018 #define __UNORM2_H__
00019
00031 #include "unicode/utypes.h"
00032 #include "unicode/localpointer.h"
00033 #include "unicode/uset.h"
00034
00042 typedef enum {
00051 UNORM2_COMPOSE,
00060 UNORM2_DECOMPOSE,
00073 UNORM2_FCD,
00083 UNORM2_COMPOSE_CONTIGUOUS
00084 } UNormalization2Mode;
00085
00091 typedef enum UNormalizationCheckResult {
00096 UNORM_NO,
00101 UNORM_YES,
00109 UNORM_MAYBE
00110 } UNormalizationCheckResult;
00111
00116 struct UNormalizer2;
00117 typedef struct UNormalizer2 UNormalizer2;
00119 #if !UCONFIG_NO_NORMALIZATION
00120
00121 #ifndef U_HIDE_DRAFT_API
00122
00133 U_DRAFT const UNormalizer2 * U_EXPORT2
00134 unorm2_getNFCInstance(UErrorCode *pErrorCode);
00135
00147 U_DRAFT const UNormalizer2 * U_EXPORT2
00148 unorm2_getNFDInstance(UErrorCode *pErrorCode);
00149
00161 U_DRAFT const UNormalizer2 * U_EXPORT2
00162 unorm2_getNFKCInstance(UErrorCode *pErrorCode);
00163
00175 U_DRAFT const UNormalizer2 * U_EXPORT2
00176 unorm2_getNFKDInstance(UErrorCode *pErrorCode);
00177
00189 U_DRAFT const UNormalizer2 * U_EXPORT2
00190 unorm2_getNFKCCasefoldInstance(UErrorCode *pErrorCode);
00191 #endif
00192
00214 U_STABLE const UNormalizer2 * U_EXPORT2
00215 unorm2_getInstance(const char *packageName,
00216 const char *name,
00217 UNormalization2Mode mode,
00218 UErrorCode *pErrorCode);
00219
00235 U_STABLE UNormalizer2 * U_EXPORT2
00236 unorm2_openFiltered(const UNormalizer2 *norm2, const USet *filterSet, UErrorCode *pErrorCode);
00237
00244 U_STABLE void U_EXPORT2
00245 unorm2_close(UNormalizer2 *norm2);
00246
00247 #if U_SHOW_CPLUSPLUS_API
00248
00249 U_NAMESPACE_BEGIN
00250
00260 U_DEFINE_LOCAL_OPEN_POINTER(LocalUNormalizer2Pointer, UNormalizer2, unorm2_close);
00261
00262 U_NAMESPACE_END
00263
00264 #endif
00265
00282 U_STABLE int32_t U_EXPORT2
00283 unorm2_normalize(const UNormalizer2 *norm2,
00284 const UChar *src, int32_t length,
00285 UChar *dest, int32_t capacity,
00286 UErrorCode *pErrorCode);
00305 U_STABLE int32_t U_EXPORT2
00306 unorm2_normalizeSecondAndAppend(const UNormalizer2 *norm2,
00307 UChar *first, int32_t firstLength, int32_t firstCapacity,
00308 const UChar *second, int32_t secondLength,
00309 UErrorCode *pErrorCode);
00328 U_STABLE int32_t U_EXPORT2
00329 unorm2_append(const UNormalizer2 *norm2,
00330 UChar *first, int32_t firstLength, int32_t firstCapacity,
00331 const UChar *second, int32_t secondLength,
00332 UErrorCode *pErrorCode);
00333
00353 U_STABLE int32_t U_EXPORT2
00354 unorm2_getDecomposition(const UNormalizer2 *norm2,
00355 UChar32 c, UChar *decomposition, int32_t capacity,
00356 UErrorCode *pErrorCode);
00357
00358 #ifndef U_HIDE_DRAFT_API
00359
00388 U_DRAFT int32_t U_EXPORT2
00389 unorm2_getRawDecomposition(const UNormalizer2 *norm2,
00390 UChar32 c, UChar *decomposition, int32_t capacity,
00391 UErrorCode *pErrorCode);
00392
00408 U_DRAFT UChar32 U_EXPORT2
00409 unorm2_composePair(const UNormalizer2 *norm2, UChar32 a, UChar32 b);
00410
00420 U_DRAFT uint8_t U_EXPORT2
00421 unorm2_getCombiningClass(const UNormalizer2 *norm2, UChar32 c);
00422 #endif
00423
00440 U_STABLE UBool U_EXPORT2
00441 unorm2_isNormalized(const UNormalizer2 *norm2,
00442 const UChar *s, int32_t length,
00443 UErrorCode *pErrorCode);
00444
00462 U_STABLE UNormalizationCheckResult U_EXPORT2
00463 unorm2_quickCheck(const UNormalizer2 *norm2,
00464 const UChar *s, int32_t length,
00465 UErrorCode *pErrorCode);
00466
00491 U_STABLE int32_t U_EXPORT2
00492 unorm2_spanQuickCheckYes(const UNormalizer2 *norm2,
00493 const UChar *s, int32_t length,
00494 UErrorCode *pErrorCode);
00495
00505 U_STABLE UBool U_EXPORT2
00506 unorm2_hasBoundaryBefore(const UNormalizer2 *norm2, UChar32 c);
00507
00517 U_STABLE UBool U_EXPORT2
00518 unorm2_hasBoundaryAfter(const UNormalizer2 *norm2, UChar32 c);
00519
00528 U_STABLE UBool U_EXPORT2
00529 unorm2_isInert(const UNormalizer2 *norm2, UChar32 c);
00530
00531 #endif
00532 #endif