Lines Matching defs:StringPiece

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
29 class StringPiece {
47 // in a "const char*" or a "string" wherever a "StringPiece" is
49 StringPiece() : ptr_(NULL), length_(0) { }
50 StringPiece(const char* str)
52 StringPiece(const std::string& str)
54 StringPiece(const char* offset, size_type len)
94 int compare(const StringPiece& x) const {
113 bool starts_with(const StringPiece& x) const {
119 bool ends_with(const StringPiece& x) const {
138 size_type find(const StringPiece& s, size_type pos = 0) const;
140 size_type rfind(const StringPiece& s, size_type pos = npos) const;
143 size_type find_first_of(const StringPiece& s, size_type pos = 0) const;
147 size_type find_first_not_of(const StringPiece& s, size_type pos = 0) const;
149 size_type find_last_of(const StringPiece& s, size_type pos = npos) const;
153 size_type find_last_not_of(const StringPiece& s, size_type pos = npos) const;
156 StringPiece substr(size_type pos, size_type n = npos) const;
167 bool operator==(const StringPiece& x, const StringPiece& y);
169 inline bool operator!=(const StringPiece& x, const StringPiece& y) {
173 inline bool operator<(const StringPiece& x, const StringPiece& y) {
174 const int r = StringPiece::wordmemcmp(
179 inline bool operator>(const StringPiece& x, const StringPiece& y) {
183 inline bool operator<=(const StringPiece& x, const StringPiece& y) {
187 inline bool operator>=(const StringPiece& x, const StringPiece& y) {