A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1UCharsTrieBuilder.html below:

ICU 77.1: icu::UCharsTrieBuilder Class Reference

Builder class for UCharsTrie. More...

#include <ucharstriebuilder.h>

Builder class for UCharsTrie.

This class is not intended for public subclassing.

Stable:
ICU 4.8

Definition at line 43 of file ucharstriebuilder.h.

◆ UCharsTrieBuilder() icu::UCharsTrieBuilder::UCharsTrieBuilder ( UErrorCodeerrorCode )

Constructs an empty builder.

Parameters
errorCode Standard ICU error code.
Stable:
ICU 4.8
◆ ~UCharsTrieBuilder() virtual icu::UCharsTrieBuilder::~UCharsTrieBuilder ( ) virtual ◆ add()

Adds a (string, value) pair.

The string must be unique. The string contents will be copied; the builder does not keep a reference to the input UnicodeString or its buffer.

Parameters
s The input string. value The value associated with this string. errorCode Standard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.)
Returns
*this
Stable:
ICU 4.8
◆ build()

Builds a UCharsTrie for the add()ed data.

Once built, no further data can be add()ed until clear() is called.

A UCharsTrie cannot be empty. At least one (string, value) pair must have been add()ed.

This method passes ownership of the builder's internal result array to the new trie object. Another call to any build() variant will re-serialize the trie. After clear() has been called, a new array will be used as well.

Parameters
buildOption Build option, see UStringTrieBuildOption. errorCode Standard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.)
Returns
A new UCharsTrie for the add()ed data.
Stable:
ICU 4.8
◆ buildUnicodeString()

Builds a UCharsTrie for the add()ed data and char16_t-serializes it.

Once built, no further data can be add()ed until clear() is called.

A UCharsTrie cannot be empty. At least one (string, value) pair must have been add()ed.

Multiple calls to buildUnicodeString() set the UnicodeStrings to the builder's same char16_t array, without rebuilding. If buildUnicodeString() is called after build(), the trie will be re-serialized into a new array (because build() passes on ownership). If build() is called after buildUnicodeString(), the trie object returned by build() will become the owner of the underlying data for the previously returned UnicodeString. After clear() has been called, a new array will be used as well.

Parameters
buildOption Build option, see UStringTrieBuildOption. result A UnicodeString which will be set to the char16_t-serialized UCharsTrie for the add()ed data. errorCode Standard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.)
Returns
result
Stable:
ICU 4.8
◆ clear()

Removes all (string, value) pairs.

New data can then be add()ed and a new trie can be built.

Returns
*this
Stable:
ICU 4.8

Definition at line 128 of file ucharstriebuilder.h.

The documentation for this class was generated from the following file:


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