GRPC C++  1.30.0
Public Types | Public Member Functions | Data Fields | Static Public Attributes
grpc::string_ref Class Reference

This class is a non owning reference to a string. More...

#include <string_ref.h>

Public Types

typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 string_ref ()
 construct/copy. More...
 
 string_ref (const string_ref &other)
 
string_refoperator= (const string_ref &rhs)
 
 string_ref (const char *s)
 
 string_ref (const char *s, size_t l)
 
 string_ref (const grpc::string &s)
 
const_iterator begin () const
 iterators More...
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
size_t size () const
 capacity More...
 
size_t length () const
 
size_t max_size () const
 
bool empty () const
 
const char * data () const
 element access More...
 
int compare (string_ref x) const
 string operations More...
 
bool starts_with (string_ref x) const
 
bool ends_with (string_ref x) const
 
size_t find (string_ref s) const
 
size_t find (char c) const
 
string_ref substr (size_t pos, size_t n=npos) const
 

Data Fields

const typedef char * const_iterator
 types More...
 

Static Public Attributes

const static size_t npos
 constants More...
 

Detailed Description

This class is a non owning reference to a string.

It should be a strict subset of the upcoming std::string_ref.

See also
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3442.html

The constexpr is dropped or replaced with const for legacy compiler compatibility.

Member Typedef Documentation

◆ const_reverse_iterator

Constructor & Destructor Documentation

◆ string_ref() [1/5]

grpc::string_ref::string_ref ( )
inline

construct/copy.

◆ string_ref() [2/5]

grpc::string_ref::string_ref ( const string_ref other)
inline

◆ string_ref() [3/5]

grpc::string_ref::string_ref ( const char *  s)
inline

◆ string_ref() [4/5]

grpc::string_ref::string_ref ( const char *  s,
size_t  l 
)
inline

◆ string_ref() [5/5]

grpc::string_ref::string_ref ( const grpc::string s)
inline

Member Function Documentation

◆ begin()

const_iterator grpc::string_ref::begin ( ) const
inline

iterators

◆ cbegin()

const_iterator grpc::string_ref::cbegin ( ) const
inline

◆ cend()

const_iterator grpc::string_ref::cend ( ) const
inline

◆ compare()

int grpc::string_ref::compare ( string_ref  x) const
inline

string operations

◆ crbegin()

const_reverse_iterator grpc::string_ref::crbegin ( ) const
inline

◆ crend()

const_reverse_iterator grpc::string_ref::crend ( ) const
inline

◆ data()

const char* grpc::string_ref::data ( ) const
inline

element access

◆ empty()

bool grpc::string_ref::empty ( ) const
inline

◆ end()

const_iterator grpc::string_ref::end ( ) const
inline

◆ ends_with()

bool grpc::string_ref::ends_with ( string_ref  x) const
inline

◆ find() [1/2]

size_t grpc::string_ref::find ( char  c) const
inline

◆ find() [2/2]

size_t grpc::string_ref::find ( string_ref  s) const
inline

◆ length()

size_t grpc::string_ref::length ( ) const
inline

◆ max_size()

size_t grpc::string_ref::max_size ( ) const
inline

◆ operator=()

string_ref& grpc::string_ref::operator= ( const string_ref rhs)
inline

◆ rbegin()

const_reverse_iterator grpc::string_ref::rbegin ( ) const
inline

◆ rend()

const_reverse_iterator grpc::string_ref::rend ( ) const
inline

◆ size()

size_t grpc::string_ref::size ( ) const
inline

capacity

◆ starts_with()

bool grpc::string_ref::starts_with ( string_ref  x) const
inline

◆ substr()

string_ref grpc::string_ref::substr ( size_t  pos,
size_t  n = npos 
) const
inline

Field Documentation

◆ const_iterator

const typedef char* grpc::string_ref::const_iterator

types

◆ npos

const static size_t grpc::string_ref::npos
static

constants


The documentation for this class was generated from the following file: