HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
basic_string_view< Char > Class Template Reference

#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
 
FMT_CONSTEXPR_CHAR_TRAITS
FMT_INLINE 
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 auto data () const -> const Char *
 
constexpr auto size () const -> size_t
 
constexpr auto begin () const -> iterator
 
constexpr auto end () const -> iterator
 
constexpr auto operator[] (size_t pos) const -> const Char &
 
FMT_CONSTEXPR void remove_prefix (size_t n)
 
FMT_CONSTEXPR_CHAR_TRAITS auto compare (basic_string_view other) const -> int
 

Friends

FMT_CONSTEXPR_CHAR_TRAITS
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
 

Detailed Description

template<typename Char>
class basic_string_view< Char >

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).

Definition at line 429 of file core.h.

Member Typedef Documentation

template<typename Char>
using basic_string_view< Char >::iterator = const Char*

Definition at line 436 of file core.h.

template<typename Char>
using basic_string_view< Char >::value_type = Char

Definition at line 435 of file core.h.

Constructor & Destructor Documentation

template<typename Char>
constexpr basic_string_view< Char >::basic_string_view ( )
inline

Definition at line 438 of file core.h.

template<typename Char>
constexpr basic_string_view< Char >::basic_string_view ( const Char *  s,
size_t  count 
)
inline

Constructs a string reference object from a C string and a size.

Definition at line 441 of file core.h.

template<typename Char>
FMT_CONSTEXPR_CHAR_TRAITS FMT_INLINE basic_string_view< Char >::basic_string_view ( const Char *  s)
inline

Constructs a string reference object from a C string computing the size with std::char_traits<Char>length.

Definition at line 453 of file core.h.

template<typename Char>
template<typename Traits , typename Alloc >
FMT_CONSTEXPR basic_string_view< Char >::basic_string_view ( const std::basic_string< Char, Traits, Alloc > &  s)
inline

Constructs a string reference from a std::basic_string object.

Definition at line 463 of file core.h.

template<typename Char>
template<typename S , FMT_ENABLE_IF(std::is_same< S, detail::std_string_view< Char >>::value) >
FMT_CONSTEXPR basic_string_view< Char >::basic_string_view ( S  s)
inline

Definition at line 470 of file core.h.

Member Function Documentation

template<typename Char>
constexpr auto basic_string_view< Char >::begin ( void  ) const -> iterator
inline

Definition at line 479 of file core.h.

template<typename Char>
FMT_CONSTEXPR_CHAR_TRAITS auto basic_string_view< Char >::compare ( basic_string_view< Char >  other) const -> int
inline

Definition at line 492 of file core.h.

template<typename Char>
constexpr auto basic_string_view< Char >::data ( ) const -> const Char*
inline

Returns a pointer to the string data.

Definition at line 474 of file core.h.

template<typename Char>
constexpr auto basic_string_view< Char >::end ( void  ) const -> iterator
inline

Definition at line 480 of file core.h.

template<typename Char>
constexpr auto basic_string_view< Char >::operator[] ( size_t  pos) const -> const Char&
inline

Definition at line 482 of file core.h.

template<typename Char>
FMT_CONSTEXPR void basic_string_view< Char >::remove_prefix ( size_t  n)
inline

Definition at line 486 of file core.h.

template<typename Char>
constexpr auto basic_string_view< Char >::size ( void  ) const -> size_t
inline

Returns the string size.

Definition at line 477 of file core.h.

Friends And Related Function Documentation

template<typename Char>
auto operator!= ( basic_string_view< Char >  lhs,
basic_string_view< Char >  rhs 
) -> bool
friend

Definition at line 505 of file core.h.

template<typename Char>
auto operator< ( basic_string_view< Char >  lhs,
basic_string_view< Char >  rhs 
) -> bool
friend

Definition at line 508 of file core.h.

template<typename Char>
auto operator<= ( basic_string_view< Char >  lhs,
basic_string_view< Char >  rhs 
) -> bool
friend

Definition at line 511 of file core.h.

template<typename Char>
FMT_CONSTEXPR_CHAR_TRAITS friend auto operator== ( basic_string_view< Char >  lhs,
basic_string_view< Char >  rhs 
) -> bool
friend

Definition at line 500 of file core.h.

template<typename Char>
auto operator> ( basic_string_view< Char >  lhs,
basic_string_view< Char >  rhs 
) -> bool
friend

Definition at line 514 of file core.h.

template<typename Char>
auto operator>= ( basic_string_view< Char >  lhs,
basic_string_view< Char >  rhs 
) -> bool
friend

Definition at line 517 of file core.h.


The documentation for this class was generated from the following file: