Class string_view

Class Documentation

class opentelemetry::nostd::string_view

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.

Public Types

typedef std::size_t size_type

Public Functions

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

Public Static Attributes

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