Home | History | Annotate | Download | only in base

Lines Matching refs:pos

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