NVIDIA DeepStream SDK API Reference

9.2 Release
nostd::string_view Class Reference

Detailed Description

Back port of std::string_view to work with pre-cpp-17 compilers.

Note: This provides a subset of the methods available on std::string_view but tries to be as compatible as possible with the std::string_view interface.

Definition at line 37 of file includes/opentelemetry/nostd/string_view.h.

Public Types

typedef std::size_t size_type
 
typedef std::size_t size_type
 

Public Member Functions

 string_view () noexcept
 
 string_view (const char *str) noexcept
 
 string_view (const std::basic_string< char > &str OPENTELEMETRY_ATTRIBUTE_LIFETIME_BOUND) noexcept
 
 string_view (const char *str, size_type len) noexcept
 
 operator std::string () const
 
const char * data () const noexcept
 
bool empty () const noexcept
 
size_type length () const noexcept
 
size_type size () const noexcept
 
const char * begin () const noexcept
 
const char * end () const noexcept
 
const char & operator[] (size_type i)
 
string_view substr (size_type pos, size_type n=npos) const
 
int compare (string_view v) const noexcept
 
int compare (size_type pos1, size_type count1, string_view v) const
 
int compare (size_type pos1, size_type count1, string_view v, size_type pos2, size_type count2) const
 
int compare (const char *s) const
 
int compare (size_type pos1, size_type count1, const char *s) const
 
int compare (size_type pos1, size_type count1, const char *s, size_type count2) const
 
size_type find (char ch, size_type pos=0) const noexcept
 
bool operator< (const string_view v) const noexcept
 
bool operator> (const string_view v) const noexcept
 
 string_view () noexcept
 
 string_view (const char *str) noexcept
 
 string_view (const std::basic_string< char > &str OPENTELEMETRY_ATTRIBUTE_LIFETIME_BOUND) noexcept
 
 string_view (const char *str, size_type len) noexcept
 
 operator std::string () const
 
const char * data () const noexcept
 
bool empty () const noexcept
 
size_type length () const noexcept
 
size_type size () const noexcept
 
const char * begin () const noexcept
 
const char * end () const noexcept
 
const char & operator[] (size_type i)
 
string_view substr (size_type pos, size_type n=npos) const
 
int compare (string_view v) const noexcept
 
int compare (size_type pos1, size_type count1, string_view v) const
 
int compare (size_type pos1, size_type count1, string_view v, size_type pos2, size_type count2) const
 
int compare (const char *s) const
 
int compare (size_type pos1, size_type count1, const char *s) const
 
int compare (size_type pos1, size_type count1, const char *s, size_type count2) const
 
size_type find (char ch, size_type pos=0) const noexcept
 
bool operator< (const string_view v) const noexcept
 
bool operator> (const string_view v) const noexcept
 

Static Public Attributes

static constexpr size_type npos = static_cast<size_type>(-1)
 

Member Typedef Documentation

◆ size_type [1/2]

typedef std::size_t nostd::string_view::size_type

Definition at line 40 of file includes/opentelemetry/nostd/string_view.h.

◆ size_type [2/2]

typedef std::size_t nostd::string_view::size_type

Constructor & Destructor Documentation

◆ string_view() [1/8]

nostd::string_view::string_view ( )
inlinenoexcept

Definition at line 44 of file includes/opentelemetry/nostd/string_view.h.

Referenced by compare(), and substr().

◆ string_view() [2/8]

nostd::string_view::string_view ( const char *  str)
inlinenoexcept

Definition at line 46 of file includes/opentelemetry/nostd/string_view.h.

◆ string_view() [3/8]

nostd::string_view::string_view ( const std::basic_string< char > &str  OPENTELEMETRY_ATTRIBUTE_LIFETIME_BOUND)
inlinenoexcept

Definition at line 48 of file includes/opentelemetry/nostd/string_view.h.

◆ string_view() [4/8]

nostd::string_view::string_view ( const char *  str,
size_type  len 
)
inlinenoexcept

Definition at line 52 of file includes/opentelemetry/nostd/string_view.h.

◆ string_view() [5/8]

nostd::string_view::string_view ( )
inlinenoexcept

◆ string_view() [6/8]

nostd::string_view::string_view ( const char *  str)
inlinenoexcept

◆ string_view() [7/8]

nostd::string_view::string_view ( const std::basic_string< char > &str  OPENTELEMETRY_ATTRIBUTE_LIFETIME_BOUND)
inlinenoexcept

◆ string_view() [8/8]

nostd::string_view::string_view ( const char *  str,
size_type  len 
)
inlinenoexcept

Member Function Documentation

◆ begin() [1/2]

const char* nostd::string_view::begin ( ) const
inlinenoexcept

Definition at line 64 of file includes/opentelemetry/nostd/string_view.h.

References data().

Referenced by trace::propagation::detail::IsValidHex().

◆ begin() [2/2]

const char* nostd::string_view::begin ( ) const
inlinenoexcept

Definition at line 64 of file 9.2/includes/opentelemetry/nostd/string_view.h.

References data().

◆ compare() [1/12]

int nostd::string_view::compare ( const char *  s) const
inline

Definition at line 107 of file includes/opentelemetry/nostd/string_view.h.

References compare(), and string_view().

Referenced by compare().

◆ compare() [2/12]

int nostd::string_view::compare ( const char *  s) const
inline

Definition at line 107 of file 9.2/includes/opentelemetry/nostd/string_view.h.

References compare(), and string_view().

Referenced by compare().

