Home | History | Annotate | Download | only in strings

Lines Matching defs:StringPiece

4 // Copied from strings/stringpiece.h with modifications
8 // Functions or methods may use const StringPiece& parameters to accept either
10 // a StringPiece. The implicit conversion means that it is often appropriate
12 // StringPiece as would be appropriate for most other Google classes.
14 // Systematic usage of StringPiece is encouraged as it will reduce unnecessary
17 // StringPiece16 is similar to StringPiece but for base::string16 instead of
19 // from basic_string as in StringPiece, but this can be changed if these
39 typedef BasicStringPiece<std::string> StringPiece;
44 // Many of the StringPiece functions use different implementations for the
48 // So here we define overloaded functions called by the StringPiece template.
53 BASE_EXPORT void CopyToString(const StringPiece& self, std::string* target);
56 BASE_EXPORT void AppendToString(const StringPiece& self, std::string* target);
59 BASE_EXPORT size_t copy(const StringPiece& self,
68 BASE_EXPORT size_t find(const StringPiece& self,
69 const StringPiece& s,
74 BASE_EXPORT size_t find(const StringPiece& self,
81 BASE_EXPORT size_t rfind(const StringPiece& self,
82 const StringPiece& s,
87 BASE_EXPORT size_t rfind(const StringPiece& self,
94 BASE_EXPORT size_t find_first_of(const StringPiece& self,
95 const StringPiece& s,
101 BASE_EXPORT size_t find_first_not_of(const StringPiece& self,
102 const StringPiece& s,
107 BASE_EXPORT size_t find_first_not_of(const StringPiece& self,
114 BASE_EXPORT size_t find_last_of(const StringPiece& self,
115 const StringPiece& s,
120 BASE_EXPORT size_t find_last_of(const StringPiece& self,
127 BASE_EXPORT size_t find_last_not_of(const StringPiece& self,
128 const StringPiece& s,
136 BASE_EXPORT size_t find_last_not_of(const StringPiece& self,
140 BASE_EXPORT StringPiece substr(const StringPiece& self,
152 // StringPiece and StringPiece16. Do not refer to this class directly, but
153 // rather to BasicStringPiece, StringPiece, or StringPiece16.
173 // in a "const char*" or a "string" wherever a "StringPiece" is
361 BASE_EXPORT bool operator==(const StringPiece& x, const StringPiece& y);
363 inline bool operator!=(const StringPiece& x, const StringPiece& y) {
367 inline bool operator<(const StringPiece& x, const StringPiece& y) {
368 const int r = StringPiece::wordmemcmp(
373 inline bool operator>(const StringPiece& x, const StringPiece& y) {
377 inline bool operator<=(const StringPiece& x, const StringPiece& y) {
381 inline bool operator>=(const StringPiece& x, const StringPiece& y) {
417 const StringPiece& piece);
423 // We provide appropriate hash functions so StringPiece and StringPiece16 can
440 struct hash<base::StringPiece> {
441 std::size_t operator()(const base::StringPiece& sp) const {
442 HASH_STRING_PIECE(base::StringPiece, sp);
454 inline size_t hash_value(const base::StringPiece& sp) {
455 HASH_STRING_PIECE(base::StringPiece, sp);