unorm.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (c) 1996-2016, International Business Machines Corporation
* and others. All Rights Reserved.
*******************************************************************************
* File unorm.h
*
* Created by: Vladimir Weinstein 12052000
*
* Modification history :
*
* Date Name Description
* 02/01/01 synwee Added normalization quickcheck enum and method.
*/
#ifndef UNORM_H
#define UNORM_H
#include "unicode/utypes.h"
#if !UCONFIG_NO_NORMALIZATION
#include "unicode/uiter.h"
#include "unicode/unorm2.h"
// Do not conditionalize the following enum with #ifndef U_HIDE_DEPRECATED_API,
// it is needed for layout of Normalizer object.
#ifndef U_FORCE_HIDE_DEPRECATED_API
typedef enum {
UNORM_NONE = 1,
UNORM_NFD = 2,
UNORM_NFKD = 3,
UNORM_NFC = 4,
UNORM_DEFAULT = UNORM_NFC,
UNORM_NFKC =5,
UNORM_FCD = 6,
UNORM_MODE_COUNT
} UNormalizationMode;
#endif // U_FORCE_HIDE_DEPRECATED_API
#ifndef U_HIDE_DEPRECATED_API
enum {
UNORM_UNICODE_3_2=0x20
};
#define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
U_DEPRECATED int32_t U_EXPORT2
unorm_normalize(const UChar *source, int32_t sourceLength,
UNormalizationMode mode, int32_t options,
UChar *result, int32_t resultLength,
UErrorCode *status);
U_DEPRECATED UNormalizationCheckResult U_EXPORT2
unorm_quickCheck(const UChar *source, int32_t sourcelength,
UNormalizationMode mode,
UErrorCode *status);
U_DEPRECATED UNormalizationCheckResult U_EXPORT2
unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
UNormalizationMode mode, int32_t options,
UErrorCode *pErrorCode);
U_DEPRECATED UBool U_EXPORT2
unorm_isNormalized(const UChar *src, int32_t srcLength,
UNormalizationMode mode,
UErrorCode *pErrorCode);
U_DEPRECATED UBool U_EXPORT2
unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
UNormalizationMode mode, int32_t options,
UErrorCode *pErrorCode);
U_DEPRECATED int32_t U_EXPORT2
unorm_next(UCharIterator *src,
UChar *dest, int32_t destCapacity,
UNormalizationMode mode, int32_t options,
UBool doNormalize, UBool *pNeededToNormalize,
UErrorCode *pErrorCode);
U_DEPRECATED int32_t U_EXPORT2
unorm_previous(UCharIterator *src,
UChar *dest, int32_t destCapacity,
UNormalizationMode mode, int32_t options,
UBool doNormalize, UBool *pNeededToNormalize,
UErrorCode *pErrorCode);
U_DEPRECATED int32_t U_EXPORT2
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);
#endif /* U_HIDE_DEPRECATED_API */
#endif /* #if !UCONFIG_NO_NORMALIZATION */
#endif
UCharIterator
C API for code unit iteration.
Definition: uiter.h:341
uiter.h
C API: Unicode Character Iteration.
U_DEPRECATED
#define U_DEPRECATED
This is used to declare a function as a deprecated public ICU C API
Definition: umachine.h:116
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:247
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:386
unorm2.h
C API: New API for Unicode Normalization.
UNormalizationCheckResult
UNormalizationCheckResult
Result values for normalization quick check functions.
Definition: unorm2.h:97
UNORM_UNICODE_3_2
@ UNORM_UNICODE_3_2
Options bit set value to select Unicode 3.2 normalization (except NormalizationCorrections).
Definition: unorm.h:178
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_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.
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.
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_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_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.
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_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...
UNormalizationMode
UNormalizationMode
Constants for normalization modes.
Definition: unorm.h:140
UNORM_DEFAULT
@ UNORM_DEFAULT
Default normalization.
Definition: unorm.h:150
UNORM_NONE
@ UNORM_NONE
No decomposition/composition.
Definition: unorm.h:142
UNORM_NFKD
@ UNORM_NFKD
Compatibility decomposition.
Definition: unorm.h:146
UNORM_NFC
@ UNORM_NFC
Canonical decomposition followed by canonical composition.
Definition: unorm.h:148
UNORM_NFD
@ UNORM_NFD
Canonical decomposition.
Definition: unorm.h:144
UNORM_NFKC
@ UNORM_NFKC
Compatibility decomposition followed by canonical composition.
Definition: unorm.h:152
UNORM_FCD
@ UNORM_FCD
"Fast C or D" form.
Definition: unorm.h:154
UNORM_MODE_COUNT
@ UNORM_MODE_COUNT
One more than the highest normalization mode constant.
Definition: unorm.h:157
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415