2005-05-20 17:31:12 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
|
|
|
*
|
2010-02-02 01:44:11 +00:00
|
|
|
* Copyright (C) 2005-2010, International Business Machines
|
2005-05-20 17:31:12 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
|
|
|
*******************************************************************************
|
|
|
|
* file name: ucasemap.h
|
|
|
|
* encoding: US-ASCII
|
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created on: 2005may06
|
|
|
|
* created by: Markus W. Scherer
|
|
|
|
*
|
|
|
|
* Case mapping service object and functions using it.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UCASEMAP_H__
|
|
|
|
#define __UCASEMAP_H__
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
|
|
|
#include "unicode/ustring.h"
|
2009-11-14 00:36:06 +00:00
|
|
|
#include "unicode/localpointer.h"
|
2005-05-20 17:31:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* \brief C API: Unicode case mapping functions using a UCaseMap service object.
|
|
|
|
*
|
|
|
|
* The service object takes care of memory allocations, data loading, and setup
|
|
|
|
* for the attributes, as usual.
|
|
|
|
*
|
|
|
|
* Currently, the functionality provided here does not overlap with uchar.h
|
2007-07-27 06:37:08 +00:00
|
|
|
* and ustring.h, except for ucasemap_toTitle().
|
2005-05-20 17:31:12 +00:00
|
|
|
*
|
2007-07-27 06:37:08 +00:00
|
|
|
* ucasemap_utf8XYZ() functions operate directly on UTF-8 strings.
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* UCaseMap is an opaque service object for newer ICU case mapping functions.
|
|
|
|
* Older functions did not use a service object.
|
2007-08-19 08:59:28 +00:00
|
|
|
* @stable ICU 3.4
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
|
|
|
struct UCaseMap;
|
2007-08-19 08:59:28 +00:00
|
|
|
typedef struct UCaseMap UCaseMap; /**< C typedef for struct UCaseMap. @stable ICU 3.4 */
|
2005-05-20 17:31:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Open a UCaseMap service object for a locale and a set of options.
|
|
|
|
* The locale ID and options are preprocessed so that functions using the
|
|
|
|
* service object need not process them in each call.
|
|
|
|
*
|
|
|
|
* @param locale ICU locale ID, used for language-dependent
|
|
|
|
* upper-/lower-/title-casing according to the Unicode standard.
|
|
|
|
* Usual semantics: ""=root, NULL=default locale, etc.
|
|
|
|
* @param options Options bit set, used for case folding and string comparisons.
|
|
|
|
* Same flags as for u_foldCase(), u_strFoldCase(),
|
|
|
|
* u_strCaseCompare(), etc.
|
|
|
|
* Use 0 or U_FOLD_CASE_DEFAULT for default behavior.
|
|
|
|
* @param pErrorCode Must be a valid pointer to an error code value,
|
|
|
|
* which must not indicate a failure before the function call.
|
|
|
|
* @return Pointer to a UCaseMap service object, if successful.
|
|
|
|
*
|
2007-07-27 06:37:08 +00:00
|
|
|
* @see U_FOLD_CASE_DEFAULT
|
|
|
|
* @see U_FOLD_CASE_EXCLUDE_SPECIAL_I
|
|
|
|
* @see U_TITLECASE_NO_LOWERCASE
|
|
|
|
* @see U_TITLECASE_NO_BREAK_ADJUSTMENT
|
2007-08-19 08:59:28 +00:00
|
|
|
* @stable ICU 3.4
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
2007-08-19 08:59:28 +00:00
|
|
|
U_STABLE UCaseMap * U_EXPORT2
|
2005-05-20 17:31:12 +00:00
|
|
|
ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Close a UCaseMap service object.
|
|
|
|
* @param csm Object to be closed.
|
2007-08-19 08:59:28 +00:00
|
|
|
* @stable ICU 3.4
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
2007-08-19 08:59:28 +00:00
|
|
|
U_STABLE void U_EXPORT2
|
2005-05-20 17:31:12 +00:00
|
|
|
ucasemap_close(UCaseMap *csm);
|
|
|
|
|
2009-12-17 07:13:28 +00:00
|
|
|
#if U_SHOW_CPLUSPLUS_API
|
2009-11-14 00:36:06 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \class LocalUCaseMapPointer
|
|
|
|
* "Smart pointer" class, closes a UCaseMap via ucasemap_close().
|
|
|
|
* For most methods see the LocalPointerBase base class.
|
|
|
|
*
|
|
|
|
* @see LocalPointerBase
|
|
|
|
* @see LocalPointer
|
|
|
|
* @draft ICU 4.4
|
|
|
|
*/
|
|
|
|
U_DEFINE_LOCAL_OPEN_POINTER(LocalUCaseMapPointer, UCaseMap, ucasemap_close);
|
|
|
|
|
|
|
|
U_NAMESPACE_END
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2005-05-20 17:31:12 +00:00
|
|
|
/**
|
|
|
|
* Get the locale ID that is used for language-dependent case mappings.
|
|
|
|
* @param csm UCaseMap service object.
|
|
|
|
* @return locale ID
|
2007-08-19 08:59:28 +00:00
|
|
|
* @stable ICU 3.4
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
2007-08-19 08:59:28 +00:00
|
|
|
U_STABLE const char * U_EXPORT2
|
2005-05-20 17:31:12 +00:00
|
|
|
ucasemap_getLocale(const UCaseMap *csm);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the options bit set that is used for case folding and string comparisons.
|
|
|
|
* @param csm UCaseMap service object.
|
|
|
|
* @return options bit set
|
2007-08-19 08:59:28 +00:00
|
|
|
* @stable ICU 3.4
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
2007-08-19 08:59:28 +00:00
|
|
|
U_STABLE uint32_t U_EXPORT2
|
2005-05-20 17:31:12 +00:00
|
|
|
ucasemap_getOptions(const UCaseMap *csm);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the locale ID that is used for language-dependent case mappings.
|
|
|
|
*
|
|
|
|
* @param csm UCaseMap service object.
|
|
|
|
* @param locale Locale ID, see ucasemap_open().
|
|
|
|
* @param pErrorCode Must be a valid pointer to an error code value,
|
|
|
|
* which must not indicate a failure before the function call.
|
|
|
|
*
|
|
|
|
* @see ucasemap_open
|
2007-08-19 08:59:28 +00:00
|
|
|
* @stable ICU 3.4
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
2007-08-19 08:59:28 +00:00
|
|
|
U_STABLE void U_EXPORT2
|
2005-05-20 17:31:12 +00:00
|
|
|
ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the options bit set that is used for case folding and string comparisons.
|
|
|
|
*
|
|
|
|
* @param csm UCaseMap service object.
|
|
|
|
* @param options Options bit set, see ucasemap_open().
|
|
|
|
* @param pErrorCode Must be a valid pointer to an error code value,
|
|
|
|
* which must not indicate a failure before the function call.
|
|
|
|
*
|
|
|
|
* @see ucasemap_open
|
2007-08-19 08:59:28 +00:00
|
|
|
* @stable ICU 3.4
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
2007-08-19 08:59:28 +00:00
|
|
|
U_STABLE void U_EXPORT2
|
2005-05-20 17:31:12 +00:00
|
|
|
ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode);
|
|
|
|
|
2007-07-27 06:37:08 +00:00
|
|
|
/**
|
|
|
|
* Do not lowercase non-initial parts of words when titlecasing.
|
|
|
|
* Option bit for titlecasing APIs that take an options bit set.
|
|
|
|
*
|
|
|
|
* By default, titlecasing will titlecase the first cased character
|
|
|
|
* of a word and lowercase all other characters.
|
|
|
|
* With this option, the other characters will not be modified.
|
|
|
|
*
|
|
|
|
* @see ucasemap_setOptions
|
|
|
|
* @see ucasemap_toTitle
|
|
|
|
* @see ucasemap_utf8ToTitle
|
|
|
|
* @see UnicodeString::toTitle
|
2008-07-21 18:57:26 +00:00
|
|
|
* @stable ICU 3.8
|
2007-07-27 06:37:08 +00:00
|
|
|
*/
|
|
|
|
#define U_TITLECASE_NO_LOWERCASE 0x100
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Do not adjust the titlecasing indexes from BreakIterator::next() indexes;
|
|
|
|
* titlecase exactly the characters at breaks from the iterator.
|
|
|
|
* Option bit for titlecasing APIs that take an options bit set.
|
|
|
|
*
|
|
|
|
* By default, titlecasing will take each break iterator index,
|
|
|
|
* adjust it by looking for the next cased character, and titlecase that one.
|
|
|
|
* Other characters are lowercased.
|
|
|
|
*
|
|
|
|
* This follows Unicode 4 & 5 section 3.13 Default Case Operations:
|
|
|
|
*
|
|
|
|
* R3 toTitlecase(X): Find the word boundaries based on Unicode Standard Annex
|
|
|
|
* #29, "Text Boundaries." Between each pair of word boundaries, find the first
|
|
|
|
* cased character F. If F exists, map F to default_title(F); then map each
|
|
|
|
* subsequent character C to default_lower(C).
|
|
|
|
*
|
|
|
|
* @see ucasemap_setOptions
|
|
|
|
* @see ucasemap_toTitle
|
|
|
|
* @see ucasemap_utf8ToTitle
|
|
|
|
* @see UnicodeString::toTitle
|
|
|
|
* @see U_TITLECASE_NO_LOWERCASE
|
2008-07-21 18:57:26 +00:00
|
|
|
* @stable ICU 3.8
|
2007-07-27 06:37:08 +00:00
|
|
|
*/
|
|
|
|
#define U_TITLECASE_NO_BREAK_ADJUSTMENT 0x200
|
|
|
|
|
|
|
|
#if !UCONFIG_NO_BREAK_ITERATION
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the break iterator that is used for titlecasing.
|
|
|
|
* Do not modify the returned break iterator.
|
|
|
|
* @param csm UCaseMap service object.
|
|
|
|
* @return titlecasing break iterator
|
2008-07-21 18:57:26 +00:00
|
|
|
* @stable ICU 3.8
|
2007-07-27 06:37:08 +00:00
|
|
|
*/
|
2010-02-02 01:44:11 +00:00
|
|
|
U_STABLE const UBreakIterator * U_EXPORT2
|
2007-07-27 06:37:08 +00:00
|
|
|
ucasemap_getBreakIterator(const UCaseMap *csm);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the break iterator that is used for titlecasing.
|
|
|
|
* The UCaseMap service object releases a previously set break iterator
|
|
|
|
* and "adopts" this new one, taking ownership of it.
|
|
|
|
* It will be released in a subsequent call to ucasemap_setBreakIterator()
|
|
|
|
* or ucasemap_close().
|
|
|
|
*
|
|
|
|
* Break iterator operations are not thread-safe. Therefore, titlecasing
|
|
|
|
* functions use non-const UCaseMap objects. It is not possible to titlecase
|
|
|
|
* strings concurrently using the same UCaseMap.
|
|
|
|
*
|
|
|
|
* @param csm UCaseMap service object.
|
|
|
|
* @param iterToAdopt Break iterator to be adopted for titlecasing.
|
|
|
|
* @param pErrorCode Must be a valid pointer to an error code value,
|
|
|
|
* which must not indicate a failure before the function call.
|
|
|
|
*
|
|
|
|
* @see ucasemap_toTitle
|
|
|
|
* @see ucasemap_utf8ToTitle
|
2008-07-21 18:57:26 +00:00
|
|
|
* @stable ICU 3.8
|
2007-07-27 06:37:08 +00:00
|
|
|
*/
|
2010-02-02 01:44:11 +00:00
|
|
|
U_STABLE void U_EXPORT2
|
2007-07-27 06:37:08 +00:00
|
|
|
ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode *pErrorCode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Titlecase a UTF-16 string. This function is almost a duplicate of u_strToTitle(),
|
|
|
|
* except that it takes ucasemap_setOptions() into account and has performance
|
|
|
|
* advantages from being able to use a UCaseMap object for multiple case mapping
|
|
|
|
* operations, saving setup time.
|
|
|
|
*
|
|
|
|
* Casing is locale-dependent and context-sensitive.
|
|
|
|
* Titlecasing uses a break iterator to find the first characters of words
|
|
|
|
* that are to be titlecased. It titlecases those characters and lowercases
|
|
|
|
* all others. (This can be modified with ucasemap_setOptions().)
|
|
|
|
*
|
2009-04-24 00:37:01 +00:00
|
|
|
* Note: This function takes a non-const UCaseMap pointer because it will
|
|
|
|
* open a default break iterator if no break iterator was set yet,
|
|
|
|
* and effectively call ucasemap_setBreakIterator();
|
|
|
|
* also because the break iterator is stateful and will be modified during
|
|
|
|
* the iteration.
|
|
|
|
*
|
2007-07-27 06:37:08 +00:00
|
|
|
* The titlecase break iterator can be provided to customize for arbitrary
|
|
|
|
* styles, using rules and dictionaries beyond the standard iterators.
|
|
|
|
* The standard titlecase iterator for the root locale implements the
|
|
|
|
* algorithm of Unicode TR 21.
|
|
|
|
*
|
2009-04-24 00:37:01 +00:00
|
|
|
* This function uses only the setUText(), first(), next() and close() methods of the
|
2007-07-27 06:37:08 +00:00
|
|
|
* provided break iterator.
|
|
|
|
*
|
|
|
|
* The result may be longer or shorter than the original.
|
|
|
|
* The source string and the destination buffer must not overlap.
|
|
|
|
*
|
2009-04-24 00:37:01 +00:00
|
|
|
* @param csm UCaseMap service object. This pointer is non-const!
|
|
|
|
* See the note above for details.
|
2007-07-27 06:37:08 +00:00
|
|
|
* @param dest A buffer for the result string. The result will be NUL-terminated if
|
|
|
|
* the buffer is large enough.
|
|
|
|
* The contents is undefined in case of failure.
|
|
|
|
* @param destCapacity The size of the buffer (number of bytes). If it is 0, then
|
|
|
|
* dest may be NULL and the function will only return the length of the result
|
|
|
|
* without writing any of the result string.
|
|
|
|
* @param src The original string.
|
|
|
|
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
|
|
|
* @param pErrorCode Must be a valid pointer to an error code value,
|
|
|
|
* which must not indicate a failure before the function call.
|
|
|
|
* @return The length of the result string, if successful - or in case of a buffer overflow,
|
|
|
|
* in which case it will be greater than destCapacity.
|
|
|
|
*
|
|
|
|
* @see u_strToTitle
|
2008-07-21 18:57:26 +00:00
|
|
|
* @stable ICU 3.8
|
2007-07-27 06:37:08 +00:00
|
|
|
*/
|
2010-02-02 01:44:11 +00:00
|
|
|
U_STABLE int32_t U_EXPORT2
|
2007-07-27 06:37:08 +00:00
|
|
|
ucasemap_toTitle(UCaseMap *csm,
|
|
|
|
UChar *dest, int32_t destCapacity,
|
|
|
|
const UChar *src, int32_t srcLength,
|
|
|
|
UErrorCode *pErrorCode);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2005-05-20 17:31:12 +00:00
|
|
|
/**
|
|
|
|
* Lowercase the characters in a UTF-8 string.
|
|
|
|
* Casing is locale-dependent and context-sensitive.
|
|
|
|
* The result may be longer or shorter than the original.
|
|
|
|
* The source string and the destination buffer must not overlap.
|
|
|
|
*
|
|
|
|
* @param csm UCaseMap service object.
|
|
|
|
* @param dest A buffer for the result string. The result will be NUL-terminated if
|
|
|
|
* the buffer is large enough.
|
|
|
|
* The contents is undefined in case of failure.
|
|
|
|
* @param destCapacity The size of the buffer (number of bytes). If it is 0, then
|
|
|
|
* dest may be NULL and the function will only return the length of the result
|
|
|
|
* without writing any of the result string.
|
2007-07-27 06:37:08 +00:00
|
|
|
* @param src The original string.
|
2005-05-20 17:31:12 +00:00
|
|
|
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
|
|
|
* @param pErrorCode Must be a valid pointer to an error code value,
|
|
|
|
* which must not indicate a failure before the function call.
|
|
|
|
* @return The length of the result string, if successful - or in case of a buffer overflow,
|
|
|
|
* in which case it will be greater than destCapacity.
|
|
|
|
*
|
|
|
|
* @see u_strToLower
|
2007-08-19 08:59:28 +00:00
|
|
|
* @stable ICU 3.4
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
2007-08-19 08:59:28 +00:00
|
|
|
U_STABLE int32_t U_EXPORT2
|
2005-05-20 17:31:12 +00:00
|
|
|
ucasemap_utf8ToLower(const UCaseMap *csm,
|
|
|
|
char *dest, int32_t destCapacity,
|
|
|
|
const char *src, int32_t srcLength,
|
|
|
|
UErrorCode *pErrorCode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Uppercase the characters in a UTF-8 string.
|
|
|
|
* Casing is locale-dependent and context-sensitive.
|
|
|
|
* The result may be longer or shorter than the original.
|
|
|
|
* The source string and the destination buffer must not overlap.
|
|
|
|
*
|
|
|
|
* @param csm UCaseMap service object.
|
|
|
|
* @param dest A buffer for the result string. The result will be NUL-terminated if
|
|
|
|
* the buffer is large enough.
|
|
|
|
* The contents is undefined in case of failure.
|
|
|
|
* @param destCapacity The size of the buffer (number of bytes). If it is 0, then
|
|
|
|
* dest may be NULL and the function will only return the length of the result
|
|
|
|
* without writing any of the result string.
|
2007-07-27 06:37:08 +00:00
|
|
|
* @param src The original string.
|
2005-05-20 17:31:12 +00:00
|
|
|
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
|
|
|
* @param pErrorCode Must be a valid pointer to an error code value,
|
|
|
|
* which must not indicate a failure before the function call.
|
|
|
|
* @return The length of the result string, if successful - or in case of a buffer overflow,
|
|
|
|
* in which case it will be greater than destCapacity.
|
|
|
|
*
|
|
|
|
* @see u_strToUpper
|
2007-08-19 08:59:28 +00:00
|
|
|
* @stable ICU 3.4
|
2005-05-20 17:31:12 +00:00
|
|
|
*/
|
2007-08-19 08:59:28 +00:00
|
|
|
U_STABLE int32_t U_EXPORT2
|
2005-05-20 17:31:12 +00:00
|
|
|
ucasemap_utf8ToUpper(const UCaseMap *csm,
|
|
|
|
char *dest, int32_t destCapacity,
|
|
|
|
const char *src, int32_t srcLength,
|
|
|
|
UErrorCode *pErrorCode);
|
|
|
|
|
2007-07-27 06:37:08 +00:00
|
|
|
#if !UCONFIG_NO_BREAK_ITERATION
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Titlecase a UTF-8 string.
|
|
|
|
* Casing is locale-dependent and context-sensitive.
|
|
|
|
* Titlecasing uses a break iterator to find the first characters of words
|
|
|
|
* that are to be titlecased. It titlecases those characters and lowercases
|
|
|
|
* all others. (This can be modified with ucasemap_setOptions().)
|
|
|
|
*
|
2009-04-24 00:37:01 +00:00
|
|
|
* Note: This function takes a non-const UCaseMap pointer because it will
|
|
|
|
* open a default break iterator if no break iterator was set yet,
|
|
|
|
* and effectively call ucasemap_setBreakIterator();
|
|
|
|
* also because the break iterator is stateful and will be modified during
|
|
|
|
* the iteration.
|
|
|
|
*
|
2007-07-27 06:37:08 +00:00
|
|
|
* The titlecase break iterator can be provided to customize for arbitrary
|
|
|
|
* styles, using rules and dictionaries beyond the standard iterators.
|
|
|
|
* The standard titlecase iterator for the root locale implements the
|
|
|
|
* algorithm of Unicode TR 21.
|
|
|
|
*
|
2009-04-24 00:37:01 +00:00
|
|
|
* This function uses only the setUText(), first(), next() and close() methods of the
|
2007-07-27 06:37:08 +00:00
|
|
|
* provided break iterator.
|
|
|
|
*
|
|
|
|
* The result may be longer or shorter than the original.
|
|
|
|
* The source string and the destination buffer must not overlap.
|
|
|
|
*
|
2009-04-24 00:37:01 +00:00
|
|
|
* @param csm UCaseMap service object. This pointer is non-const!
|
|
|
|
* See the note above for details.
|
2007-07-27 06:37:08 +00:00
|
|
|
* @param dest A buffer for the result string. The result will be NUL-terminated if
|
|
|
|
* the buffer is large enough.
|
|
|
|
* The contents is undefined in case of failure.
|
|
|
|
* @param destCapacity The size of the buffer (number of bytes). If it is 0, then
|
|
|
|
* dest may be NULL and the function will only return the length of the result
|
|
|
|
* without writing any of the result string.
|
|
|
|
* @param src The original string.
|
|
|
|
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
|
|
|
* @param pErrorCode Must be a valid pointer to an error code value,
|
|
|
|
* which must not indicate a failure before the function call.
|
|
|
|
* @return The length of the result string, if successful - or in case of a buffer overflow,
|
|
|
|
* in which case it will be greater than destCapacity.
|
|
|
|
*
|
|
|
|
* @see u_strToTitle
|
|
|
|
* @see U_TITLECASE_NO_LOWERCASE
|
|
|
|
* @see U_TITLECASE_NO_BREAK_ADJUSTMENT
|
2008-07-21 18:57:26 +00:00
|
|
|
* @stable ICU 3.8
|
2007-07-27 06:37:08 +00:00
|
|
|
*/
|
2010-02-02 01:44:11 +00:00
|
|
|
U_STABLE int32_t U_EXPORT2
|
2007-07-27 06:37:08 +00:00
|
|
|
ucasemap_utf8ToTitle(UCaseMap *csm,
|
|
|
|
char *dest, int32_t destCapacity,
|
|
|
|
const char *src, int32_t srcLength,
|
|
|
|
UErrorCode *pErrorCode);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Case-fold the characters in a UTF-8 string.
|
|
|
|
* Case-folding is locale-independent and not context-sensitive,
|
|
|
|
* but there is an option for whether to include or exclude mappings for dotted I
|
|
|
|
* and dotless i that are marked with 'I' in CaseFolding.txt.
|
|
|
|
* The result may be longer or shorter than the original.
|
|
|
|
* The source string and the destination buffer must not overlap.
|
|
|
|
*
|
|
|
|
* @param csm UCaseMap service object.
|
|
|
|
* @param dest A buffer for the result string. The result will be NUL-terminated if
|
|
|
|
* the buffer is large enough.
|
|
|
|
* The contents is undefined in case of failure.
|
|
|
|
* @param destCapacity The size of the buffer (number of bytes). If it is 0, then
|
|
|
|
* dest may be NULL and the function will only return the length of the result
|
|
|
|
* without writing any of the result string.
|
|
|
|
* @param src The original string.
|
|
|
|
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
|
|
|
* @param pErrorCode Must be a valid pointer to an error code value,
|
|
|
|
* which must not indicate a failure before the function call.
|
|
|
|
* @return The length of the result string, if successful - or in case of a buffer overflow,
|
|
|
|
* in which case it will be greater than destCapacity.
|
|
|
|
*
|
|
|
|
* @see u_strFoldCase
|
|
|
|
* @see ucasemap_setOptions
|
|
|
|
* @see U_FOLD_CASE_DEFAULT
|
|
|
|
* @see U_FOLD_CASE_EXCLUDE_SPECIAL_I
|
2008-07-21 18:57:26 +00:00
|
|
|
* @stable ICU 3.8
|
2007-07-27 06:37:08 +00:00
|
|
|
*/
|
2010-02-02 01:44:11 +00:00
|
|
|
U_STABLE int32_t U_EXPORT2
|
2007-07-27 06:37:08 +00:00
|
|
|
ucasemap_utf8FoldCase(const UCaseMap *csm,
|
|
|
|
char *dest, int32_t destCapacity,
|
|
|
|
const char *src, int32_t srcLength,
|
|
|
|
UErrorCode *pErrorCode);
|
|
|
|
|
2005-05-20 17:31:12 +00:00
|
|
|
#endif
|