WPILibC++ 2024.3.2
basic_string_view< Char > Class Template Reference

An implementation of std::basic_string_view for pre-C++17. More...

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/fmtlib/include/fmt/core.h>

Public Types

using value_type = Char
 
using iterator = const Char *
 

Public Member Functions

constexpr basic_string_view () noexcept
 
constexpr basic_string_view (const Char *s, size_t count) noexcept
 Constructs a string reference object from a C string and a size. More...
 
FMT_CONSTEXPR_CHAR_TRAITS FMT_INLINE basic_string_view (const Char *s)
 \rst Constructs a string reference object from a C string computing the size with std::char_traits<Char>::length. More...
 
template<typename Traits , typename Alloc >
FMT_CONSTEXPR basic_string_view (const std::basic_string< Char, Traits, Alloc > &s) noexcept
 Constructs a string reference from a std::basic_string object. More...
 
template<typename S , FMT_ENABLE_IF(std::is_same< S, detail::std_string_view< Char > >::value) >
FMT_CONSTEXPR basic_string_view (S s) noexcept
 
constexpr auto data () const noexcept -> const Char *
 Returns a pointer to the string data. More...
 
constexpr auto size () const noexcept -> size_t
 Returns the string size. More...
 
constexpr auto begin () const noexcept -> iterator
 
constexpr auto end () const noexcept -> iterator
 
constexpr auto operator[] (size_t pos) const noexcept -> const Char &
 
FMT_CONSTEXPR void remove_prefix (size_t n) noexcept
 
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with (basic_string_view< Char > sv) const noexcept
 
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with (Char c) const noexcept
 
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with (const Char *s) const
 
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).

Member Typedef Documentation

◆ iterator

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

◆ value_type

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

Constructor & Destructor Documentation

◆ basic_string_view() [1/5]

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

◆ basic_string_view() [2/5]

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

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

◆ basic_string_view() [3/5]

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

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

\endrst

◆ basic_string_view() [4/5]

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

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

◆ basic_string_view() [5/5]

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

Member Function Documentation

◆ begin()

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

◆ compare()

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

◆ data()

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

Returns a pointer to the string data.

◆ end()

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

◆ operator[]()

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

◆ remove_prefix()

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

◆ size()

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

Returns the string size.

◆ starts_with() [1/3]

template<typename Char >
FMT_CONSTEXPR_CHAR_TRAITS bool basic_string_view< Char >::starts_with ( basic_string_view< Char >  sv) const
inlinenoexcept

◆ starts_with() [2/3]

template<typename Char >
FMT_CONSTEXPR_CHAR_TRAITS bool basic_string_view< Char >::starts_with ( Char  c) const
inlinenoexcept

◆ starts_with() [3/3]

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

Friends And Related Function Documentation

◆ operator!=

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

◆ operator<

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

◆ operator<=

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

◆ operator==

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

◆ operator>

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

◆ operator>=

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

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