#include "unicode/utypes.h"
#include "unicode/ustring.h"
Go to the source code of this file.
Typedefs | |
typedef UCaseMap | UCaseMap |
C typedef for struct UCaseMap. | |
Functions | |
UCaseMap * | ucasemap_open (const char *locale, uint32_t options, UErrorCode *pErrorCode) |
Open a UCaseMap service object for a locale and a set of options. | |
void | ucasemap_close (UCaseMap *csm) |
Close a UCaseMap service object. | |
const char * | ucasemap_getLocale (const UCaseMap *csm) |
Get the locale ID that is used for language-dependent case mappings. | |
uint32_t | ucasemap_getOptions (const UCaseMap *csm) |
Get the options bit set that is used for case folding and string comparisons. | |
void | ucasemap_setLocale (UCaseMap *csm, const char *locale, UErrorCode *pErrorCode) |
Set the locale ID that is used for language-dependent case mappings. | |
void | ucasemap_setOptions (UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode) |
Set the options bit set that is used for case folding and string comparisons. | |
int32_t | ucasemap_utf8ToLower (const UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode) |
Lowercase the characters in a UTF-8 string. | |
int32_t | ucasemap_utf8ToUpper (const UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode) |
Uppercase the characters in a UTF-8 string. |
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 and ustring.h.
ucasemap_utf8ToLower() and ucasemap_utf8ToUpper() operate directly on UTF-8 strings.
Definition in file ucasemap.h.
C typedef for struct UCaseMap.
Definition at line 45 of file ucasemap.h.
void ucasemap_close | ( | UCaseMap * | csm | ) |
Close a UCaseMap service object.
csm | Object to be closed. |
const char* ucasemap_getLocale | ( | const UCaseMap * | csm | ) |
Get the locale ID that is used for language-dependent case mappings.
csm | UCaseMap service object. |
Get the options bit set that is used for case folding and string comparisons.
csm | UCaseMap service object. |
UCaseMap* ucasemap_open | ( | const char * | locale, | |
uint32_t | options, | |||
UErrorCode * | pErrorCode | |||
) |
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.
locale | ICU locale ID, used for language-dependent upper-/lower-/title-casing according to the Unicode standard. Usual semantics: ""=root, NULL=default locale, etc. | |
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. | |
pErrorCode | Must be a valid pointer to an error code value, which must not indicate a failure before the function call. |
void ucasemap_setLocale | ( | UCaseMap * | csm, | |
const char * | locale, | |||
UErrorCode * | pErrorCode | |||
) |
Set the locale ID that is used for language-dependent case mappings.
csm | UCaseMap service object. | |
locale | Locale ID, see ucasemap_open(). | |
pErrorCode | Must be a valid pointer to an error code value, which must not indicate a failure before the function call. |
void ucasemap_setOptions | ( | UCaseMap * | csm, | |
uint32_t | options, | |||
UErrorCode * | pErrorCode | |||
) |
Set the options bit set that is used for case folding and string comparisons.
csm | UCaseMap service object. | |
options | Options bit set, see ucasemap_open(). | |
pErrorCode | Must be a valid pointer to an error code value, which must not indicate a failure before the function call. |
int32_t ucasemap_utf8ToLower | ( | const UCaseMap * | csm, | |
char * | dest, | |||
int32_t | destCapacity, | |||
const char * | src, | |||
int32_t | srcLength, | |||
UErrorCode * | pErrorCode | |||
) |
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.
csm | UCaseMap service object. | |
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. | |
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. | |
src | The original string | |
srcLength | The length of the original string. If -1, then src must be NUL-terminated. | |
pErrorCode | Must be a valid pointer to an error code value, which must not indicate a failure before the function call. |
int32_t ucasemap_utf8ToUpper | ( | 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.
csm | UCaseMap service object. | |
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. | |
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. | |
src | The original string | |
srcLength | The length of the original string. If -1, then src must be NUL-terminated. | |
pErrorCode | Must be a valid pointer to an error code value, which must not indicate a failure before the function call. |