Lines Matching refs:pos
316 static inline int32_t posBefore(const Replaceable& str, int32_t pos) {
317 return (pos > 0) ?
318 pos - UTF_CHAR_LENGTH(str.char32At(pos-1)) :
319 pos - 1;
322 static inline int32_t posAfter(const Replaceable& str, int32_t pos) {
323 return (pos >= 0 && pos < str.length()) ?
324 pos + UTF_CHAR_LENGTH(str.char32At(pos)) :
325 pos + 1;
338 * If a full match is obtained, perform a replacement, update pos,
339 * and return U_MATCH. Otherwise both text and pos are unchanged.
342 * @param pos the position indices
344 * be completed by additional text inserted at pos.limit.
350 UTransPosition& pos,
384 int32_t anteLimit = posBefore(text, pos.contextStart);
388 // Start reverse match at char before pos.start
389 oText = posBefore(text, pos.start);
408 oText = pos.start;
411 match = key->matches(text, oText, pos.limit, incremental);
420 if (incremental && keyLimit == pos.limit) {
421 // The key matches just before pos.limit, and there is
424 // pos.limit -- this is a partial match.
428 match = postContext->matches(text, oText, pos.contextLimit, incremental);
437 if (oText != pos.contextLimit) {
447 // We have a full match. The key is between pos.start and
451 int32_t newLength = output->toReplacer()->replace(text, pos.start, keyLimit, newStart);
452 int32_t lenDelta = newLength - (keyLimit - pos.start);
455 pos.limit += lenDelta;
456 pos.contextLimit += lenDelta;
457 // Restrict new value of start to [minOText, min(oText, pos.limit)].
458 pos.start = uprv_max(minOText, uprv_min(uprv_min(oText, pos.limit), newStart));