ICU 57.1  57.1
unorm.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (c) 1996-2016, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 *******************************************************************************
6 * File unorm.h
7 *
8 * Created by: Vladimir Weinstein 12052000
9 *
10 * Modification history :
11 *
12 * Date Name Description
13 * 02/01/01 synwee Added normalization quickcheck enum and method.
14 */
15 #ifndef UNORM_H
16 #define UNORM_H
17 
18 #include "unicode/utypes.h"
19 
20 #if !UCONFIG_NO_NORMALIZATION
21 
22 #include "unicode/uiter.h"
23 #include "unicode/unorm2.h"
24 
25 #ifndef U_HIDE_DEPRECATED_API
26 
136 typedef enum {
151 
155 
163 enum {
171 };
172 
188 #define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
189 
209 U_STABLE int32_t U_EXPORT2
210 unorm_normalize(const UChar *source, int32_t sourceLength,
211  UNormalizationMode mode, int32_t options,
212  UChar *result, int32_t resultLength,
213  UErrorCode *status);
214 
236 unorm_quickCheck(const UChar *source, int32_t sourcelength,
237  UNormalizationMode mode,
238  UErrorCode *status);
239 
257 unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
258  UNormalizationMode mode, int32_t options,
259  UErrorCode *pErrorCode);
260 
282 U_STABLE UBool U_EXPORT2
283 unorm_isNormalized(const UChar *src, int32_t srcLength,
284  UNormalizationMode mode,
285  UErrorCode *pErrorCode);
286 
304 U_STABLE UBool U_EXPORT2
305 unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
306  UNormalizationMode mode, int32_t options,
307  UErrorCode *pErrorCode);
308 
382 U_STABLE int32_t U_EXPORT2
384  UChar *dest, int32_t destCapacity,
385  UNormalizationMode mode, int32_t options,
386  UBool doNormalize, UBool *pNeededToNormalize,
387  UErrorCode *pErrorCode);
388 
415 U_STABLE int32_t U_EXPORT2
417  UChar *dest, int32_t destCapacity,
418  UNormalizationMode mode, int32_t options,
419  UBool doNormalize, UBool *pNeededToNormalize,
420  UErrorCode *pErrorCode);
421 
459 U_STABLE int32_t U_EXPORT2
460 unorm_concatenate(const UChar *left, int32_t leftLength,
461  const UChar *right, int32_t rightLength,
462  UChar *dest, int32_t destCapacity,
463  UNormalizationMode mode, int32_t options,
464  UErrorCode *pErrorCode);
465 
466 #endif /* U_HIDE_DEPRECATED_API */
467 #endif /* #if !UCONFIG_NO_NORMALIZATION */
468 #endif
Canonical decomposition.
Definition: unorm.h:140
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...
Options bit set value to select Unicode 3.2 normalization (except NormalizationCorrections).
Definition: unorm.h:170
"Fast C or D" form.
Definition: unorm.h:150
UNormalizationMode
Constants for normalization modes.
Definition: unorm.h:136
Compatibility decomposition followed by canonical composition.
Definition: unorm.h:148
C API for code unit iteration.
Definition: uiter.h:339
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...
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.
C API: New API for Unicode Normalization.
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...
UBool unorm_isNormalized(const UChar *src, int32_t srcLength, UNormalizationMode mode, UErrorCode *pErrorCode)
Test if a string is in a given normalization form.
Default normalization.
Definition: unorm.h:146
No decomposition/composition.
Definition: unorm.h:138
C API: Unicode Character Iteration.
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.
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:312
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.
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
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
Compatibility decomposition.
Definition: unorm.h:142
Basic definitions for ICU, for both C and C++ APIs.
One more than the highest normalization mode constant.
Definition: unorm.h:153
UNormalizationCheckResult
Result values for normalization quick check functions.
Definition: unorm2.h:91
Canonical decomposition followed by canonical composition.
Definition: unorm.h:144
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234