ICU 65.1 65.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/localpointer.h"
26 #include "unicode/stringoptions.h"
27 #include "unicode/ustring.h"
28
47 struct UCaseMap;
48 typedef struct UCaseMap UCaseMap;
72 U_STABLE UCaseMap * U_EXPORT2
73 ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode);
74
80 U_STABLE void U_EXPORT2
81 ucasemap_close(UCaseMap *csm);
82
83 #if U_SHOW_CPLUSPLUS_API
84
85 U_NAMESPACE_BEGIN
86
96 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCaseMapPointer, UCaseMap, ucasemap_close);
97
98 U_NAMESPACE_END
99
100 #endif
101
108 U_STABLE const char * U_EXPORT2
109 ucasemap_getLocale(const UCaseMap *csm);
110
117 U_STABLE uint32_t U_EXPORT2
118 ucasemap_getOptions(const UCaseMap *csm);
119
131 U_STABLE void U_EXPORT2
132 ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode);
133
145 U_STABLE void U_EXPORT2
146 ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode);
147
148 #if !UCONFIG_NO_BREAK_ITERATION
149
157 U_STABLE const UBreakIterator * U_EXPORT2
158 ucasemap_getBreakIterator(const UCaseMap *csm);
159
180 U_STABLE void U_EXPORT2
181 ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode *pErrorCode);
182
229 U_STABLE int32_t U_EXPORT2
230 ucasemap_toTitle(UCaseMap *csm,
231 UChar *dest, int32_t destCapacity,
232 const UChar *src, int32_t srcLength,
233 UErrorCode *pErrorCode);
234
235 #endif // UCONFIG_NO_BREAK_ITERATION
236
260 U_STABLE int32_t U_EXPORT2
261 ucasemap_utf8ToLower(const UCaseMap *csm,
262 char *dest, int32_t destCapacity,
263 const char *src, int32_t srcLength,
264 UErrorCode *pErrorCode);
265
289 U_STABLE int32_t U_EXPORT2
290 ucasemap_utf8ToUpper(const UCaseMap *csm,
291 char *dest, int32_t destCapacity,
292 const char *src, int32_t srcLength,
293 UErrorCode *pErrorCode);
294
295 #if !UCONFIG_NO_BREAK_ITERATION
296
341 U_STABLE int32_t U_EXPORT2
342 ucasemap_utf8ToTitle(UCaseMap *csm,
343 char *dest, int32_t destCapacity,
344 const char *src, int32_t srcLength,
345 UErrorCode *pErrorCode);
346
347 #endif
348
379 U_STABLE int32_t U_EXPORT2
380 ucasemap_utf8FoldCase(const UCaseMap *csm,
381 char *dest, int32_t destCapacity,
382 const char *src, int32_t srcLength,
383 UErrorCode *pErrorCode);
384
385 #endif
UBreakIterator
struct UBreakIterator UBreakIterator
Opaque type representing an ICU Break iterator object.
Definition: ubrk.h:28
ucasemap_utf8ToTitle
int32_t ucasemap_utf8ToTitle(UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode)
Titlecase a UTF-8 string.
LocalUCaseMapPointer
"Smart pointer" class, closes a UCaseMap via ucasemap_close().
stringoptions.h
C API: Bit set option bit constants for various string and character processing functions.
ucasemap_utf8FoldCase
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
struct UCaseMap UCaseMap
C typedef for struct UCaseMap.
Definition: ucasemap.h:48
ucasemap_toTitle
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_close
void ucasemap_close(UCaseMap *csm)
Close a UCaseMap service object.
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:562
ucasemap_getLocale
const char * ucasemap_getLocale(const UCaseMap *csm)
Get the locale ID that is used for language-dependent case mappings.
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
ucasemap_utf8ToLower
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_open
UCaseMap * ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode)
Open a UCaseMap service object for a locale and a set of options.
ustring.h
C API: Unicode string handling functions.
ucasemap_getBreakIterator
const UBreakIterator * ucasemap_getBreakIterator(const UCaseMap *csm)
Get the break iterator that is used for titlecasing.
UChar
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:378
ucasemap_utf8ToUpper
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.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
ucasemap_setBreakIterator
void ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode *pErrorCode)
Set the break iterator that is used for titlecasing.
ucasemap_setLocale
void ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode)
Set the locale ID that is used for language-dependent case mappings.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
ucasemap_getOptions
uint32_t ucasemap_getOptions(const UCaseMap *csm)
Get the options bit set that is used for case folding and string comparisons.
ucasemap_setOptions
void ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode)
Set the options bit set that is used for case folding and string comparisons.
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111