Home | History | Annotate | Download | only in kati

Lines Matching defs:StringPiece

18 // Copied from strings/stringpiece.h with modifications
22 // Functions or methods may use const StringPiece& parameters to accept either
24 // a StringPiece. The implicit conversion means that it is often appropriate
26 // StringPiece as would be appropriate for most other Google classes.
28 // Systematic usage of StringPiece is encouraged as it will reduce unnecessary
44 class StringPiece {
62 // in a "const char*" or a "string" wherever a "StringPiece" is
64 StringPiece() : ptr_(NULL), length_(0) {}
65 StringPiece(const char* str)
67 StringPiece(const std::string& str) : ptr_(str.data()), length_(str.size()) {}
68 StringPiece(const std::string&& str)
70 StringPiece(const char* offset, size_type len) : ptr_(offset), length_(len) {}
107 int compare(const StringPiece& x) const {
128 bool starts_with(const StringPiece& x) const {
134 bool ends_with(const StringPiece& x) const {
151 size_type find(const StringPiece& s, size_type pos = 0) const;
153 size_type rfind(const StringPiece& s, size_type pos = npos) const;
156 size_type find_first_of(const StringPiece& s, size_type pos = 0) const;
160 size_type find_first_not_of(const StringPiece& s, size_type pos = 0) const;
162 size_type find_last_of(const StringPiece& s, size_type pos = npos) const;
166 size_type find_last_not_of(const StringPiece& s, size_type pos = npos) const;
169 StringPiece substr(size_type pos, size_type n = npos) const;
184 bool operator==(const StringPiece& x, const StringPiece& y);
186 inline bool operator!=(const StringPiece& x, const StringPiece& y) {
190 inline bool operator<(const StringPiece& x, const StringPiece& y) {
191 const int r = StringPiece::wordmemcmp(
196 inline bool operator>(const StringPiece& x, const StringPiece& y) {
200 inline bool operator<=(const StringPiece& x, const StringPiece& y) {
204 inline bool operator>=(const StringPiece& x, const StringPiece& y) {
210 struct hash<StringPiece> {
211 size_t operator()(const StringPiece& s) const {