ICU 50.1.2  50.1.2
unorm.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (c) 1996-2010, 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 
133 typedef enum {
148 
152 
160 enum {
168 };
169 
185 #define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
186 
206 U_STABLE int32_t U_EXPORT2
207 unorm_normalize(const UChar *source, int32_t sourceLength,
208  UNormalizationMode mode, int32_t options,
209  UChar *result, int32_t resultLength,
210  UErrorCode *status);
211 
233 unorm_quickCheck(const UChar *source, int32_t sourcelength,
234  UNormalizationMode mode,
235  UErrorCode *status);
236 
254 unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
255  UNormalizationMode mode, int32_t options,
256  UErrorCode *pErrorCode);
257 
279 U_STABLE UBool U_EXPORT2
280 unorm_isNormalized(const UChar *src, int32_t srcLength,
281  UNormalizationMode mode,
282  UErrorCode *pErrorCode);
283 
301 U_STABLE UBool U_EXPORT2
302 unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
303  UNormalizationMode mode, int32_t options,
304  UErrorCode *pErrorCode);
305 
379 U_STABLE int32_t U_EXPORT2
381  UChar *dest, int32_t destCapacity,
382  UNormalizationMode mode, int32_t options,
383  UBool doNormalize, UBool *pNeededToNormalize,
384  UErrorCode *pErrorCode);
385 
412 U_STABLE int32_t U_EXPORT2
414  UChar *dest, int32_t destCapacity,
415  UNormalizationMode mode, int32_t options,
416  UBool doNormalize, UBool *pNeededToNormalize,
417  UErrorCode *pErrorCode);
418 
456 U_STABLE int32_t U_EXPORT2
457 unorm_concatenate(const UChar *left, int32_t leftLength,
458  const UChar *right, int32_t rightLength,
459  UChar *dest, int32_t destCapacity,
460  UNormalizationMode mode, int32_t options,
461  UErrorCode *pErrorCode);
462 
468 #define UNORM_INPUT_IS_FCD 0x20000
469 
475 #define U_COMPARE_IGNORE_CASE 0x10000
476 
477 #ifndef U_COMPARE_CODE_POINT_ORDER
478 /* see also unistr.h and ustring.h */
484 #define U_COMPARE_CODE_POINT_ORDER 0x8000
485 #endif
486 
553 U_STABLE int32_t U_EXPORT2
554 unorm_compare(const UChar *s1, int32_t length1,
555  const UChar *s2, int32_t length2,
556  uint32_t options,
557  UErrorCode *pErrorCode);
558 
559 #endif /* #if !UCONFIG_NO_NORMALIZATION */
560 
561 #endif
Canonical decomposition.
Definition: unorm.h:137
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...
"Fast C or D" form.
Definition: unorm.h:147
Options bit set value to select Unicode 3.2 normalization (except NormalizationCorrections).
Definition: unorm.h:167
UNormalizationMode
Constants for normalization modes.
Definition: unorm.h:133
Compatibility decomposition followed by canonical composition.
Definition: unorm.h:145
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:143
No decomposition/composition.
Definition: unorm.h:135
int32_t unorm_compare(const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, uint32_t options, UErrorCode *pErrorCode)
Compare two strings for canonical equivalence.
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:278
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:139
Basic definitions for ICU, for both C and C++ APIs.
One more than the highest normalization mode constant.
Definition: unorm.h:150
UNormalizationCheckResult
Result values for normalization quick check functions.
Definition: unorm2.h:91
Canonical decomposition followed by canonical composition.
Definition: unorm.h:141
#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:200