Home
last modified time | relevance | path

Searched refs:length_ (Results 1 – 2 of 2) sorted by relevance

/build/kati/
Dstring_piece.cc57 size_type ret = std::min(length_ - pos, n); in copy()
63 if (pos > length_) in find()
67 std::search(ptr_ + pos, ptr_ + length_, s.ptr_, s.ptr_ + s.length_); in find()
69 return xpos + s.length_ <= length_ ? xpos : npos; in find()
73 if (pos >= length_) in find()
76 const char* result = std::find(ptr_ + pos, ptr_ + length_, c); in find()
77 return result != ptr_ + length_ ? static_cast<size_t>(result - ptr_) : npos; in find()
81 if (length_ < s.length_) in rfind()
85 return std::min(length_, pos); in rfind()
87 const char* last = ptr_ + std::min(length_ - s.length_, pos) + s.length_; in rfind()
[all …]
Dstring_piece.h64 StringPiece() : ptr_(NULL), length_(0) {} in StringPiece()
66 : ptr_(str), length_((str == NULL) ? 0 : strlen(str)) {} in StringPiece()
67 StringPiece(const std::string& str) : ptr_(str.data()), length_(str.size()) {} in StringPiece()
69 : ptr_(str.data()), length_(str.size()) {} in StringPiece()
70 StringPiece(const char* offset, size_type len) : ptr_(offset), length_(len) {} in StringPiece()
77 size_type size() const { return length_; } in size()
78 size_type length() const { return length_; } in length()
79 bool empty() const { return length_ == 0; } in empty()
83 length_ = 0; in clear()
87 length_ = len; in set()
[all …]