OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************* | 2 ******************************************************************************* |
3 * Copyright (C) 2010-2013, International Business Machines | 3 * Copyright (C) 2010-2014, International Business Machines |
4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
5 ******************************************************************************* | 5 ******************************************************************************* |
6 * file name: ucharstriebuilder.h | 6 * file name: ucharstriebuilder.h |
7 * encoding: US-ASCII | 7 * encoding: US-ASCII |
8 * tab size: 8 (not used) | 8 * tab size: 8 (not used) |
9 * indentation:4 | 9 * indentation:4 |
10 * | 10 * |
11 * created on: 2010nov14 | 11 * created on: 2010nov14 |
12 * created by: Markus W. Scherer | 12 * created by: Markus W. Scherer |
13 */ | 13 */ |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t unit
Index) const; | 141 virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t unit
Index) const; |
142 virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_
t count) const; | 142 virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_
t count) const; |
143 virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, UCh
ar unit) const; | 143 virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, UCh
ar unit) const; |
144 | 144 |
145 virtual UBool matchNodesCanHaveValues() const { return TRUE; } | 145 virtual UBool matchNodesCanHaveValues() const { return TRUE; } |
146 | 146 |
147 virtual int32_t getMaxBranchLinearSubNodeLength() const { return UCharsTrie:
:kMaxBranchLinearSubNodeLength; } | 147 virtual int32_t getMaxBranchLinearSubNodeLength() const { return UCharsTrie:
:kMaxBranchLinearSubNodeLength; } |
148 virtual int32_t getMinLinearMatch() const { return UCharsTrie::kMinLinearMat
ch; } | 148 virtual int32_t getMinLinearMatch() const { return UCharsTrie::kMinLinearMat
ch; } |
149 virtual int32_t getMaxLinearMatchLength() const { return UCharsTrie::kMaxLin
earMatchLength; } | 149 virtual int32_t getMaxLinearMatchLength() const { return UCharsTrie::kMaxLin
earMatchLength; } |
150 | 150 |
151 #ifndef U_HIDE_INTERNAL_API | |
152 class UCTLinearMatchNode : public LinearMatchNode { | 151 class UCTLinearMatchNode : public LinearMatchNode { |
153 public: | 152 public: |
154 UCTLinearMatchNode(const UChar *units, int32_t len, Node *nextNode); | 153 UCTLinearMatchNode(const UChar *units, int32_t len, Node *nextNode); |
155 virtual UBool operator==(const Node &other) const; | 154 virtual UBool operator==(const Node &other) const; |
156 virtual void write(StringTrieBuilder &builder); | 155 virtual void write(StringTrieBuilder &builder); |
157 private: | 156 private: |
158 const UChar *s; | 157 const UChar *s; |
159 }; | 158 }; |
160 #endif | |
161 | 159 |
162 virtual Node *createLinearMatchNode(int32_t i, int32_t unitIndex, int32_t le
ngth, | 160 virtual Node *createLinearMatchNode(int32_t i, int32_t unitIndex, int32_t le
ngth, |
163 Node *nextNode) const; | 161 Node *nextNode) const; |
164 | 162 |
165 UBool ensureCapacity(int32_t length); | 163 UBool ensureCapacity(int32_t length); |
166 virtual int32_t write(int32_t unit); | 164 virtual int32_t write(int32_t unit); |
167 int32_t write(const UChar *s, int32_t length); | 165 int32_t write(const UChar *s, int32_t length); |
168 virtual int32_t writeElementUnits(int32_t i, int32_t unitIndex, int32_t leng
th); | 166 virtual int32_t writeElementUnits(int32_t i, int32_t unitIndex, int32_t leng
th); |
169 virtual int32_t writeValueAndFinal(int32_t i, UBool isFinal); | 167 virtual int32_t writeValueAndFinal(int32_t i, UBool isFinal); |
170 virtual int32_t writeValueAndType(UBool hasValue, int32_t value, int32_t nod
e); | 168 virtual int32_t writeValueAndType(UBool hasValue, int32_t value, int32_t nod
e); |
171 virtual int32_t writeDeltaTo(int32_t jumpTarget); | 169 virtual int32_t writeDeltaTo(int32_t jumpTarget); |
172 | 170 |
173 UnicodeString strings; | 171 UnicodeString strings; |
174 UCharsTrieElement *elements; | 172 UCharsTrieElement *elements; |
175 int32_t elementsCapacity; | 173 int32_t elementsCapacity; |
176 int32_t elementsLength; | 174 int32_t elementsLength; |
177 | 175 |
178 // UChar serialization of the trie. | 176 // UChar serialization of the trie. |
179 // Grows from the back: ucharsLength measures from the end of the buffer! | 177 // Grows from the back: ucharsLength measures from the end of the buffer! |
180 UChar *uchars; | 178 UChar *uchars; |
181 int32_t ucharsCapacity; | 179 int32_t ucharsCapacity; |
182 int32_t ucharsLength; | 180 int32_t ucharsLength; |
183 }; | 181 }; |
184 | 182 |
185 U_NAMESPACE_END | 183 U_NAMESPACE_END |
186 | 184 |
187 #endif // __UCHARSTRIEBUILDER_H__ | 185 #endif // __UCHARSTRIEBUILDER_H__ |
OLD | NEW |