ICU 59.1  59.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/ustring.h"
27 
46 struct UCaseMap;
47 typedef struct UCaseMap UCaseMap;
71 U_STABLE UCaseMap * U_EXPORT2
72 ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode);
73 
79 U_STABLE void U_EXPORT2
81 
82 #if U_SHOW_CPLUSPLUS_API
83 
85 
96 
98 
99 #endif
100 
107 U_STABLE const char * U_EXPORT2
108 ucasemap_getLocale(const UCaseMap *csm);
109 
116 U_STABLE uint32_t U_EXPORT2
117 ucasemap_getOptions(const UCaseMap *csm);
118 
130 U_STABLE void U_EXPORT2
131 ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode);
132 
144 U_STABLE void U_EXPORT2
145 ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode);
146 
161 #define U_TITLECASE_NO_LOWERCASE 0x100
162 
186 #define U_TITLECASE_NO_BREAK_ADJUSTMENT 0x200
187 
195 #define UCASEMAP_OMIT_UNCHANGED_TEXT 0x4000
196 
197 #if !UCONFIG_NO_BREAK_ITERATION
198 
206 U_STABLE const UBreakIterator * U_EXPORT2
208 
229 U_STABLE void U_EXPORT2
230 ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode *pErrorCode);
231 
278 U_STABLE int32_t U_EXPORT2
280  UChar *dest, int32_t destCapacity,
281  const UChar *src, int32_t srcLength,
282  UErrorCode *pErrorCode);
283 
284 #endif // UCONFIG_NO_BREAK_ITERATION
285 
309 U_STABLE int32_t U_EXPORT2
310 ucasemap_utf8ToLower(const UCaseMap *csm,
311  char *dest, int32_t destCapacity,
312  const char *src, int32_t srcLength,
313  UErrorCode *pErrorCode);
314 
338 U_STABLE int32_t U_EXPORT2
339 ucasemap_utf8ToUpper(const UCaseMap *csm,
340  char *dest, int32_t destCapacity,
341  const char *src, int32_t srcLength,
342  UErrorCode *pErrorCode);
343 
344 #if !UCONFIG_NO_BREAK_ITERATION
345 
390 U_STABLE int32_t U_EXPORT2
392  char *dest, int32_t destCapacity,
393  const char *src, int32_t srcLength,
394  UErrorCode *pErrorCode);
395 
396 #endif
397 
428 U_STABLE int32_t U_EXPORT2
430  char *dest, int32_t destCapacity,
431  const char *src, int32_t srcLength,
432  UErrorCode *pErrorCode);
433 
434 #endif
struct UBreakIterator UBreakIterator
Opaque type representing an ICU Break iterator object.
Definition: ubrk.h:28
int32_t ucasemap_utf8ToTitle(UCaseMap *csm, char *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode)
Titlecase a UTF-8 string.
"Smart pointer" class, closes a UCaseMap via ucasemap_close().
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.
struct UCaseMap UCaseMap
C typedef for struct UCaseMap.
Definition: ucasemap.h:47
int32_t ucasemap_toTitle(UCaseMap *csm, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, UErrorCode *pErrorCode)
Titlecase a UTF-16 string.
void ucasemap_close(UCaseMap *csm)
Close a UCaseMap service object.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:131
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:496
const char * ucasemap_getLocale(const UCaseMap *csm)
Get the locale ID that is used for language-dependent case mappings.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
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 * ucasemap_open(const char *locale, uint32_t options, UErrorCode *pErrorCode)
Open a UCaseMap service object for a locale and a set of options.
C API: Unicode string handling functions.
const UBreakIterator * ucasemap_getBreakIterator(const UCaseMap *csm)
Get the break iterator that is used for titlecasing.
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:349
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:132
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
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
void ucasemap_setBreakIterator(UCaseMap *csm, UBreakIterator *iterToAdopt, UErrorCode *pErrorCode)
Set the break iterator that is used for titlecasing.
void ucasemap_setLocale(UCaseMap *csm, const char *locale, UErrorCode *pErrorCode)
Set the locale ID that is used for language-dependent case mappings.
Basic definitions for ICU, for both C and C++ APIs.
uint32_t ucasemap_getOptions(const UCaseMap *csm)
Get the options bit set that is used for case folding and string comparisons.
void ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode)
Set the options bit set that is used for case folding and string comparisons.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111