Home | History | Annotate | Download | only in util

Lines Matching refs:pos

36 int StringPiece::copy(char* buf, size_type n, size_type pos) const {
37 int ret = min(length_ - pos, n);
38 memcpy(buf, ptr_ + pos, ret);
42 int StringPiece::find(const StringPiece& s, size_type pos) const {
43 if (length_ < 0 || pos > static_cast<size_type>(length_))
46 const char* result = std::search(ptr_ + pos, ptr_ + length_,
52 int StringPiece::find(char c, size_type pos) const {
53 if (length_ <= 0 || pos >= static_cast<size_type>(length_)) {
56 const char* result = std::find(ptr_ + pos, ptr_ + length_, c);
60 int StringPiece::rfind(const StringPiece& s, size_type pos) const {
63 if (s.length_ == 0) return min(ulen, pos);
65 const char* last = ptr_ + min(ulen - s.length_, pos) + s.length_;
70 int StringPiece::rfind(char c, size_type pos) const {
72 for (int i = min(pos, static_cast<size_type>(length_ - 1));
81 StringPiece StringPiece::substr(size_type pos, size_type n) const {
82 if (pos > length_) pos = length_;
83 if (n > length_ - pos) n = length_ - pos;
84 return StringPiece(ptr_ + pos, n);