Home | History | Annotate | Download | only in base

Lines Matching refs:pos

31 size_type StringPiece::copy(char* buf, size_type n, size_type pos) const {
32 size_type ret = std::min(length_ - pos, n);
33 memcpy(buf, ptr_ + pos, ret);
37 size_type StringPiece::find(const StringPiece& s, size_type pos) const {
38 if (pos > length_)
41 const char* result = std::search(ptr_ + pos, ptr_ + length_,
47 size_type StringPiece::find(char c, size_type pos) const {
48 if (pos >= length_)
51 const char* result = std::find(ptr_ + pos, ptr_ + length_, c);
55 size_type StringPiece::rfind(const StringPiece& s, size_type pos) const {
60 return std::min(length_, pos);
62 const char* last = ptr_ + std::min(length_ - s.length_, pos) + s.length_;
67 size_type StringPiece::rfind(char c, size_type pos) const {
71 for (size_type i = std::min(pos, length_ - 1); ; --i) {
98 size_type pos) const {
104 return find_first_of(s.ptr_[0], pos);
108 for (size_type i = pos; i < length_; ++i) {
117 size_type pos) const {
126 return find_first_not_of(s.ptr_[0], pos);
130 for (size_type i = pos; i < length_; ++i) {
138 size_type StringPiece::find_first_not_of(char c, size_type pos) const {
142 for (; pos < length_; ++pos) {
143 if (ptr_[pos] != c) {
144 return pos;
150 size_type StringPiece::find_last_of(const StringPiece& s, size_type pos) const {
156 return find_last_of(s.ptr_[0], pos);
160 for (size_type i = std::min(pos, length_ - 1); ; --i) {
170 size_type pos) const {
174 size_type i = std::min(pos, length_ - 1);
180 return find_last_not_of(s.ptr_[0], pos);
193 size_type StringPiece::find_last_not_of(char c, size_type pos) const {
197 for (size_type i = std::min(pos, length_ - 1); ; --i) {
206 StringPiece StringPiece::substr(size_type pos, size_type n) const {
207 if (pos > length_) pos = length_;
208 if (n > length_ - pos) n = length_ - pos;
209 return StringPiece(ptr_ + pos, n);