Lines Matching refs:pos
17 ptrdiff_t UTF16IndexToOffset(const base::string16& s, size_t base, size_t pos) {
24 DCHECK_LE(pos, s.length());
26 while (base < pos)
28 while (pos < base)
29 delta -= IsValidCodePointIndex(s, pos++) ? 1 : 0;
38 // the second. When stepping from pos to pos+1 we check s[pos:pos+1] == s[pos]
39 // (Python syntax), hence pos++. When stepping from pos to pos-1 we check
40 // s[pos-1], hence --pos.
41 size_t pos = base;
42 while (offset > 0 && pos < s.length())
43 offset -= IsValidCodePointIndex(s, pos++) ? 1 : 0;
44 while (offset < 0 && pos > 0)
45 offset += IsValidCodePointIndex(s, --pos) ? 1 : 0;
52 if (!IsValidCodePointIndex(s, pos))
53 ++pos;
54 return pos;