17 #ifndef __UCHARSTRIEBUILDER_H__
18 #define __UCHARSTRIEBUILDER_H__
22 #if U_SHOW_CPLUSPLUS_API
35 class UCharsTrieElement;
140 virtual int32_t getElementStringLength(int32_t i)
const;
141 virtual char16_t getElementUnit(int32_t i, int32_t unitIndex)
const;
142 virtual int32_t getElementValue(int32_t i)
const;
144 virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t unitIndex)
const;
146 virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t unitIndex)
const;
147 virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t count)
const;
148 virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, char16_t unit)
const;
150 virtual UBool matchNodesCanHaveValues()
const {
return TRUE; }
152 virtual int32_t getMaxBranchLinearSubNodeLength()
const {
return UCharsTrie::kMaxBranchLinearSubNodeLength; }
153 virtual int32_t getMinLinearMatch()
const {
return UCharsTrie::kMinLinearMatch; }
154 virtual int32_t getMaxLinearMatchLength()
const {
return UCharsTrie::kMaxLinearMatchLength; }
156 class UCTLinearMatchNode :
public LinearMatchNode {
158 UCTLinearMatchNode(
const char16_t *units, int32_t len, Node *nextNode);
160 virtual void write(StringTrieBuilder &builder);
165 virtual Node *createLinearMatchNode(int32_t i, int32_t unitIndex, int32_t length,
166 Node *nextNode)
const;
168 UBool ensureCapacity(int32_t length);
169 virtual int32_t write(int32_t unit);
170 int32_t write(
const char16_t *s, int32_t length);
171 virtual int32_t writeElementUnits(int32_t i, int32_t unitIndex, int32_t length);
172 virtual int32_t writeValueAndFinal(int32_t i,
UBool isFinal);
173 virtual int32_t writeValueAndType(
UBool hasValue, int32_t value, int32_t node);
174 virtual int32_t writeDeltaTo(int32_t jumpTarget);
176 UnicodeString strings;
177 UCharsTrieElement *elements;
178 int32_t elementsCapacity;
179 int32_t elementsLength;
184 int32_t ucharsCapacity;
185 int32_t ucharsLength;
192 #endif // __UCHARSTRIEBUILDER_H__