ICU 58.2 58.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

unorm.h
Go to the documentation of this file.
1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 * Copyright (c) 1996-2016, International Business Machines Corporation
6 * and others. All Rights Reserved.
7 *******************************************************************************
8 * File unorm.h
9 *
10 * Created by: Vladimir Weinstein 12052000
11 *
12 * Modification history :
13 *
14 * Date Name Description
15 * 02/01/01 synwee Added normalization quickcheck enum and method.
16 */
17 #ifndef UNORM_H
18 #define UNORM_H
19
20 #include "unicode/utypes.h"
21
22 #if !UCONFIG_NO_NORMALIZATION
23
24 #include "unicode/uiter.h"
25 #include "unicode/unorm2.h"
26
132 // Do not conditionalize the following enum with #ifndef U_HIDE_DEPRECATED_API,
133 // it is needed for layout of Normalizer object.
138 typedef enum {
140 UNORM_NONE = 1,
142 UNORM_NFD = 2,
144 UNORM_NFKD = 3,
146 UNORM_NFC = 4,
148 UNORM_DEFAULT = UNORM_NFC,
150 UNORM_NFKC =5,
152 UNORM_FCD = 6,
153
155 UNORM_MODE_COUNT
156 } UNormalizationMode;
157
158 #ifndef U_HIDE_DEPRECATED_API
159
167 enum {
174 UNORM_UNICODE_3_2=0x20
175 };
176
192 #define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
193
213 U_STABLE int32_t U_EXPORT2
214 unorm_normalize(const UChar *source, int32_t sourceLength,
215 UNormalizationMode mode, int32_t options,
216 UChar *result, int32_t resultLength,
217 UErrorCode *status);
218
239 U_STABLE UNormalizationCheckResult U_EXPORT2
240 unorm_quickCheck(const UChar *source, int32_t sourcelength,
241 UNormalizationMode mode,
242 UErrorCode *status);
243
260 U_STABLE UNormalizationCheckResult U_EXPORT2
261 unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
262 UNormalizationMode mode, int32_t options,
263 UErrorCode *pErrorCode);
264
286 U_STABLE UBool U_EXPORT2
287 unorm_isNormalized(const UChar *src, int32_t srcLength,
288 UNormalizationMode mode,
289 UErrorCode *pErrorCode);
290
308 U_STABLE UBool U_EXPORT2
309 unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
310 UNormalizationMode mode, int32_t options,
311 UErrorCode *pErrorCode);
312
386 U_STABLE int32_t U_EXPORT2
387 unorm_next(UCharIterator *src,
388 UChar *dest, int32_t destCapacity,
389 UNormalizationMode mode, int32_t options,
390 UBool doNormalize, UBool *pNeededToNormalize,
391 UErrorCode *pErrorCode);
392
419 U_STABLE int32_t U_EXPORT2
420 unorm_previous(UCharIterator *src,
421 UChar *dest, int32_t destCapacity,
422 UNormalizationMode mode, int32_t options,
423 UBool doNormalize, UBool *pNeededToNormalize,
424 UErrorCode *pErrorCode);
425
463 U_STABLE int32_t U_EXPORT2
464 unorm_concatenate(const UChar *left, int32_t leftLength,
465 const UChar *right, int32_t rightLength,
466 UChar *dest, int32_t destCapacity,
467 UNormalizationMode mode, int32_t options,
468 UErrorCode *pErrorCode);
469
470 #endif /* U_HIDE_DEPRECATED_API */
471 #endif /* #if !UCONFIG_NO_NORMALIZATION */
472 #endif
UNORM_NFD
Canonical decomposition.
Definition: unorm.h:142
unorm_quickCheckWithOptions
UNormalizationCheckResult unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode)
Performing quick check on a string; same as unorm_quickCheck but takes an extra options parameter lik...
UNORM_UNICODE_3_2
Options bit set value to select Unicode 3.2 normalization (except NormalizationCorrections).
Definition: unorm.h:174
UNORM_FCD
"Fast C or D" form.
Definition: unorm.h:152
UNormalizationMode
UNormalizationMode
Constants for normalization modes.
Definition: unorm.h:138
UNORM_NFKC
Compatibility decomposition followed by canonical composition.
Definition: unorm.h:150
UCharIterator
C API for code unit iteration.
Definition: uiter.h:341
unorm_quickCheck
UNormalizationCheckResult unorm_quickCheck(const UChar *source, int32_t sourcelength, UNormalizationMode mode, UErrorCode *status)
Performing quick check on a string, to quickly determine if the string is in a particular normalizati...
unorm_normalize
int32_t unorm_normalize(const UChar *source, int32_t sourceLength, UNormalizationMode mode, int32_t options, UChar *result, int32_t resultLength, UErrorCode *status)
Normalize a string.
unorm2.h
C API: New API for Unicode Normalization.
unorm_isNormalizedWithOptions
UBool unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode)
Test if a string is in a given normalization form; same as unorm_isNormalized but takes an extra opti...
unorm_isNormalized
UBool unorm_isNormalized(const UChar *src, int32_t srcLength, UNormalizationMode mode, UErrorCode *pErrorCode)
Test if a string is in a given normalization form.
UNORM_DEFAULT
Default normalization.
Definition: unorm.h:148
UNORM_NONE
No decomposition/composition.
Definition: unorm.h:140
uiter.h
C API: Unicode Character Iteration.
unorm_next
int32_t unorm_next(UCharIterator *src, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, UBool doNormalize, UBool *pNeededToNormalize, UErrorCode *pErrorCode)
Iterative normalization forward.
UChar
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:337
unorm_concatenate
int32_t unorm_concatenate(const UChar *left, int32_t leftLength, const UChar *right, int32_t rightLength, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode)
Concatenate normalized strings, making sure that the result is normalized as well.
unorm_previous
int32_t unorm_previous(UCharIterator *src, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, UBool doNormalize, UBool *pNeededToNormalize, UErrorCode *pErrorCode)
Iterative normalization backward.
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
UNORM_NFKD
Compatibility decomposition.
Definition: unorm.h:144
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UNORM_MODE_COUNT
One more than the highest normalization mode constant.
Definition: unorm.h:155
UNormalizationCheckResult
UNormalizationCheckResult
Result values for normalization quick check functions.
Definition: unorm2.h:93
UNORM_NFC
Canonical decomposition followed by canonical composition.
Definition: unorm.h:146
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:134
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:259