Lines Matching refs:StringPiece
23 bool operator==(const StringPiece& x, const StringPiece& y) { in operator ==()
27 return StringPiece::wordmemcmp(x.data(), y.data(), x.size()) == 0; in operator ==()
30 std::ostream& operator<<(std::ostream& o, const StringPiece& piece) { in operator <<()
36 void CopyToString(const StringPiece& self, std::string* target) { in CopyToString()
40 void AppendToString(const StringPiece& self, std::string* target) { in AppendToString()
45 StringPiece::size_type copy(const StringPiece& self, in copy()
47 StringPiece::size_type n, in copy()
48 StringPiece::size_type pos) { in copy()
49 StringPiece::size_type ret = std::min(self.size() - pos, n); in copy()
54 StringPiece::size_type find(const StringPiece& self, in find()
55 const StringPiece& s, in find()
56 StringPiece::size_type pos) { in find()
58 return StringPiece::npos; in find()
60 StringPiece::const_iterator result = in find()
62 const StringPiece::size_type xpos = in find()
64 return xpos + s.size() <= self.size() ? xpos : StringPiece::npos; in find()
67 StringPiece::size_type find(const StringPiece& self, in find()
69 StringPiece::size_type pos) { in find()
71 return StringPiece::npos; in find()
73 StringPiece::const_iterator result = in find()
76 static_cast<size_t>(result - self.begin()) : StringPiece::npos; in find()
79 StringPiece::size_type rfind(const StringPiece& self, in rfind()
80 const StringPiece& s, in rfind()
81 StringPiece::size_type pos) { in rfind()
83 return StringPiece::npos; in rfind()
88 StringPiece::const_iterator last = in rfind()
90 StringPiece::const_iterator result = in rfind()
93 static_cast<size_t>(result - self.begin()) : StringPiece::npos; in rfind()
96 StringPiece::size_type rfind(const StringPiece& self, in rfind()
98 StringPiece::size_type pos) { in rfind()
100 return StringPiece::npos; in rfind()
102 for (StringPiece::size_type i = std::min(pos, self.size() - 1); ; --i) { in rfind()
108 return StringPiece::npos; in rfind()
119 static inline void BuildLookupTable(const StringPiece& characters_wanted, in BuildLookupTable()
121 const StringPiece::size_type length = characters_wanted.length(); in BuildLookupTable()
123 for (StringPiece::size_type i = 0; i < length; ++i) { in BuildLookupTable()
128 StringPiece::size_type find_first_of(const StringPiece& self, in find_first_of()
129 const StringPiece& s, in find_first_of()
130 StringPiece::size_type pos) { in find_first_of()
132 return StringPiece::npos; in find_first_of()
140 for (StringPiece::size_type i = pos; i < self.size(); ++i) { in find_first_of()
145 return StringPiece::npos; in find_first_of()
148 StringPiece::size_type find_first_not_of(const StringPiece& self, in find_first_not_of()
149 const StringPiece& s, in find_first_not_of()
150 StringPiece::size_type pos) { in find_first_not_of()
152 return StringPiece::npos; in find_first_not_of()
163 for (StringPiece::size_type i = pos; i < self.size(); ++i) { in find_first_not_of()
168 return StringPiece::npos; in find_first_not_of()
171 StringPiece::size_type find_first_not_of(const StringPiece& self, in find_first_not_of()
173 StringPiece::size_type pos) { in find_first_not_of()
175 return StringPiece::npos; in find_first_not_of()
182 return StringPiece::npos; in find_first_not_of()
185 StringPiece::size_type find_last_of(const StringPiece& self, in find_last_of()
186 const StringPiece& s, in find_last_of()
187 StringPiece::size_type pos) { in find_last_of()
189 return StringPiece::npos; in find_last_of()
197 for (StringPiece::size_type i = std::min(pos, self.size() - 1); ; --i) { in find_last_of()
203 return StringPiece::npos; in find_last_of()
206 StringPiece::size_type find_last_not_of(const StringPiece& self, in find_last_not_of()
207 const StringPiece& s, in find_last_not_of()
208 StringPiece::size_type pos) { in find_last_not_of()
210 return StringPiece::npos; in find_last_not_of()
212 StringPiece::size_type i = std::min(pos, self.size() - 1); in find_last_not_of()
228 return StringPiece::npos; in find_last_not_of()
231 StringPiece::size_type find_last_not_of(const StringPiece& self, in find_last_not_of()
233 StringPiece::size_type pos) { in find_last_not_of()
235 return StringPiece::npos; in find_last_not_of()
237 for (StringPiece::size_type i = std::min(pos, self.size() - 1); ; --i) { in find_last_not_of()
243 return StringPiece::npos; in find_last_not_of()
246 StringPiece substr(const StringPiece& self, in substr()
247 StringPiece::size_type pos, in substr()
248 StringPiece::size_type n) { in substr()
251 return StringPiece(self.data() + pos, n); in substr()