ICU 71.1 71.1

umutablecptrie.h
Go to the documentation of this file.
1 // © 2017 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3
4 // umutablecptrie.h (split out of ucptrie.h)
5 // created: 2018jan24 Markus W. Scherer
6
7 #ifndef __UMUTABLECPTRIE_H__
8 #define __UMUTABLECPTRIE_H__
9
10 #include "unicode/utypes.h"
11
12 #include "unicode/ucpmap.h"
13 #include "unicode/ucptrie.h"
14 #include "unicode/utf8.h"
15
16 #if U_SHOW_CPLUSPLUS_API
17 #include "unicode/localpointer.h"
18 #endif // U_SHOW_CPLUSPLUS_API
19
20 U_CDECL_BEGIN
21
50 typedef struct UMutableCPTrie UMutableCPTrie;
51
65 U_CAPI UMutableCPTrie * U_EXPORT2
66 umutablecptrie_open(uint32_t initialValue, uint32_t errorValue, UErrorCode *pErrorCode);
67
77 U_CAPI UMutableCPTrie * U_EXPORT2
78 umutablecptrie_clone(const UMutableCPTrie *other, UErrorCode *pErrorCode);
79
86 U_CAPI void U_EXPORT2
87 umutablecptrie_close(UMutableCPTrie *trie);
88
98 U_CAPI UMutableCPTrie * U_EXPORT2
99 umutablecptrie_fromUCPMap(const UCPMap *map, UErrorCode *pErrorCode);
100
110 U_CAPI UMutableCPTrie * U_EXPORT2
111 umutablecptrie_fromUCPTrie(const UCPTrie *trie, UErrorCode *pErrorCode);
112
121 U_CAPI uint32_t U_EXPORT2
122 umutablecptrie_get(const UMutableCPTrie *trie, UChar32 c);
123
153 U_CAPI UChar32 U_EXPORT2
154 umutablecptrie_getRange(const UMutableCPTrie *trie, UChar32 start,
155 UCPMapRangeOption option, uint32_t surrogateValue,
156 UCPMapValueFilter *filter, const void *context, uint32_t *pValue);
157
167 U_CAPI void U_EXPORT2
168 umutablecptrie_set(UMutableCPTrie *trie, UChar32 c, uint32_t value, UErrorCode *pErrorCode);
169
181 U_CAPI void U_EXPORT2
182 umutablecptrie_setRange(UMutableCPTrie *trie,
183 UChar32 start, UChar32 end,
184 uint32_t value, UErrorCode *pErrorCode);
185
216 U_CAPI UCPTrie * U_EXPORT2
217 umutablecptrie_buildImmutable(UMutableCPTrie *trie, UCPTrieType type, UCPTrieValueWidth valueWidth,
218 UErrorCode *pErrorCode);
219
220 U_CDECL_END
221
222 #if U_SHOW_CPLUSPLUS_API
223
224 U_NAMESPACE_BEGIN
225
235 U_DEFINE_LOCAL_OPEN_POINTER(LocalUMutableCPTriePointer, UMutableCPTrie, umutablecptrie_close);
236
237 U_NAMESPACE_END
238
239 #endif
240
241 #endif
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UCPTrieType
UCPTrieType
Selectors for the type of a UCPTrie.
Definition: ucptrie.h:120
umutablecptrie_get
U_CAPI uint32_t umutablecptrie_get(const UMutableCPTrie *trie, UChar32 c)
Returns the value for a code point as stored in the trie.
umutablecptrie_close
U_CAPI void umutablecptrie_close(UMutableCPTrie *trie)
Closes a mutable trie and releases associated memory.
UCPTrieValueWidth
UCPTrieValueWidth
Selectors for the number of bits in a UCPTrie data value.
Definition: ucptrie.h:150
umutablecptrie_buildImmutable
U_CAPI UCPTrie * umutablecptrie_buildImmutable(UMutableCPTrie *trie, UCPTrieType type, UCPTrieValueWidth valueWidth, UErrorCode *pErrorCode)
Compacts the data and builds an immutable UCPTrie according to the parameters.
LocalUMutableCPTriePointer
UCPMapRangeOption
UCPMapRangeOption
Selectors for how ucpmap_getRange() etc.
Definition: ucpmap.h:42
umutablecptrie_fromUCPTrie
U_CAPI UMutableCPTrie * umutablecptrie_fromUCPTrie(const UCPTrie *trie, UErrorCode *pErrorCode)
Creates a mutable trie with the same contents as the immutable one.
umutablecptrie_getRange
U_CAPI UChar32 umutablecptrie_getRange(const UMutableCPTrie *trie, UChar32 start, UCPMapRangeOption option, uint32_t surrogateValue, UCPMapValueFilter *filter, const void *context, uint32_t *pValue)
Returns the last code point such that all those from start to there have the same value.
UCPTrie
Immutable Unicode code point trie structure.
Definition: ucptrie.h:60
umutablecptrie_fromUCPMap
U_CAPI UMutableCPTrie * umutablecptrie_fromUCPMap(const UCPMap *map, UErrorCode *pErrorCode)
Creates a mutable trie with the same contents as the UCPMap.
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:467
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
UCPMapValueFilter
uint32_t UCPMapValueFilter(const void *context, uint32_t value)
Callback function type: Modifies a map value.
Definition: ucpmap.h:114
U_CDECL_END
#define U_CDECL_END
Definition: umachine.h:86
UCPMap
struct UCPMap UCPMap
Abstract map from Unicode code points (U+0000..U+10FFFF) to integer values.
Definition: ucpmap.h:31
U_CDECL_BEGIN
#define U_CDECL_BEGIN
Definition: umachine.h:85
umutablecptrie_set
U_CAPI void umutablecptrie_set(UMutableCPTrie *trie, UChar32 c, uint32_t value, UErrorCode *pErrorCode)
Sets a value for a code point.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
Definition: localpointer.h:550
ucpmap.h
utf8.h
C API: 8-bit Unicode handling macros.
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
umutablecptrie_clone
U_CAPI UMutableCPTrie * umutablecptrie_clone(const UMutableCPTrie *other, UErrorCode *pErrorCode)
Clones a mutable trie.
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
UMutableCPTrie
struct UMutableCPTrie UMutableCPTrie
Mutable Unicode code point trie.
Definition: umutablecptrie.h:50
umutablecptrie_open
U_CAPI UMutableCPTrie * umutablecptrie_open(uint32_t initialValue, uint32_t errorValue, UErrorCode *pErrorCode)
Creates a mutable trie that initially maps each Unicode code point to the same value.
umutablecptrie_setRange
U_CAPI void umutablecptrie_setRange(UMutableCPTrie *trie, UChar32 start, UChar32 end, uint32_t value, UErrorCode *pErrorCode)
Sets a value for each code point [start..end].
ucptrie.h