Lines Matching +refs:c +refs:pos

36     pos = newOffset;  in resetToOffset()
41 return pos; in getOffset()
45 UTF8CollationIterator::handleNextCE32(UChar32 &c, UErrorCode & /*errorCode*/) { in handleNextCE32() argument
46 if(pos == length) { in handleNextCE32()
47 c = U_SENTINEL; in handleNextCE32()
51 c = u8[pos++]; in handleNextCE32()
52 if(U8_IS_SINGLE(c)) { in handleNextCE32()
54 return trie->data32[c]; in handleNextCE32()
57 if(0xe0 <= c && c < 0xf0 && in handleNextCE32()
58 ((pos + 1) < length || length < 0) && in handleNextCE32()
59 U8_IS_VALID_LEAD3_AND_T1(c, t1 = u8[pos]) && in handleNextCE32()
60 (t2 = (u8[pos + 1] - 0x80)) <= 0x3f) { in handleNextCE32()
62 c = (((c & 0xf) << 12) | ((t1 & 0x3f) << 6) | t2); in handleNextCE32()
63 pos += 2; in handleNextCE32()
64 return UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, c); in handleNextCE32()
65 } else if(c < 0xe0 && c >= 0xc2 && pos != length && (t1 = (u8[pos] - 0x80)) <= 0x3f) { in handleNextCE32()
67 uint32_t ce32 = trie->data32[trie->index[(UTRIE2_UTF8_2B_INDEX_2_OFFSET - 0xc0) + c] + t1]; in handleNextCE32()
68 c = ((c & 0x1f) << 6) | t1; in handleNextCE32()
69 ++pos; in handleNextCE32()
74 c = utf8_nextCharSafeBody(u8, &pos, length, c, -3); in handleNextCE32()
75 return data->getCE32(c); in handleNextCE32()
82 length = --pos; in foundNULTerminator()
96 if(pos == length) { in nextCodePoint()
99 if(u8[pos] == 0 && length < 0) { in nextCodePoint()
100 length = pos; in nextCodePoint()
103 UChar32 c; in nextCodePoint() local
104 U8_NEXT_OR_FFFD(u8, pos, length, c); in nextCodePoint()
105 return c; in nextCodePoint()
110 if(pos == 0) { in previousCodePoint()
113 UChar32 c; in previousCodePoint() local
114 U8_PREV_OR_FFFD(u8, 0, pos, c); in previousCodePoint()
115 return c; in previousCodePoint()
120 U8_FWD_N(u8, pos, length, num); in forwardNumCodePoints()
125 U8_BACK_N(u8, 0, pos, num); in backwardNumCodePoints()
135 start = pos = newOffset; in resetToOffset()
142 return pos; in getOffset()
143 } else if(pos == 0) { in getOffset()
151 FCDUTF8CollationIterator::handleNextCE32(UChar32 &c, UErrorCode &errorCode) { in handleNextCE32() argument
155 if(pos == length) { in handleNextCE32()
156 c = U_SENTINEL; in handleNextCE32()
159 c = u8[pos++]; in handleNextCE32()
160 if(U8_IS_SINGLE(c)) { in handleNextCE32()
162 return trie->data32[c]; in handleNextCE32()
165 if(0xe0 <= c && c < 0xf0 && in handleNextCE32()
166 ((pos + 1) < length || length < 0) && in handleNextCE32()
167 U8_IS_VALID_LEAD3_AND_T1(c, t1 = u8[pos]) && in handleNextCE32()
168 (t2 = (u8[pos + 1] - 0x80)) <= 0x3f) { in handleNextCE32()
170 c = (((c & 0xf) << 12) | ((t1 & 0x3f) << 6) | t2); in handleNextCE32()
171 pos += 2; in handleNextCE32()
172 if(CollationFCD::hasTccc(c) && in handleNextCE32()
173 (CollationFCD::maybeTibetanCompositeVowel(c) || in handleNextCE32()
174 (pos != length && nextHasLccc()))) { in handleNextCE32()
175 pos -= 3; in handleNextCE32()
179 } else if(c < 0xe0 && c >= 0xc2 && pos != length && (t1 = (u8[pos] - 0x80)) <= 0x3f) { in handleNextCE32()
181 … uint32_t ce32 = trie->data32[trie->index[(UTRIE2_UTF8_2B_INDEX_2_OFFSET - 0xc0) + c] + t1]; in handleNextCE32()
182 c = ((c & 0x1f) << 6) | t1; in handleNextCE32()
183 ++pos; in handleNextCE32()
184 if(CollationFCD::hasTccc(c) && pos != length && nextHasLccc()) { in handleNextCE32()
185 pos -= 2; in handleNextCE32()
192 c = utf8_nextCharSafeBody(u8, &pos, length, c, -3); in handleNextCE32()
193 if(c == 0xfffd) { in handleNextCE32()
196 U_ASSERT(c > 0xffff); in handleNextCE32()
197 if(CollationFCD::hasTccc(U16_LEAD(c)) && pos != length && nextHasLccc()) { in handleNextCE32()
198 pos -= 4; in handleNextCE32()
200 return data->getCE32FromSupplementary(c); in handleNextCE32()
205 c = U_SENTINEL; in handleNextCE32()
209 } else if(state == IN_FCD_SEGMENT && pos != limit) { in handleNextCE32()
210 return UTF8CollationIterator::handleNextCE32(c, errorCode); in handleNextCE32()
211 } else if(state == IN_NORMALIZED && pos != normalized.length()) { in handleNextCE32()
212 c = normalized[pos++]; in handleNextCE32()
218 return UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, c); in handleNextCE32()
223 U_ASSERT(state == CHECK_FWD && pos != length); in nextHasLccc()
226 UChar32 c = u8[pos]; in nextHasLccc() local
227 if(c < 0xcc || (0xe4 <= c && c <= 0xed && c != 0xea)) { return FALSE; } in nextHasLccc()
228 int32_t i = pos; in nextHasLccc()
229 U8_NEXT_OR_FFFD(u8, i, length, c); in nextHasLccc()
230 if(c > 0xffff) { c = U16_LEAD(c); } in nextHasLccc()
231 return CollationFCD::hasLccc(c); in nextHasLccc()
236 U_ASSERT(state == CHECK_BWD && pos != 0); in previousHasTccc()
237 UChar32 c = u8[pos - 1]; in previousHasTccc() local
238 if(U8_IS_SINGLE(c)) { return FALSE; } in previousHasTccc()
239 int32_t i = pos; in previousHasTccc()
240 U8_PREV_OR_FFFD(u8, 0, i, c); in previousHasTccc()
241 if(c > 0xffff) { c = U16_LEAD(c); } in previousHasTccc()
242 return CollationFCD::hasTccc(c); in previousHasTccc()
248 U_ASSERT(pos < normalized.length()); in handleGetTrailSurrogate()
250 if(U16_IS_TRAIL(trail = normalized[pos])) { ++pos; } in handleGetTrailSurrogate()
257 length = --pos; in foundNULTerminator()
266 UChar32 c; in nextCodePoint() local
269 if(pos == length || ((c = u8[pos]) == 0 && length < 0)) { in nextCodePoint()
272 if(U8_IS_SINGLE(c)) { in nextCodePoint()
273 ++pos; in nextCodePoint()
274 return c; in nextCodePoint()
276 U8_NEXT_OR_FFFD(u8, pos, length, c); in nextCodePoint()
277 if(CollationFCD::hasTccc(c <= 0xffff ? c : U16_LEAD(c)) && in nextCodePoint()
278 (CollationFCD::maybeTibetanCompositeVowel(c) || in nextCodePoint()
279 (pos != length && nextHasLccc()))) { in nextCodePoint()
282 pos -= U8_LENGTH(c); in nextCodePoint()
288 return c; in nextCodePoint()
289 } else if(state == IN_FCD_SEGMENT && pos != limit) { in nextCodePoint()
290 U8_NEXT_OR_FFFD(u8, pos, length, c); in nextCodePoint()
291 return c; in nextCodePoint()
292 } else if(state == IN_NORMALIZED && pos != normalized.length()) { in nextCodePoint()
293 c = normalized.char32At(pos); in nextCodePoint()
294 pos += U16_LENGTH(c); in nextCodePoint()
295 return c; in nextCodePoint()
304 UChar32 c; in previousCodePoint() local
307 if(pos == 0) { in previousCodePoint()
310 if(U8_IS_SINGLE(c = u8[pos - 1])) { in previousCodePoint()
311 --pos; in previousCodePoint()
312 return c; in previousCodePoint()
314 U8_PREV_OR_FFFD(u8, 0, pos, c); in previousCodePoint()
315 if(CollationFCD::hasLccc(c <= 0xffff ? c : U16_LEAD(c)) && in previousCodePoint()
316 (CollationFCD::maybeTibetanCompositeVowel(c) || in previousCodePoint()
317 (pos != 0 && previousHasTccc()))) { in previousCodePoint()
320 pos += U8_LENGTH(c); in previousCodePoint()
326 return c; in previousCodePoint()
327 } else if(state == IN_FCD_SEGMENT && pos != start) { in previousCodePoint()
328 U8_PREV_OR_FFFD(u8, 0, pos, c); in previousCodePoint()
329 return c; in previousCodePoint()
330 } else if(state >= IN_NORMALIZED && pos != 0) { in previousCodePoint()
331 c = normalized.char32At(pos - 1); in previousCodePoint()
332 pos -= U16_LENGTH(c); in previousCodePoint()
333 return c; in previousCodePoint()
361 (state == IN_FCD_SEGMENT && pos == limit) || in switchToForward()
362 (state == IN_NORMALIZED && pos == normalized.length())); in switchToForward()
365 start = pos; in switchToForward()
366 if(pos == limit) { in switchToForward()
378 start = pos = limit; in switchToForward()
387 U_ASSERT(state == CHECK_FWD && pos != length); in nextSegment()
389 int32_t segmentStart = pos; in nextSegment()
395 int32_t cpStart = pos; in nextSegment()
396 UChar32 c; in nextSegment() local
397 U8_NEXT_OR_FFFD(u8, pos, length, c); in nextSegment()
398 uint16_t fcd16 = nfcImpl.getFCD16(c); in nextSegment()
402 pos = cpStart; in nextSegment()
405 s.append(c); in nextSegment()
408 while(pos != length) { in nextSegment()
409 cpStart = pos; in nextSegment()
410 U8_NEXT_OR_FFFD(u8, pos, length, c); in nextSegment()
411 if(nfcImpl.getFCD16(c) <= 0xff) { in nextSegment()
412 pos = cpStart; in nextSegment()
415 s.append(c); in nextSegment()
419 limit = pos; in nextSegment()
421 pos = 0; in nextSegment()
425 if(pos == length || prevCC == 0) { in nextSegment()
430 limit = pos; in nextSegment()
431 pos = segmentStart; in nextSegment()
432 U_ASSERT(pos != limit); in nextSegment()
440 (state == IN_FCD_SEGMENT && pos == start) || in switchToBackward()
441 (state >= IN_NORMALIZED && pos == 0)); in switchToBackward()
444 limit = pos; in switchToBackward()
445 if(pos == start) { in switchToBackward()
457 limit = pos = start; in switchToBackward()
466 U_ASSERT(state == CHECK_BWD && pos != 0); in previousSegment()
468 int32_t segmentLimit = pos; in previousSegment()
474 int32_t cpLimit = pos; in previousSegment()
475 UChar32 c; in previousSegment() local
476 U8_PREV_OR_FFFD(u8, 0, pos, c); in previousSegment()
477 uint16_t fcd16 = nfcImpl.getFCD16(c); in previousSegment()
481 pos = cpLimit; in previousSegment()
484 s.append(c); in previousSegment()
488 while(fcd16 > 0xff && pos != 0) { in previousSegment()
489 cpLimit = pos; in previousSegment()
490 U8_PREV_OR_FFFD(u8, 0, pos, c); in previousSegment()
491 fcd16 = nfcImpl.getFCD16(c); in previousSegment()
493 pos = cpLimit; in previousSegment()
496 s.append(c); in previousSegment()
501 start = pos; in previousSegment()
503 pos = normalized.length(); in previousSegment()
507 if(pos == 0 || nextCC == 0) { in previousSegment()
512 start = pos; in previousSegment()
513 pos = segmentLimit; in previousSegment()
514 U_ASSERT(pos != start); in previousSegment()