#include <core.h>
Public Types | |
using | char_type = Char |
using | iterator = const Char * |
Public Member Functions | |
FMT_CONSTEXPR | basic_string_view () FMT_NOEXCEPT |
FMT_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, internal::std_string_view< Char >>::value) > | |
FMT_CONSTEXPR | basic_string_view (S s) FMT_NOEXCEPT |
FMT_CONSTEXPR const Char * | data () const |
FMT_CONSTEXPR size_t | size () const |
FMT_CONSTEXPR iterator | begin () const |
FMT_CONSTEXPR iterator | end () const |
FMT_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).
FMT_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 | ) |
FMT_CONSTEXPR iterator begin | ( | ) | const |
Definition at line 325 of file core.h.
Referenced by basic_format_parse_context< Char >::begin(), compiled_format< S, Args >::compiled_format(), formatter< std::chrono::duration< Rep, Period >, Char >::format(), basic_writer< Range >::padded_int_writer< F >::operator()(), and basic_writer< Range >::write().
int compare | ( | basic_string_view< Char > | other | ) | const |
FMT_CONSTEXPR const Char* data | ( | ) | const |
Returns a pointer to the string data.
Definition at line 320 of file core.h.
Referenced by internal::code_point_index(), internal::count_code_points(), formatter< internal::bigint >::format(), internal::parse_format_string(), value< basic_format_context >::value(), and basic_writer< Range >::write().
FMT_CONSTEXPR iterator end | ( | ) | const |
Definition at line 326 of file core.h.
Referenced by compiled_format< S, Args >::compiled_format(), basic_format_parse_context< Char >::end(), formatter< std::chrono::duration< Rep, Period >, Char >::format(), basic_writer< Range >::padded_int_writer< F >::operator()(), formatter< std::chrono::duration< Rep, Period >, Char >::parse(), and basic_writer< Range >::write().
FMT_CONSTEXPR const Char& operator[] | ( | size_t | pos | ) | const |
FMT_CONSTEXPR void remove_prefix | ( | size_t | n | ) |
Definition at line 330 of file core.h.
Referenced by basic_format_parse_context< Char >::advance_to().
FMT_CONSTEXPR size_t size | ( | ) | const |
Returns the string size.
Definition at line 323 of file core.h.
Referenced by internal::code_point_index(), compiled_format< S, Args >::compiled_format(), internal::count_code_points(), formatter< internal::bigint >::format(), basic_writer< Range >::padded_int_writer< F >::operator()(), internal::parse_format_string(), value< basic_format_context >::value(), basic_writer< Range >::write(), and basic_writer< Range >::write_int().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
Definition at line 283 of file core.h.
Referenced by basic_string_view< char >::compare().
|
private |
Definition at line 284 of file core.h.
Referenced by basic_string_view< char >::compare().