Lines Matching refs:length_
64 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()
91 length_ = str ? strlen(str) : 0; in set()
95 length_ = len; in set()
102 length_ -= n; in remove_prefix()
105 void remove_suffix(size_type n) { length_ -= n; } in remove_suffix()
109 wordmemcmp(ptr_, x.ptr_, (length_ < x.length_ ? length_ : x.length_)); in compare()
111 if (length_ < x.length_) in compare()
113 else if (length_ > x.length_) in compare()
129 return ((length_ >= x.length_) && in starts_with()
130 (wordmemcmp(ptr_, x.ptr_, x.length_) == 0)); in starts_with()
135 return ((length_ >= x.length_) && in ends_with()
136 (wordmemcmp(ptr_ + (length_ - x.length_), x.ptr_, x.length_) == 0)); in ends_with()
140 iterator end() const { return ptr_ + length_; } in end()
142 return const_reverse_iterator(ptr_ + length_); in rbegin()
146 size_type max_size() const { return length_; } in max_size()
147 size_type capacity() const { return length_; } in capacity()
177 char get(size_type i) const { return i < length_ ? ptr_[i] : 0; } in get()
181 size_type length_; variable