| 56 | } |
| 57 | |
| 58 | int StringPiece::copy(char* buf, size_type n, size_type pos) const { |
| 59 | int ret = min(length_ - pos, n); |
| 60 | memcpy(buf, ptr_ + pos, ret); |
| 61 | return ret; |
| 62 | } |
| 63 | |
| 64 | bool StringPiece::contains(StringPiece s) const { |
| 65 | return find(s, 0) != npos; |
no test coverage detected