ICU 4.8.1.1
4.8.1.1
|
00001 /* 00002 ******************************************************************************* 00003 * 00004 * Copyright (C) 2009-2010, International Business Machines 00005 * Corporation and others. All Rights Reserved. 00006 * 00007 ******************************************************************************* 00008 * file name: unorm2.h 00009 * encoding: US-ASCII 00010 * tab size: 8 (not used) 00011 * indentation:4 00012 * 00013 * created on: 2009dec15 00014 * created by: Markus W. Scherer 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 00142 U_STABLE const UNormalizer2 * U_EXPORT2 00143 unorm2_getInstance(const char *packageName, 00144 const char *name, 00145 UNormalization2Mode mode, 00146 UErrorCode *pErrorCode); 00147 00163 U_STABLE UNormalizer2 * U_EXPORT2 00164 unorm2_openFiltered(const UNormalizer2 *norm2, const USet *filterSet, UErrorCode *pErrorCode); 00165 00172 U_STABLE void U_EXPORT2 00173 unorm2_close(UNormalizer2 *norm2); 00174 00175 #if U_SHOW_CPLUSPLUS_API 00176 00177 U_NAMESPACE_BEGIN 00178 00188 U_DEFINE_LOCAL_OPEN_POINTER(LocalUNormalizer2Pointer, UNormalizer2, unorm2_close); 00189 00190 U_NAMESPACE_END 00191 00192 #endif 00193 00210 U_STABLE int32_t U_EXPORT2 00211 unorm2_normalize(const UNormalizer2 *norm2, 00212 const UChar *src, int32_t length, 00213 UChar *dest, int32_t capacity, 00214 UErrorCode *pErrorCode); 00233 U_STABLE int32_t U_EXPORT2 00234 unorm2_normalizeSecondAndAppend(const UNormalizer2 *norm2, 00235 UChar *first, int32_t firstLength, int32_t firstCapacity, 00236 const UChar *second, int32_t secondLength, 00237 UErrorCode *pErrorCode); 00256 U_STABLE int32_t U_EXPORT2 00257 unorm2_append(const UNormalizer2 *norm2, 00258 UChar *first, int32_t firstLength, int32_t firstCapacity, 00259 const UChar *second, int32_t secondLength, 00260 UErrorCode *pErrorCode); 00261 00278 U_DRAFT int32_t U_EXPORT2 00279 unorm2_getDecomposition(const UNormalizer2 *norm2, 00280 UChar32 c, UChar *decomposition, int32_t capacity, 00281 UErrorCode *pErrorCode); 00282 00299 U_STABLE UBool U_EXPORT2 00300 unorm2_isNormalized(const UNormalizer2 *norm2, 00301 const UChar *s, int32_t length, 00302 UErrorCode *pErrorCode); 00303 00321 U_STABLE UNormalizationCheckResult U_EXPORT2 00322 unorm2_quickCheck(const UNormalizer2 *norm2, 00323 const UChar *s, int32_t length, 00324 UErrorCode *pErrorCode); 00325 00350 U_STABLE int32_t U_EXPORT2 00351 unorm2_spanQuickCheckYes(const UNormalizer2 *norm2, 00352 const UChar *s, int32_t length, 00353 UErrorCode *pErrorCode); 00354 00364 U_STABLE UBool U_EXPORT2 00365 unorm2_hasBoundaryBefore(const UNormalizer2 *norm2, UChar32 c); 00366 00376 U_STABLE UBool U_EXPORT2 00377 unorm2_hasBoundaryAfter(const UNormalizer2 *norm2, UChar32 c); 00378 00387 U_STABLE UBool U_EXPORT2 00388 unorm2_isInert(const UNormalizer2 *norm2, UChar32 c); 00389 00390 #endif /* !UCONFIG_NO_NORMALIZATION */ 00391 #endif /* __UNORM2_H__ */