15 #ifndef __UCHARSTRIEBUILDER_H__
16 #define __UCHARSTRIEBUILDER_H__
19 #include "unicode/stringtriebuilder.h"
25 class UCharsTrieElement;
122 void buildUChars(UStringTrieBuildOption buildOption,
UErrorCode &errorCode);
130 virtual int32_t
countElementUnits(int32_t start, int32_t limit, int32_t unitIndex)
const;
137 virtual int32_t
getMinLinearMatch()
const {
return UCharsTrie::kMinLinearMatch; }
140 class UCTLinearMatchNode :
public LinearMatchNode {
142 UCTLinearMatchNode(
const UChar *units, int32_t len, Node *nextNode);
150 Node *nextNode)
const;
152 UBool ensureCapacity(int32_t length);
153 virtual int32_t
write(int32_t unit);
154 int32_t
write(
const UChar *s, int32_t length);
161 UCharsTrieElement *elements;
162 int32_t elementsCapacity;
163 int32_t elementsLength;
168 int32_t ucharsCapacity;
169 int32_t ucharsLength;
174 #endif // __UCHARSTRIEBUILDER_H__
virtual UBool matchNodesCanHaveValues() const =0
virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t count) const =0
virtual int32_t getElementStringLength(int32_t i) const =0
virtual Node * createLinearMatchNode(int32_t i, int32_t unitIndex, int32_t length, Node *nextNode) const =0
Light-weight, non-const reader class for a UCharsTrie.
virtual int32_t getMaxLinearMatchLength() const =0
void build(UStringTrieBuildOption buildOption, int32_t elementsLength, UErrorCode &errorCode)
virtual int32_t write(int32_t unit)=0
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t unitIndex) const =0
virtual int32_t writeElementUnits(int32_t i, int32_t unitIndex, int32_t length)=0
virtual int32_t getMinLinearMatch() const =0
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
virtual int32_t writeValueAndFinal(int32_t i, UBool isFinal)=0
virtual int32_t getElementValue(int32_t i) const =0
virtual UChar getElementUnit(int32_t i, int32_t unitIndex) const =0
#define TRUE
The TRUE value of a UBool.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
uint16_t UChar
Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, UChar unit) const =0
Builder class for UCharsTrie.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
C++ API: Trie for mapping Unicode strings (or 16-bit-unit sequences) to integer values.
Basic definitions for ICU, for both C and C++ APIs.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside...
virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t unitIndex) const =0
UCharsTrieBuilder & clear()
Removes all (string, value) pairs.
Base class for string trie builder classes.
virtual int32_t writeDeltaTo(int32_t jumpTarget)=0
virtual int32_t writeValueAndType(UBool hasValue, int32_t value, int32_t node)=0
virtual int32_t getMaxBranchLinearSubNodeLength() const =0
int8_t UBool
The ICU boolean type.