ICU 69.1: ucasemap.h Source File

ICU 69.1 69.1

ucasemap.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 *
6 * Copyright (C) 2005-2012, International Business Machines
7 * Corporation and others. All Rights Reserved.
8 *
9 *******************************************************************************
10 * file name: ucasemap.h
11 * encoding: UTF-8
12 * tab size: 8 (not used)
13 * indentation:4
14 *
15 * created on: 2005may06
16 * created by: Markus W. Scherer
17 *
18 * Case mapping service object and functions using it.
19 */
20
21 #ifndef __UCASEMAP_H__
22 #define __UCASEMAP_H__
23
24 #include "unicode/utypes.h"
25 #include "unicode/stringoptions.h"
26 #include "unicode/ustring.h"
27
28 #if U_SHOW_CPLUSPLUS_API
29 #include "unicode/localpointer.h"
30 #endif // U_SHOW_CPLUSPLUS_API
31
50 struct UCaseMap;
51 typedef struct UCaseMap UCaseMap;
75 U_CAPI UCaseMap * U_EXPORT2
76 ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode);
77
83 U_CAPI void U_EXPORT2
84 ucasemap_close(UCaseMap *csm);
85
86 #if U_SHOW_CPLUSPLUS_API
87
88 U_NAMESPACE_BEGIN
89
99 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCaseMapPointer, UCaseMap, ucasemap_close);
100
101 U_NAMESPACE_END
102
103 #endif
104
111 U_CAPI const char * U_EXPORT2
112 ucasemap_getLocale(const UCaseMap *csm);
113
120 U_CAPI uint32_t U_EXPORT2
121 ucasemap_getOptions(const UCaseMap *csm);
122
134 U_CAPI void U_EXPORT2
135 ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode);
136
148 U_CAPI void U_EXPORT2
149 ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode);
150
151 #if !UCONFIG_NO_BREAK_ITERATION
152
160 U_CAPI const UBreakIterator * U_EXPORT2
161 ucasemap_getBreakIterator(const UCaseMap *csm);
162
183 U_CAPI void U_EXPORT2
184 ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode *pErrorCode);
185
232 U_CAPI int32_t U_EXPORT2
233 ucasemap_toTitle(UCaseMap *csm,
234 UChar *dest, int32_t destCapacity,
235 const UChar *src, int32_t srcLength,
236 UErrorCode *pErrorCode);
237
238 #endif // UCONFIG_NO_BREAK_ITERATION
239
263 U_CAPI int32_t U_EXPORT2
264 ucasemap_utf8ToLower(const UCaseMap *csm,
265 char *dest, int32_t destCapacity,
266 const char *src, int32_t srcLength,
267 UErrorCode *pErrorCode);
268
292 U_CAPI int32_t U_EXPORT2
293 ucasemap_utf8ToUpper(const UCaseMap *csm,
294 char *dest, int32_t destCapacity,
295 const char *src, int32_t srcLength,
296 UErrorCode *pErrorCode);
297
298 #if !UCONFIG_NO_BREAK_ITERATION
299
344 U_CAPI int32_t U_EXPORT2
345 ucasemap_utf8ToTitle(UCaseMap *csm,
346 char *dest, int32_t destCapacity,
347 const char *src, int32_t srcLength,
348 UErrorCode *pErrorCode);
349
350 #endif
351
382 U_CAPI int32_t U_EXPORT2
383 ucasemap_utf8FoldCase(const UCaseMap *csm,
384 char *dest, int32_t destCapacity,
385 const char *src, int32_t srcLength,
386 UErrorCode *pErrorCode);
387
388 #endif
LocalUCaseMapPointer
"Smart pointer" class, closes a UCaseMap via ucasemap_close().
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:550
stringoptions.h
C API: Bit set option bit constants for various string and character processing functions.
UBreakIterator
struct UBreakIterator UBreakIterator
Opaque type representing an ICU Break iterator object.
Definition: ubrk.h:31
ucasemap_getOptions
U_CAPI uint32_t ucasemap_getOptions(const UCaseMap *csm)
Get the options bit set that is used for case folding and string comparisons.
ucasemap_utf8ToLower
U_CAPI 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.
ucasemap_setOptions
U_CAPI void ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode)
Set the options bit set that is used for case folding and string comparisons.
ucasemap_utf8FoldCase
U_CAPI int32_t ucasemap_utf8FoldCase(const UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode)
Case-folds the characters in a UTF-8 string.
ucasemap_utf8ToUpper
U_CAPI 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.
UCaseMap
struct UCaseMap UCaseMap
C typedef for struct UCaseMap.
Definition: ucasemap.h:51
ucasemap_close
U_CAPI void ucasemap_close(UCaseMap *csm)
Close a UCaseMap service object.
ucasemap_utf8ToTitle
U_CAPI int32_t ucasemap_utf8ToTitle(UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode)
Titlecase a UTF-8 string.
ucasemap_setBreakIterator
U_CAPI void ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode *pErrorCode)
Set the break iterator that is used for titlecasing.
ucasemap_open
U_CAPI UCaseMap * ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode)
Open a UCaseMap service object for a locale and a set of options.
ucasemap_toTitle
U_CAPI int32_t ucasemap_toTitle(UCaseMap *csm, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, UErrorCode *pErrorCode)
Titlecase a UTF-16 string.
ucasemap_getBreakIterator
U_CAPI const UBreakIterator * ucasemap_getBreakIterator(const UCaseMap *csm)
Get the break iterator that is used for titlecasing.
ucasemap_setLocale
U_CAPI void ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode)
Set the locale ID that is used for language-dependent case mappings.
ucasemap_getLocale
U_CAPI const char * ucasemap_getLocale(const UCaseMap *csm)
Get the locale ID that is used for language-dependent case mappings.
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:418
ustring.h
C API: Unicode string handling functions.
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