|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
6 #if defined(OPENTELEMETRY_STL_VERSION)
7 # if OPENTELEMETRY_STL_VERSION >= 2017
8 # include "opentelemetry/std/string_view.h"
9 # define OPENTELEMETRY_HAVE_STD_STRING_VIEW
13 #if !defined(OPENTELEMETRY_HAVE_STD_STRING_VIEW)
16 # include <functional>
20 # include <type_traits>
23 # include "opentelemetry/version.h"
29 using Traits = std::char_traits<char>;
46 string_view(
const char *str) noexcept : length_(std::strlen(str)), data_(str) {}
49 : length_(str.length()), data_(str.c_str())
54 explicit operator std::string()
const {
return {data_, length_}; }
56 const char *
data() const noexcept {
return data_; }
58 bool empty() const noexcept {
return length_ == 0; }
64 const char *
begin() const noexcept {
return data(); }
75 throw std::out_of_range{
"opentelemetry::nostd::string_view"};
87 int result = Traits::compare(
data(), v.data(), len);
89 result =
size() == v.size() ? 0 : (
size() < v.size() ? -1 : 1);
127 res = found -
data();
147 return lhs.length() == rhs.length() &&
148 # if defined(_MSC_VER)
149 # if _MSC_VER >= 1900 && _MSC_VER <= 1911
151 (std::memcmp(lhs.data(), rhs.data(), lhs.length()) == 0);
153 std::equal(lhs.data(), lhs.data() + lhs.length(), rhs.data());
156 std::equal(lhs.data(), lhs.data() + lhs.length(), rhs.data());
182 return !(lhs == rhs);
187 return !(lhs == rhs);
192 return !(lhs == rhs);
197 return !(lhs == rhs);
202 return !(lhs == rhs);
207 return os.write(s.
data(),
static_cast<std::streamsize
>(s.
length()));
221 auto s = std::string(k.data(), k.size());
222 return std::hash<std::string>{}(s);
std::size_t operator()(const OPENTELEMETRY_NAMESPACE::nostd::string_view &k) const
constexpr const char * find
bool empty() const noexcept
int compare(size_type pos1, size_type count1, const char *s, size_type count2) const
bool operator>(const string_view v) const noexcept
std::ostream & operator<<(std::ostream &os, string_view s)
int compare(size_type pos1, size_type count1, string_view v) const
bool operator==(const shared_ptr< T1 > &lhs, const shared_ptr< T2 > &rhs) noexcept
bool operator!=(const shared_ptr< T1 > &lhs, const shared_ptr< T2 > &rhs) noexcept
const char * begin() const noexcept
#define OPENTELEMETRY_BEGIN_NAMESPACE
string_view substr(size_type pos, size_type n=npos) const
string_view(const char *str, size_type len) noexcept
int compare(string_view v) const noexcept
const char & operator[](size_type i)
#define OPENTELEMETRY_ATTRIBUTE_LIFETIME_BOUND
#define OPENTELEMETRY_END_NAMESPACE
size_type size() const noexcept
#define OPENTELEMETRY_NAMESPACE
bool operator<(const string_view v) const noexcept
int compare(size_type pos1, size_type count1, string_view v, size_type pos2, size_type count2) const
const char * end() const noexcept
size_type length() const noexcept
constexpr const char * terminate
int compare(const char *s) const
int min(int a, int b)
Compute the component-wise minimum.
Extensions to the C++ standard library.
string_view(const char *str) noexcept
std::char_traits< char > Traits
const char * data() const noexcept
size_type find(char ch, size_type pos=0) const noexcept
int compare(size_type pos1, size_type count1, const char *s) const
static constexpr size_type npos
std::string_view string_view
string_view(const std::basic_string< char > &str OPENTELEMETRY_ATTRIBUTE_LIFETIME_BOUND) noexcept
Back port of std::string_view to work with pre-cpp-17 compilers.