Home | History | Annotate | Download | only in re2

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
29 class StringPiece {
36 // in a "const char*" or a "string" wherever a "StringPiece" is
38 StringPiece() : ptr_(NULL), length_(0) { }
39 StringPiece(const char* str)
41 StringPiece(const std::string& str)
43 StringPiece(const char* offset, int len) : ptr_(offset), length_(len) { }
79 int compare(const StringPiece& x) const {
94 // for a StringPiece be called "as_string()". We also leave the
104 bool starts_with(const StringPiece& x) const {
110 bool ends_with(const StringPiece& x) const {
141 int find(const StringPiece& s, size_type pos = 0) const;
143 int rfind(const StringPiece& s, size_type pos = npos) const;
146 StringPiece substr(size_type pos, size_type n = npos) const;
148 static bool _equal(const StringPiece&, const StringPiece&);
151 inline bool operator==(const StringPiece& x, const StringPiece& y) {
152 return StringPiece::_equal(x, y);
155 inline bool operator!=(const StringPiece& x, const StringPiece& y) {
159 inline bool operator<(const StringPiece& x, const StringPiece& y) {
165 inline 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) {
179 // allow StringPiece to be logged
180 extern std::ostream& operator<<(std::ostream& o, const re2::StringPiece& piece);