◆ compare() [3/12]

int nostd::string_view::compare ( size_type  pos1,
size_type  count1,
const char *  s 
) const
inline

◆ compare() [4/12]

int nostd::string_view::compare ( size_type  pos1,
size_type  count1,
const char *  s 
) const
inline

Definition at line 109 of file includes/opentelemetry/nostd/string_view.h.

References compare(), string_view(), and substr().

◆ compare() [5/12]

int nostd::string_view::compare ( size_type  pos1,
size_type  count1,
const char *  s,
size_type  count2 
) const
inline

◆ compare() [6/12]

int nostd::string_view::compare ( size_type  pos1,
size_type  count1,
const char *  s,
size_type  count2 
) const
inline

Definition at line 114 of file includes/opentelemetry/nostd/string_view.h.

References compare(), string_view(), and substr().

◆ compare() [7/12]

int nostd::string_view::compare ( size_type  pos1,
size_type  count1,
string_view  v 
) const
inline

Definition at line 93 of file includes/opentelemetry/nostd/string_view.h.

References compare(), and substr().

◆ compare() [8/12]

int nostd::string_view::compare ( size_type  pos1,
size_type  count1,
string_view  v 
) const
inline

Definition at line 93 of file 9.2/includes/opentelemetry/nostd/string_view.h.

References compare(), and substr().

◆ compare() [9/12]

int nostd::string_view::compare ( size_type  pos1,
size_type  count1,
string_view  v,
size_type  pos2,
size_type  count2 
) const
inline

Definition at line 98 of file includes/opentelemetry/nostd/string_view.h.

References compare(), and substr().

◆ compare() [10/12]

int nostd::string_view::compare ( size_type  pos1,
size_type  count1,
string_view  v,
size_type  pos2,
size_type  count2 
) const
inline

Definition at line 98 of file 9.2/includes/opentelemetry/nostd/string_view.h.

References compare(), and substr().

◆ compare() [11/12]

int nostd::string_view::compare ( string_view  v) const
inlinenoexcept

Definition at line 84 of file includes/opentelemetry/nostd/string_view.h.

References data(), min(), and size().

Referenced by compare(), operator<(), and operator>().

◆ compare() [12/12]

int nostd::string_view::compare ( string_view  v) const
inlinenoexcept

Definition at line 84 of file 9.2/includes/opentelemetry/nostd/string_view.h.

References data(), min(), and size().

◆ data() [1/2]

const char* nostd::string_view::data ( ) const
inlinenoexcept

◆ data() [2/2]

◆ empty() [1/2]

bool nostd::string_view::empty ( ) const
inlinenoexcept

◆ empty() [2/2]

bool nostd::string_view::empty ( ) const
inlinenoexcept

◆ end() [1/2]

const char* nostd::string_view::end ( ) const
inlinenoexcept

Definition at line 66 of file 9.2/includes/opentelemetry/nostd/string_view.h.

References data(), and length().

◆ end() [2/2]

const char* nostd::string_view::end ( ) const
inlinenoexcept

Definition at line 66 of file includes/opentelemetry/nostd/string_view.h.

References data(), and length().

Referenced by trace::propagation::detail::IsValidHex().

◆ find() [1/2]

◆ find() [2/2]

size_type nostd::string_view::find ( char  ch,
size_type  pos = 0 
) const
inlinenoexcept

◆ length() [1/2]

◆ length() [2/2]

size_type nostd::string_view::length ( ) const
inlinenoexcept

◆ operator std::string() [1/2]

nostd::string_view::operator std::string ( ) const
inlineexplicit

Definition at line 54 of file includes/opentelemetry/nostd/string_view.h.

◆ operator std::string() [2/2]

nostd::string_view::operator std::string ( ) const
inlineexplicit

◆ operator<() [1/2]

bool nostd::string_view::operator< ( const string_view  v) const
inlinenoexcept

Definition at line 133 of file 9.2/includes/opentelemetry/nostd/string_view.h.

References compare().

◆ operator<() [2/2]

bool nostd::string_view::operator< ( const string_view  v) const
inlinenoexcept

Definition at line 133 of file includes/opentelemetry/nostd/string_view.h.

References compare().

◆ operator>() [1/2]

bool nostd::string_view::operator> ( const string_view  v) const
inlinenoexcept

Definition at line 135 of file includes/opentelemetry/nostd/string_view.h.

References compare().

◆ operator>() [2/2]

bool nostd::string_view::operator> ( const string_view  v) const
inlinenoexcept

Definition at line 135 of file 9.2/includes/opentelemetry/nostd/string_view.h.

References compare().

◆ operator[]() [1/2]

const char& nostd::string_view::operator[] ( size_type  i)
inline

Definition at line 68 of file 9.2/includes/opentelemetry/nostd/string_view.h.

References data().

◆ operator[]() [2/2]

const char& nostd::string_view::operator[] ( size_type  i)
inline

Definition at line 68 of file includes/opentelemetry/nostd/string_view.h.

References data().

◆ size() [1/2]

◆ size() [2/2]

size_type nostd::string_view::size ( ) const
inlinenoexcept

◆ substr() [1/2]

◆ substr() [2/2]

string_view nostd::string_view::substr ( size_type  pos,
size_type  n = npos 
) const
inline

Field Documentation

◆ npos

static constexpr size_type nostd::string_view::npos = static_cast<size_type>(-1)
staticconstexpr

Definition at line 42 of file includes/opentelemetry/nostd/string_view.h.

Referenced by find().


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