34 #ifndef GRPCXX_SUPPORT_STRING_REF_H
35 #define GRPCXX_SUPPORT_STRING_REF_H
59 const static size_t npos = size_t(-1);
64 : data_(other.data_), length_(other.length_) {}
67 string_ref(
const char* s,
size_t l) : data_(s), length_(l) {}
89 size_t size()
const {
return length_; }
90 size_t length()
const {
return length_; }
92 bool empty()
const {
return length_ == 0; }
95 const char*
data()
const {
return data_; }
102 size_t find(
char c)
const;
114 bool operator<(string_ref x, string_ref y);
115 bool operator>(string_ref x, string_ref y);
119 std::ostream&
operator<<(std::ostream& stream,
const string_ref&
string);
123 #endif // GRPCXX_SUPPORT_STRING_REF_H
size_t max_size() const
Definition: string_ref.h:91
const_iterator cend() const
Definition: string_ref.h:74
const_reverse_iterator crend() const
Definition: string_ref.h:84
const_iterator cbegin() const
Definition: string_ref.h:73
std::string string
Definition: config.h:112
size_t size() const
Definition: string_ref.h:89
std::ostream & operator<<(std::ostream &stream, const string_ref &string)
string_ref(const string_ref &other)
Definition: string_ref.h:63
size_t find(string_ref s) const
const_reverse_iterator crbegin() const
Definition: string_ref.h:81
const char * const_iterator
Definition: string_ref.h:55
const_reverse_iterator rbegin() const
Definition: string_ref.h:75
string_ref(const char *s, size_t l)
Definition: string_ref.h:67
string_ref(const grpc::string &s)
Definition: string_ref.h:68
const char * data() const
Definition: string_ref.h:95
const_iterator end() const
Definition: string_ref.h:72
string_ref()
Definition: string_ref.h:62
bool operator<(string_ref x, string_ref y)
string_ref & operator=(const string_ref &rhs)
static const size_t npos
Definition: string_ref.h:59
bool operator<=(string_ref x, string_ref y)
bool operator>(string_ref x, string_ref y)
const_reverse_iterator rend() const
Definition: string_ref.h:78
This class is a non owning reference to a string.
Definition: string_ref.h:52
bool starts_with(string_ref x) const
bool empty() const
Definition: string_ref.h:92
bool operator==(string_ref x, string_ref y)
bool ends_with(string_ref x) const
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: string_ref.h:56
const_iterator begin() const
Definition: string_ref.h:71
bool operator!=(string_ref x, string_ref y)
string_ref substr(size_t pos, size_t n=npos) const
bool operator>=(string_ref x, string_ref y)
int compare(string_ref x) const
size_t length() const
Definition: string_ref.h:90