quill
|
An implementation of std::basic_string_view
for pre-C++17.
More...
#include <base.h>
Public Types | |
using | value_type = Char |
using | iterator = const Char * |
Public Member Functions | |
constexpr | basic_string_view (const Char *s, size_t count) noexcept |
Constructs a string view object from a C string and a size. | |
constexpr | basic_string_view (nullptr_t)=delete |
FMTQUILL_CONSTEXPR20 | basic_string_view (const Char *s) |
Constructs a string view object from a C string. | |
template<typename S , FMTQUILL_ENABLE_IF(detail::is_std_string_like< S >::value &&std::is_same< typename S::value_type, Char >::value) > | |
FMTQUILL_CONSTEXPR | basic_string_view (const S &s) noexcept |
Constructs a string view from a std::basic_string or a std::basic_string_view object. More... | |
constexpr auto | data () const noexcept -> const Char * |
Returns a pointer to the string data. | |
constexpr auto | size () const noexcept -> size_t |
Returns the string size. | |
constexpr auto | begin () const noexcept -> iterator |
constexpr auto | end () const noexcept -> iterator |
constexpr auto | operator[] (size_t pos) const noexcept -> const Char & |
FMTQUILL_CONSTEXPR void | remove_prefix (size_t n) noexcept |
FMTQUILL_CONSTEXPR auto | starts_with (basic_string_view< Char > sv) const noexcept -> bool |
FMTQUILL_CONSTEXPR auto | starts_with (Char c) const noexcept -> bool |
FMTQUILL_CONSTEXPR auto | starts_with (const Char *s) const -> bool |
FMTQUILL_CONSTEXPR auto | compare (basic_string_view other) const -> int |
Friends | |
FMTQUILL_CONSTEXPR friend auto | operator== (basic_string_view lhs, basic_string_view rhs) -> bool |
auto | operator!= (basic_string_view lhs, basic_string_view rhs) -> bool |
auto | operator< (basic_string_view lhs, basic_string_view rhs) -> bool |
auto | operator<= (basic_string_view lhs, basic_string_view rhs) -> bool |
auto | operator> (basic_string_view lhs, basic_string_view rhs) -> bool |
auto | operator>= (basic_string_view lhs, basic_string_view rhs) -> bool |
An implementation of std::basic_string_view
for pre-C++17.
It provides a subset of the API. fmtquill::basic_string_view
is used for format strings even if std::basic_string_view
is available to prevent issues when a library is compiled with a different -std
option than the client code (which is not recommended).
|
inlinenoexcept |
Constructs a string view from a std::basic_string
or a std::basic_string_view
object.