C API: This file defines a mutable Unicode code point trie. More...
Go to the source code of this file.
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. More...C API: This file defines a mutable Unicode code point trie.
Definition in file umutablecptrie.h.
◆ UMutableCPTrieMutable Unicode code point trie.
Fast map from Unicode code points (U+0000..U+10FFFF) to 32-bit integer values. For details see https://icu.unicode.org/design/struct/utrie
Setting values (especially ranges) and lookup is fast. The mutable trie is only somewhat space-efficient. It builds a compacted, immutable UCPTrie.
This trie can be modified while iterating over its contents. For example, it is possible to merge its values with those from another set of ranges (e.g., another mutable or immutable trie): Iterate over those source ranges; for each of them iterate over this trie; add the source value into the value of each trie range.
Definition at line 1 of file umutablecptrie.h.
◆ umutablecptrie_buildImmutable()Compacts the data and builds an immutable UCPTrie according to the parameters.
After this, the mutable trie will be empty.
The mutable trie stores 32-bit values until buildImmutable() is called. If values shorter than 32 bits are to be stored in the immutable trie, then the upper bits are discarded. For example, when the mutable trie contains values 0x81, -0x7f, and 0xa581, and the value width is 8 bits, then each of these is stored as 0x81 and the immutable trie will return that as an unsigned value. (Some implementations may want to make productive temporary use of the upper bits until buildImmutable() discards them.)
Not every possible set of mappings can be built into a UCPTrie, because of limitations resulting from speed and space optimizations. Every Unicode assigned character can be mapped to a unique value. Typical data yields data structures far smaller than the limitations.
It is possible to construct extremely unusual mappings that exceed the data structure limits. In such a case this function will fail with a U_INDEX_OUTOFBOUNDS_ERROR.
Clones a mutable trie.
You must umutablecptrie_close() the clone once you are done using it.
Closes a mutable trie and releases associated memory.
Creates a mutable trie with the same contents as the UCPMap.
You must umutablecptrie_close() the mutable trie once you are done using it.
Creates a mutable trie with the same contents as the immutable one.
You must umutablecptrie_close() the mutable trie once you are done using it.
Returns the value for a code point as stored in the trie.
Returns the last code point such that all those from start to there have the same value.
Can be used to efficiently iterate over all same-value ranges in a trie. (This is normally faster than iterating over code points and get()ting each value, but much slower than a data structure that stores ranges directly.)
The trie can be modified between calls to this function.
If the UCPMapValueFilter function pointer is not NULL, then the value to be delivered is passed through that function, and the return value is the end of the range where all values are modified to the same actual value. The value is unchanged if that function pointer is NULL.
See the same-signature ucptrie_getRange() for a code sample.
Creates a mutable trie that initially maps each Unicode code point to the same value.
It uses 32-bit data values until umutablecptrie_buildImmutable() is called. umutablecptrie_buildImmutable() takes a valueWidth parameter which determines the number of bits in the data value in the resulting UCPTrie. You must umutablecptrie_close() the trie once you are done using it.
Sets a value for a code point.
Sets a value for each code point [start..end].
Faster and more space-efficient than setting the value for each code point separately.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4