Lines Matching defs:StringPiece

7 // Functions or methods may use const StringPiece& parameters to accept either
9 // a StringPiece. The implicit conversion means that it is often appropriate
11 // StringPiece as would be appropriate for most other Google classes.
13 // Systematic usage of StringPiece is encouraged as it will reduce unnecessary
32 class StringPiece {
39 // in a "const char*" or a "string" wherever a "StringPiece" is
41 StringPiece() : ptr_(NULL), length_(0) { }
42 StringPiece(const char* str)
44 StringPiece(const std::string& str)
46 StringPiece(const char* offset, int len) : ptr_(offset), length_(len) { }
82 int compare(const StringPiece& x) const {
97 // for a StringPiece be called "as_string()". We also leave the
107 bool starts_with(const StringPiece& x) const {
113 bool ends_with(const StringPiece& x) const {
144 int find(const StringPiece& s, size_type pos = 0) const;
146 int rfind(const StringPiece& s, size_type pos = npos) const;
149 StringPiece substr(size_type pos, size_type n = npos) const;
151 static bool _equal(const StringPiece&, const StringPiece&);
154 inline bool operator==(const StringPiece& x, const StringPiece& y) {
155 return StringPiece::_equal(x, y);
158 inline bool operator!=(const StringPiece& x, const StringPiece& y) {
162 inline bool operator<(const StringPiece& x, const StringPiece& y) {
168 inline bool operator>(const StringPiece& x, const StringPiece& y) {
172 inline bool operator<=(const StringPiece& x, const StringPiece& y) {
176 inline bool operator>=(const StringPiece& x, const StringPiece& y) {
182 // allow StringPiece to be logged
183 extern std::ostream& operator<<(std::ostream& o, const re2::StringPiece& piece);