umutablecptrie.h
Go to the documentation of this file.
// © 2017 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
// umutablecptrie.h (split out of ucptrie.h)
// created: 2018jan24 Markus W. Scherer
#ifndef __UMUTABLECPTRIE_H__
#define __UMUTABLECPTRIE_H__
#include "unicode/utypes.h"
#include "unicode/ucpmap.h"
#include "unicode/ucptrie.h"
#include "unicode/utf8.h"
#if U_SHOW_CPLUSPLUS_API
#include "unicode/localpointer.h"
#endif // U_SHOW_CPLUSPLUS_API
U_CDECL_BEGIN
typedef struct UMutableCPTrie UMutableCPTrie;
U_CAPI UMutableCPTrie * U_EXPORT2
umutablecptrie_open(uint32_t initialValue, uint32_t errorValue, UErrorCode *pErrorCode);
U_CAPI UMutableCPTrie * U_EXPORT2
umutablecptrie_clone(const UMutableCPTrie *other, UErrorCode *pErrorCode);
U_CAPI void U_EXPORT2
umutablecptrie_close(UMutableCPTrie *trie);
U_CAPI UMutableCPTrie * U_EXPORT2
umutablecptrie_fromUCPMap(const UCPMap *map, UErrorCode *pErrorCode);
U_CAPI UMutableCPTrie * U_EXPORT2
umutablecptrie_fromUCPTrie(const UCPTrie *trie, UErrorCode *pErrorCode);
U_CAPI uint32_t U_EXPORT2
umutablecptrie_get(const UMutableCPTrie *trie, UChar32 c);
U_CAPI UChar32 U_EXPORT2
umutablecptrie_getRange(const UMutableCPTrie *trie, UChar32 start,
UCPMapRangeOption option, uint32_t surrogateValue,
UCPMapValueFilter *filter, const void *context, uint32_t *pValue);
U_CAPI void U_EXPORT2
umutablecptrie_set(UMutableCPTrie *trie, UChar32 c, uint32_t value, UErrorCode *pErrorCode);
U_CAPI void U_EXPORT2
umutablecptrie_setRange(UMutableCPTrie *trie,
UChar32 start, UChar32 end,
uint32_t value, UErrorCode *pErrorCode);
U_CAPI UCPTrie * U_EXPORT2
umutablecptrie_buildImmutable(UMutableCPTrie *trie, UCPTrieType type, UCPTrieValueWidth valueWidth,
UErrorCode *pErrorCode);
U_CDECL_END
#if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN
U_DEFINE_LOCAL_OPEN_POINTER(LocalUMutableCPTriePointer, UMutableCPTrie, umutablecptrie_close);
U_NAMESPACE_END
#endif
#endif
LocalUMutableCPTriePointer
"Smart pointer" class, closes a UMutableCPTrie via umutablecptrie_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
UCPTrie
Immutable Unicode code point trie structure.
Definition: ucptrie.h:59
ucpmap.h
C API: This file defines an abstract map from Unicode code points to integer values.
UCPMapValueFilter
uint32_t UCPMapValueFilter(const void *context, uint32_t value)
Callback function type: Modifies a map value.
Definition: ucpmap.h:113
UCPMap
struct UCPMap UCPMap
Abstract map from Unicode code points (U+0000..U+10FFFF) to integer values.
Definition: ucpmap.h:30
UCPMapRangeOption
UCPMapRangeOption
Selectors for how ucpmap_getRange() etc.
Definition: ucpmap.h:41
ucptrie.h
C API: This file defines an immutable Unicode code point trie.
UCPTrieType
UCPTrieType
Selectors for the type of a UCPTrie.
Definition: ucptrie.h:119
UCPTrieValueWidth
UCPTrieValueWidth
Selectors for the number of bits in a UCPTrie data value.
Definition: ucptrie.h:149
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:435
U_CDECL_END
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
Definition: umachine.h:86
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
U_CDECL_BEGIN
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Definition: umachine.h:85
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_close
U_CAPI void umutablecptrie_close(UMutableCPTrie *trie)
Closes a mutable trie and releases associated memory.
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_set
U_CAPI void umutablecptrie_set(UMutableCPTrie *trie, UChar32 c, uint32_t value, UErrorCode *pErrorCode)
Sets a value for a code point.
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.
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.
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].
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_fromUCPMap
U_CAPI UMutableCPTrie * umutablecptrie_fromUCPMap(const UCPMap *map, UErrorCode *pErrorCode)
Creates a mutable trie with the same contents as the UCPMap.
UMutableCPTrie
struct UMutableCPTrie UMutableCPTrie
Mutable Unicode code point trie.
Definition: umutablecptrie.h:49
umutablecptrie_clone
U_CAPI UMutableCPTrie * umutablecptrie_clone(const UMutableCPTrie *other, UErrorCode *pErrorCode)
Clones a mutable trie.
utf8.h
C API: 8-bit Unicode handling macros.
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