Lines Matching refs:pos
28 int StringPiece::copy(char* buf, size_type n, size_type pos) const { in copy()
29 int ret = std::min(length_ - pos, n); in copy()
30 memcpy(buf, ptr_ + pos, ret); in copy()
34 StringPiece::size_type StringPiece::find(const StringPiece& s, size_type pos) const { in find()
35 if (length_ < 0 || pos > static_cast<size_type>(length_)) in find()
38 const char* result = std::search(ptr_ + pos, ptr_ + length_, in find()
53 StringPiece::size_type StringPiece::find(char c, size_type pos) const { in find()
54 if (length_ <= 0 || pos >= static_cast<size_type>(length_)) { in find()
57 const char* result = std::find(ptr_ + pos, ptr_ + length_, c); in find()
61 StringPiece::size_type StringPiece::rfind(const StringPiece& s, size_type pos) const { in rfind()
64 if (s.length_ == 0) return std::min(ulen, pos); in rfind()
66 const char* last = ptr_ + std::min(ulen - s.length_, pos) + s.length_; in rfind()
71 StringPiece::size_type StringPiece::rfind(char c, size_type pos) const { in rfind()
73 for (int i = std::min(pos, static_cast<size_type>(length_ - 1)); in rfind()
82 StringPiece StringPiece::substr(size_type pos, size_type n) const { in substr() argument
83 if (pos > static_cast<size_type>(length_)) pos = length_; in substr()
84 if (n > length_ - pos) n = length_ - pos; in substr()
85 return StringPiece(ptr_ + pos, n); in substr()