#include <core.h>
Public Types | |
using | value_type = Char |
using | iterator = const Char * |
Public Member Functions | |
constexpr | basic_string_view () FMT_NOEXCEPT |
constexpr | basic_string_view (const Char *s, size_t count) FMT_NOEXCEPT |
basic_string_view (const Char *s) | |
template<typename Traits , typename Alloc > | |
FMT_CONSTEXPR | basic_string_view (const std::basic_string< Char, Traits, Alloc > &s) FMT_NOEXCEPT |
template<typename S , FMT_ENABLE_IF(std::is_same< S, detail::std_string_view< Char >>::value) > | |
FMT_CONSTEXPR | basic_string_view (S s) FMT_NOEXCEPT |
constexpr const Char * | data () const |
constexpr size_t | size () const |
constexpr iterator | begin () const |
constexpr iterator | end () const |
constexpr const Char & | operator[] (size_t pos) const |
FMT_CONSTEXPR void | remove_prefix (size_t n) |
int | compare (basic_string_view other) const |
Private Attributes | |
const Char * | data_ |
size_t | size_ |
Friends | |
bool | operator== (basic_string_view lhs, basic_string_view rhs) |
bool | operator!= (basic_string_view lhs, basic_string_view rhs) |
bool | operator< (basic_string_view lhs, basic_string_view rhs) |
bool | operator<= (basic_string_view lhs, basic_string_view rhs) |
bool | operator> (basic_string_view lhs, basic_string_view rhs) |
bool | operator>= (basic_string_view lhs, basic_string_view rhs) |
An implementation of std::basic_string_view
for pre-C++17. It provides a subset of the API. fmt::basic_string_view
is used for format strings even if std::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).
using value_type = Char |
constexpr basic_string_view | ( | ) |
constexpr basic_string_view | ( | const Char * | s, |
size_t | count | ||
) |
basic_string_view | ( | const Char * | s | ) |
FMT_CONSTEXPR basic_string_view | ( | const std::basic_string< Char, Traits, Alloc > & | s | ) |
FMT_CONSTEXPR basic_string_view | ( | S | s | ) |
constexpr iterator begin | ( | ) | const |
Definition at line 401 of file core.h.
Referenced by basic_format_parse_context< Char >::begin(), detail::copy_unit(), formatter< std::chrono::duration< Rep, Period >, Char >::format(), detail::write(), and arg_formatter_base< OutputIt, Char >::write().
int compare | ( | basic_string_view< Char > | other | ) | const |
constexpr const Char* data | ( | ) | const |
Returns a pointer to the string data.
Definition at line 396 of file core.h.
Referenced by detail::code_point_index(), detail::count_code_points(), int_writer< OutputIt, Char, UInt >::on_num(), detail::parse_format_string(), to_string(), utf8_to_utf16::utf8_to_utf16(), value< basic_format_context >::value(), detail::vformat(), detail::write(), and detail::write_bytes().
constexpr iterator end | ( | ) | const |
Definition at line 402 of file core.h.
Referenced by detail::copy_unit(), basic_format_parse_context< Char >::end(), formatter< std::chrono::duration< Rep, Period >, Char >::format(), formatter< std::chrono::duration< Rep, Period >, Char >::parse(), detail::write(), and arg_formatter_base< OutputIt, Char >::write().
FMT_CONSTEXPR void remove_prefix | ( | size_t | n | ) |
Definition at line 406 of file core.h.
Referenced by basic_format_parse_context< Char >::advance_to(), and compiled_format< S, Args >::compiled_format().
constexpr size_t size | ( | ) | const |
Returns the string size.
Definition at line 399 of file core.h.
Referenced by detail::code_point_index(), compiled_format< S, Args >::compiled_format(), detail::count_code_points(), int_writer< OutputIt, Char, UInt >::on_num(), fill_t< Context::char_type >::operator=(), detail::parse_format_string(), to_string(), utf8_to_utf16::utf8_to_utf16(), value< basic_format_context >::value(), detail::vformat(), detail::write(), arg_formatter_base< OutputIt, Char >::write(), detail::write_bytes(), and write_int_data< Char >::write_int_data().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
Definition at line 357 of file core.h.
Referenced by basic_string_view< char >::compare().
|
private |
Definition at line 358 of file core.h.
Referenced by basic_string_view< char >::compare().