| 149 | } |
| 150 | |
| 151 | size_type copy(char* buf, size_type n, size_type pos = 0) const { |
| 152 | size_type ret = std::min(length_ - pos, n); |
| 153 | memcpy(buf, ptr_ + pos, ret); |
| 154 | return ret; |
| 155 | } |
| 156 | |
| 157 | size_type find(const StringPiece& s, size_type pos = 0) const { |
| 158 | if (length_ == 0 || pos > static_cast<size_type>(length_)) { |