00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __UNORM2_H__
00020 #define __UNORM2_H__
00021
00033 #include "unicode/utypes.h"
00034 #include "unicode/localpointer.h"
00035 #include "unicode/stringoptions.h"
00036 #include "unicode/uset.h"
00037
00045 typedef enum {
00054 UNORM2_COMPOSE,
00063 UNORM2_DECOMPOSE,
00076 UNORM2_FCD,
00086 UNORM2_COMPOSE_CONTIGUOUS
00087 } UNormalization2Mode;
00088
00094 typedef enum UNormalizationCheckResult {
00099 UNORM_NO,
00104 UNORM_YES,
00112 UNORM_MAYBE
00113 } UNormalizationCheckResult;
00114
00119 struct UNormalizer2;
00120 typedef struct UNormalizer2 UNormalizer2;
00122 #if !UCONFIG_NO_NORMALIZATION
00123
00135 U_STABLE const UNormalizer2 * U_EXPORT2
00136 unorm2_getNFCInstance(UErrorCode *pErrorCode);
00137
00149 U_STABLE const UNormalizer2 * U_EXPORT2
00150 unorm2_getNFDInstance(UErrorCode *pErrorCode);
00151
00163 U_STABLE const UNormalizer2 * U_EXPORT2
00164 unorm2_getNFKCInstance(UErrorCode *pErrorCode);
00165
00177 U_STABLE const UNormalizer2 * U_EXPORT2
00178 unorm2_getNFKDInstance(UErrorCode *pErrorCode);
00179
00191 U_STABLE const UNormalizer2 * U_EXPORT2
00192 unorm2_getNFKCCasefoldInstance(UErrorCode *pErrorCode);
00193
00215 U_STABLE const UNormalizer2 * U_EXPORT2
00216 unorm2_getInstance(const char *packageName,
00217 const char *name,
00218 UNormalization2Mode mode,
00219 UErrorCode *pErrorCode);
00220
00236 U_STABLE UNormalizer2 * U_EXPORT2
00237 unorm2_openFiltered(const UNormalizer2 *norm2, const USet *filterSet, UErrorCode *pErrorCode);
00238
00245 U_STABLE void U_EXPORT2
00246 unorm2_close(UNormalizer2 *norm2);
00247
00248 #if U_SHOW_CPLUSPLUS_API
00249
00250 U_NAMESPACE_BEGIN
00251
00261 U_DEFINE_LOCAL_OPEN_POINTER(LocalUNormalizer2Pointer, UNormalizer2, unorm2_close);
00262
00263 U_NAMESPACE_END
00264
00265 #endif
00266
00283 U_STABLE int32_t U_EXPORT2
00284 unorm2_normalize(const UNormalizer2 *norm2,
00285 const UChar *src, int32_t length,
00286 UChar *dest, int32_t capacity,
00287 UErrorCode *pErrorCode);
00306 U_STABLE int32_t U_EXPORT2
00307 unorm2_normalizeSecondAndAppend(const UNormalizer2 *norm2,
00308 UChar *first, int32_t firstLength, int32_t firstCapacity,
00309 const UChar *second, int32_t secondLength,
00310 UErrorCode *pErrorCode);
00329 U_STABLE int32_t U_EXPORT2
00330 unorm2_append(const UNormalizer2 *norm2,
00331 UChar *first, int32_t firstLength, int32_t firstCapacity,
00332 const UChar *second, int32_t secondLength,
00333 UErrorCode *pErrorCode);
00334
00354 U_STABLE int32_t U_EXPORT2
00355 unorm2_getDecomposition(const UNormalizer2 *norm2,
00356 UChar32 c, UChar *decomposition, int32_t capacity,
00357 UErrorCode *pErrorCode);
00358
00388 U_STABLE int32_t U_EXPORT2
00389 unorm2_getRawDecomposition(const UNormalizer2 *norm2,
00390 UChar32 c, UChar *decomposition, int32_t capacity,
00391 UErrorCode *pErrorCode);
00392
00408 U_STABLE UChar32 U_EXPORT2
00409 unorm2_composePair(const UNormalizer2 *norm2, UChar32 a, UChar32 b);
00410
00420 U_STABLE uint8_t U_EXPORT2
00421 unorm2_getCombiningClass(const UNormalizer2 *norm2, UChar32 c);
00422
00439 U_STABLE UBool U_EXPORT2
00440 unorm2_isNormalized(const UNormalizer2 *norm2,
00441 const UChar *s, int32_t length,
00442 UErrorCode *pErrorCode);
00443
00461 U_STABLE UNormalizationCheckResult U_EXPORT2
00462 unorm2_quickCheck(const UNormalizer2 *norm2,
00463 const UChar *s, int32_t length,
00464 UErrorCode *pErrorCode);
00465
00490 U_STABLE int32_t U_EXPORT2
00491 unorm2_spanQuickCheckYes(const UNormalizer2 *norm2,
00492 const UChar *s, int32_t length,
00493 UErrorCode *pErrorCode);
00494
00504 U_STABLE UBool U_EXPORT2
00505 unorm2_hasBoundaryBefore(const UNormalizer2 *norm2, UChar32 c);
00506
00516 U_STABLE UBool U_EXPORT2
00517 unorm2_hasBoundaryAfter(const UNormalizer2 *norm2, UChar32 c);
00518
00527 U_STABLE UBool U_EXPORT2
00528 unorm2_isInert(const UNormalizer2 *norm2, UChar32 c);
00529
00596 U_STABLE int32_t U_EXPORT2
00597 unorm_compare(const UChar *s1, int32_t length1,
00598 const UChar *s2, int32_t length2,
00599 uint32_t options,
00600 UErrorCode *pErrorCode);
00601
00602 #endif
00603 #endif