Home | History | Annotate | Download | only in base

Lines Matching defs:StringPiece

19 // Functions or methods may use const StringPiece& parameters to accept either
21 // a StringPiece. The implicit conversion means that it is often appropriate
23 // StringPiece as would be appropriate for most other Google classes.
25 // Systematic usage of StringPiece is encouraged as it will reduce unnecessary
39 class StringPiece {
46 // in a "const char*" or a "string" wherever a "StringPiece" is
48 StringPiece() : ptr_(NULL), length_(0) { }
49 StringPiece(const char* str) // NOLINT
51 StringPiece(const std::string& str) // NOLINT
53 StringPiece(const char* offset, int len) : ptr_(offset), length_(len) { }
95 int compare(const StringPiece& x) const;
103 // for a StringPiece be called "as_string()". We also leave the
113 bool starts_with(const StringPiece& x) const {
119 bool ends_with(const StringPiece& x) const {
150 size_type find(const StringPiece& s, size_type pos = 0) const;
152 size_type rfind(const StringPiece& s, size_type pos = npos) const;
155 StringPiece substr(size_type pos, size_type n = npos) const;
161 inline bool operator==(const StringPiece& x, const StringPiece& y) {
187 inline bool operator!=(const StringPiece& x, const StringPiece& y) {
191 inline bool operator<(const StringPiece& x, const StringPiece& y) {
197 inline bool operator>(const StringPiece& x, const StringPiece& y) {
201 inline bool operator<=(const StringPiece& x, const StringPiece& y) {
205 inline bool operator>=(const StringPiece& x, const StringPiece& y) {
209 extern std::ostream& operator<<(std::ostream& o, const StringPiece& piece);