jpayne@69: // © 2017 and later: Unicode, Inc. and others. jpayne@69: // License & terms of use: http://www.unicode.org/copyright.html jpayne@69: jpayne@69: // casemap.h jpayne@69: // created: 2017jan12 Markus W. Scherer jpayne@69: jpayne@69: #ifndef __CASEMAP_H__ jpayne@69: #define __CASEMAP_H__ jpayne@69: jpayne@69: #include "unicode/utypes.h" jpayne@69: jpayne@69: #if U_SHOW_CPLUSPLUS_API jpayne@69: jpayne@69: #include "unicode/stringpiece.h" jpayne@69: #include "unicode/uobject.h" jpayne@69: jpayne@69: /** jpayne@69: * \file jpayne@69: * \brief C++ API: Low-level C++ case mapping functions. jpayne@69: */ jpayne@69: jpayne@69: U_NAMESPACE_BEGIN jpayne@69: jpayne@69: class BreakIterator; jpayne@69: class ByteSink; jpayne@69: class Edits; jpayne@69: jpayne@69: /** jpayne@69: * Low-level C++ case mapping functions. jpayne@69: * jpayne@69: * @stable ICU 59 jpayne@69: */ jpayne@69: class U_COMMON_API CaseMap U_FINAL : public UMemory { jpayne@69: public: jpayne@69: /** jpayne@69: * Lowercases a UTF-16 string and optionally records edits. jpayne@69: * Casing is locale-dependent and context-sensitive. jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * The source string and the destination buffer must not overlap. jpayne@69: * jpayne@69: * @param locale The locale ID. ("" = root locale, NULL = default locale.) jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. jpayne@69: * @param src The original string. jpayne@69: * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. jpayne@69: * @param dest A buffer for the result string. The result will be NUL-terminated if jpayne@69: * the buffer is large enough. jpayne@69: * The contents is undefined in case of failure. jpayne@69: * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then jpayne@69: * dest may be NULL and the function will only return the length of the result jpayne@69: * without writing any of the result string. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * @return The length of the result string, if successful. jpayne@69: * When the result would be longer than destCapacity, jpayne@69: * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. jpayne@69: * jpayne@69: * @see u_strToLower jpayne@69: * @stable ICU 59 jpayne@69: */ jpayne@69: static int32_t toLower( jpayne@69: const char *locale, uint32_t options, jpayne@69: const char16_t *src, int32_t srcLength, jpayne@69: char16_t *dest, int32_t destCapacity, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: /** jpayne@69: * Uppercases a UTF-16 string and optionally records edits. jpayne@69: * Casing is locale-dependent and context-sensitive. jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * The source string and the destination buffer must not overlap. jpayne@69: * jpayne@69: * @param locale The locale ID. ("" = root locale, NULL = default locale.) jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. jpayne@69: * @param src The original string. jpayne@69: * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. jpayne@69: * @param dest A buffer for the result string. The result will be NUL-terminated if jpayne@69: * the buffer is large enough. jpayne@69: * The contents is undefined in case of failure. jpayne@69: * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then jpayne@69: * dest may be NULL and the function will only return the length of the result jpayne@69: * without writing any of the result string. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * @return The length of the result string, if successful. jpayne@69: * When the result would be longer than destCapacity, jpayne@69: * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. jpayne@69: * jpayne@69: * @see u_strToUpper jpayne@69: * @stable ICU 59 jpayne@69: */ jpayne@69: static int32_t toUpper( jpayne@69: const char *locale, uint32_t options, jpayne@69: const char16_t *src, int32_t srcLength, jpayne@69: char16_t *dest, int32_t destCapacity, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: #if !UCONFIG_NO_BREAK_ITERATION jpayne@69: jpayne@69: /** jpayne@69: * Titlecases a UTF-16 string and optionally records edits. jpayne@69: * Casing is locale-dependent and context-sensitive. jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * The source string and the destination buffer must not overlap. jpayne@69: * jpayne@69: * Titlecasing uses a break iterator to find the first characters of words jpayne@69: * that are to be titlecased. It titlecases those characters and lowercases jpayne@69: * all others. (This can be modified with options bits.) jpayne@69: * jpayne@69: * @param locale The locale ID. ("" = root locale, NULL = default locale.) jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, jpayne@69: * U_TITLECASE_NO_LOWERCASE, jpayne@69: * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, jpayne@69: * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES. jpayne@69: * @param iter A break iterator to find the first characters of words that are to be titlecased. jpayne@69: * It is set to the source string (setText()) jpayne@69: * and used one or more times for iteration (first() and next()). jpayne@69: * If NULL, then a word break iterator for the locale is used jpayne@69: * (or something equivalent). jpayne@69: * @param src The original string. jpayne@69: * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. jpayne@69: * @param dest A buffer for the result string. The result will be NUL-terminated if jpayne@69: * the buffer is large enough. jpayne@69: * The contents is undefined in case of failure. jpayne@69: * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then jpayne@69: * dest may be NULL and the function will only return the length of the result jpayne@69: * without writing any of the result string. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * @return The length of the result string, if successful. jpayne@69: * When the result would be longer than destCapacity, jpayne@69: * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. jpayne@69: * jpayne@69: * @see u_strToTitle jpayne@69: * @see ucasemap_toTitle jpayne@69: * @stable ICU 59 jpayne@69: */ jpayne@69: static int32_t toTitle( jpayne@69: const char *locale, uint32_t options, BreakIterator *iter, jpayne@69: const char16_t *src, int32_t srcLength, jpayne@69: char16_t *dest, int32_t destCapacity, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: #endif // UCONFIG_NO_BREAK_ITERATION jpayne@69: jpayne@69: /** jpayne@69: * Case-folds a UTF-16 string and optionally records edits. jpayne@69: * jpayne@69: * Case folding is locale-independent and not context-sensitive, jpayne@69: * but there is an option for whether to include or exclude mappings for dotted I jpayne@69: * and dotless i that are marked with 'T' in CaseFolding.txt. jpayne@69: * jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * The source string and the destination buffer must not overlap. jpayne@69: * jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, jpayne@69: * U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I. jpayne@69: * @param src The original string. jpayne@69: * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. jpayne@69: * @param dest A buffer for the result string. The result will be NUL-terminated if jpayne@69: * the buffer is large enough. jpayne@69: * The contents is undefined in case of failure. jpayne@69: * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then jpayne@69: * dest may be NULL and the function will only return the length of the result jpayne@69: * without writing any of the result string. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * @return The length of the result string, if successful. jpayne@69: * When the result would be longer than destCapacity, jpayne@69: * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. jpayne@69: * jpayne@69: * @see u_strFoldCase jpayne@69: * @stable ICU 59 jpayne@69: */ jpayne@69: static int32_t fold( jpayne@69: uint32_t options, jpayne@69: const char16_t *src, int32_t srcLength, jpayne@69: char16_t *dest, int32_t destCapacity, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: /** jpayne@69: * Lowercases a UTF-8 string and optionally records edits. jpayne@69: * Casing is locale-dependent and context-sensitive. jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * jpayne@69: * @param locale The locale ID. ("" = root locale, NULL = default locale.) jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. jpayne@69: * @param src The original string. jpayne@69: * @param sink A ByteSink to which the result string is written. jpayne@69: * sink.Flush() is called at the end. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * jpayne@69: * @see ucasemap_utf8ToLower jpayne@69: * @stable ICU 60 jpayne@69: */ jpayne@69: static void utf8ToLower( jpayne@69: const char *locale, uint32_t options, jpayne@69: StringPiece src, ByteSink &sink, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: /** jpayne@69: * Uppercases a UTF-8 string and optionally records edits. jpayne@69: * Casing is locale-dependent and context-sensitive. jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * jpayne@69: * @param locale The locale ID. ("" = root locale, NULL = default locale.) jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. jpayne@69: * @param src The original string. jpayne@69: * @param sink A ByteSink to which the result string is written. jpayne@69: * sink.Flush() is called at the end. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * jpayne@69: * @see ucasemap_utf8ToUpper jpayne@69: * @stable ICU 60 jpayne@69: */ jpayne@69: static void utf8ToUpper( jpayne@69: const char *locale, uint32_t options, jpayne@69: StringPiece src, ByteSink &sink, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: #if !UCONFIG_NO_BREAK_ITERATION jpayne@69: jpayne@69: /** jpayne@69: * Titlecases a UTF-8 string and optionally records edits. jpayne@69: * Casing is locale-dependent and context-sensitive. jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * jpayne@69: * Titlecasing uses a break iterator to find the first characters of words jpayne@69: * that are to be titlecased. It titlecases those characters and lowercases jpayne@69: * all others. (This can be modified with options bits.) jpayne@69: * jpayne@69: * @param locale The locale ID. ("" = root locale, NULL = default locale.) jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, jpayne@69: * U_TITLECASE_NO_LOWERCASE, jpayne@69: * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, jpayne@69: * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES. jpayne@69: * @param iter A break iterator to find the first characters of words that are to be titlecased. jpayne@69: * It is set to the source string (setUText()) jpayne@69: * and used one or more times for iteration (first() and next()). jpayne@69: * If NULL, then a word break iterator for the locale is used jpayne@69: * (or something equivalent). jpayne@69: * @param src The original string. jpayne@69: * @param sink A ByteSink to which the result string is written. jpayne@69: * sink.Flush() is called at the end. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * jpayne@69: * @see ucasemap_utf8ToTitle jpayne@69: * @stable ICU 60 jpayne@69: */ jpayne@69: static void utf8ToTitle( jpayne@69: const char *locale, uint32_t options, BreakIterator *iter, jpayne@69: StringPiece src, ByteSink &sink, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: #endif // UCONFIG_NO_BREAK_ITERATION jpayne@69: jpayne@69: /** jpayne@69: * Case-folds a UTF-8 string and optionally records edits. jpayne@69: * jpayne@69: * Case folding is locale-independent and not context-sensitive, jpayne@69: * but there is an option for whether to include or exclude mappings for dotted I jpayne@69: * and dotless i that are marked with 'T' in CaseFolding.txt. jpayne@69: * jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. jpayne@69: * @param src The original string. jpayne@69: * @param sink A ByteSink to which the result string is written. jpayne@69: * sink.Flush() is called at the end. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * jpayne@69: * @see ucasemap_utf8FoldCase jpayne@69: * @stable ICU 60 jpayne@69: */ jpayne@69: static void utf8Fold( jpayne@69: uint32_t options, jpayne@69: StringPiece src, ByteSink &sink, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: /** jpayne@69: * Lowercases a UTF-8 string and optionally records edits. jpayne@69: * Casing is locale-dependent and context-sensitive. jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * The source string and the destination buffer must not overlap. jpayne@69: * jpayne@69: * @param locale The locale ID. ("" = root locale, NULL = default locale.) jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. jpayne@69: * @param src The original string. jpayne@69: * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. jpayne@69: * @param dest A buffer for the result string. The result will be NUL-terminated if jpayne@69: * the buffer is large enough. jpayne@69: * The contents is undefined in case of failure. jpayne@69: * @param destCapacity The size of the buffer (number of bytes). If it is 0, then jpayne@69: * dest may be NULL and the function will only return the length of the result jpayne@69: * without writing any of the result string. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * @return The length of the result string, if successful. jpayne@69: * When the result would be longer than destCapacity, jpayne@69: * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. jpayne@69: * jpayne@69: * @see ucasemap_utf8ToLower jpayne@69: * @stable ICU 59 jpayne@69: */ jpayne@69: static int32_t utf8ToLower( jpayne@69: const char *locale, uint32_t options, jpayne@69: const char *src, int32_t srcLength, jpayne@69: char *dest, int32_t destCapacity, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: /** jpayne@69: * Uppercases a UTF-8 string and optionally records edits. jpayne@69: * Casing is locale-dependent and context-sensitive. jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * The source string and the destination buffer must not overlap. jpayne@69: * jpayne@69: * @param locale The locale ID. ("" = root locale, NULL = default locale.) jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET. jpayne@69: * @param src The original string. jpayne@69: * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. jpayne@69: * @param dest A buffer for the result string. The result will be NUL-terminated if jpayne@69: * the buffer is large enough. jpayne@69: * The contents is undefined in case of failure. jpayne@69: * @param destCapacity The size of the buffer (number of bytes). If it is 0, then jpayne@69: * dest may be NULL and the function will only return the length of the result jpayne@69: * without writing any of the result string. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * @return The length of the result string, if successful. jpayne@69: * When the result would be longer than destCapacity, jpayne@69: * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. jpayne@69: * jpayne@69: * @see ucasemap_utf8ToUpper jpayne@69: * @stable ICU 59 jpayne@69: */ jpayne@69: static int32_t utf8ToUpper( jpayne@69: const char *locale, uint32_t options, jpayne@69: const char *src, int32_t srcLength, jpayne@69: char *dest, int32_t destCapacity, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: #if !UCONFIG_NO_BREAK_ITERATION jpayne@69: jpayne@69: /** jpayne@69: * Titlecases a UTF-8 string and optionally records edits. jpayne@69: * Casing is locale-dependent and context-sensitive. jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * The source string and the destination buffer must not overlap. jpayne@69: * jpayne@69: * Titlecasing uses a break iterator to find the first characters of words jpayne@69: * that are to be titlecased. It titlecases those characters and lowercases jpayne@69: * all others. (This can be modified with options bits.) jpayne@69: * jpayne@69: * @param locale The locale ID. ("" = root locale, NULL = default locale.) jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, jpayne@69: * U_TITLECASE_NO_LOWERCASE, jpayne@69: * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, jpayne@69: * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES. jpayne@69: * @param iter A break iterator to find the first characters of words that are to be titlecased. jpayne@69: * It is set to the source string (setUText()) jpayne@69: * and used one or more times for iteration (first() and next()). jpayne@69: * If NULL, then a word break iterator for the locale is used jpayne@69: * (or something equivalent). jpayne@69: * @param src The original string. jpayne@69: * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. jpayne@69: * @param dest A buffer for the result string. The result will be NUL-terminated if jpayne@69: * the buffer is large enough. jpayne@69: * The contents is undefined in case of failure. jpayne@69: * @param destCapacity The size of the buffer (number of bytes). If it is 0, then jpayne@69: * dest may be NULL and the function will only return the length of the result jpayne@69: * without writing any of the result string. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * @return The length of the result string, if successful. jpayne@69: * When the result would be longer than destCapacity, jpayne@69: * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. jpayne@69: * jpayne@69: * @see ucasemap_utf8ToTitle jpayne@69: * @stable ICU 59 jpayne@69: */ jpayne@69: static int32_t utf8ToTitle( jpayne@69: const char *locale, uint32_t options, BreakIterator *iter, jpayne@69: const char *src, int32_t srcLength, jpayne@69: char *dest, int32_t destCapacity, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: #endif // UCONFIG_NO_BREAK_ITERATION jpayne@69: jpayne@69: /** jpayne@69: * Case-folds a UTF-8 string and optionally records edits. jpayne@69: * jpayne@69: * Case folding is locale-independent and not context-sensitive, jpayne@69: * but there is an option for whether to include or exclude mappings for dotted I jpayne@69: * and dotless i that are marked with 'T' in CaseFolding.txt. jpayne@69: * jpayne@69: * The result may be longer or shorter than the original. jpayne@69: * The source string and the destination buffer must not overlap. jpayne@69: * jpayne@69: * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, jpayne@69: * U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I. jpayne@69: * @param src The original string. jpayne@69: * @param srcLength The length of the original string. If -1, then src must be NUL-terminated. jpayne@69: * @param dest A buffer for the result string. The result will be NUL-terminated if jpayne@69: * the buffer is large enough. jpayne@69: * The contents is undefined in case of failure. jpayne@69: * @param destCapacity The size of the buffer (number of bytes). If it is 0, then jpayne@69: * dest may be NULL and the function will only return the length of the result jpayne@69: * without writing any of the result string. jpayne@69: * @param edits Records edits for index mapping, working with styled text, jpayne@69: * and getting only changes (if any). jpayne@69: * The Edits contents is undefined if any error occurs. jpayne@69: * This function calls edits->reset() first unless jpayne@69: * options includes U_EDITS_NO_RESET. edits can be NULL. jpayne@69: * @param errorCode Reference to an in/out error code value jpayne@69: * which must not indicate a failure before the function call. jpayne@69: * @return The length of the result string, if successful. jpayne@69: * When the result would be longer than destCapacity, jpayne@69: * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set. jpayne@69: * jpayne@69: * @see ucasemap_utf8FoldCase jpayne@69: * @stable ICU 59 jpayne@69: */ jpayne@69: static int32_t utf8Fold( jpayne@69: uint32_t options, jpayne@69: const char *src, int32_t srcLength, jpayne@69: char *dest, int32_t destCapacity, Edits *edits, jpayne@69: UErrorCode &errorCode); jpayne@69: jpayne@69: private: jpayne@69: CaseMap() = delete; jpayne@69: CaseMap(const CaseMap &other) = delete; jpayne@69: CaseMap &operator=(const CaseMap &other) = delete; jpayne@69: }; jpayne@69: jpayne@69: U_NAMESPACE_END jpayne@69: jpayne@69: #endif /* U_SHOW_CPLUSPLUS_API */ jpayne@69: jpayne@69: #endif // __CASEMAP_H__