omni::structuredlog::BasicStringView

Defined in omni/structuredlog/StringView.h

template<class CharT, class Traits = std::char_traits<CharT>>
class BasicStringView : public carb::cpp17::basic_string_view<CharT, std::char_traits<CharT>>

An extension of carb::cpp17::basic_string_view that can handle nullptr and std::basic_string as inputs.

Template Parameters
  • CharT – The char type pointed to by the view.

  • Traits – The type traits for CharT.

Public Functions

inline constexpr BasicStringView()
inline constexpr BasicStringView(const CharT *s)

Create a string view from a C string.

Parameters

s[in] The C string to create a view into. This original pointer continues to be used and nothing is copied.

inline constexpr BasicStringView(const CharT *s, size_t len)

Create a string view from a char buffer.

Parameters
  • s[in] The char buffer to create a view into. This does not need to be null terminated. This original pointer continues to be used and nothing is copied.

  • len[in] The length of the view into s, in characters.

inline constexpr BasicStringView(const std::basic_string<CharT> &s)

Create a string view from a std::basic_string.

Parameters

s[in] The string to create this string view for.