SoPlex Documentation
Loading...
Searching...
No Matches
basic_string_view< Char > Class Template Reference

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

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 281 of file core.h.

Member Typedef Documentation

◆ char_type

template<typename Char >
using char_type = Char

Definition at line 287 of file core.h.

◆ iterator

template<typename Char >
using iterator = const Char*

Definition at line 288 of file core.h.

Constructor & Destructor Documentation

◆ basic_string_view() [1/5]

template<typename Char >
FMT_CONSTEXPR basic_string_view ( )

Definition at line 290 of file core.h.

◆ basic_string_view() [2/5]

template<typename Char >
FMT_CONSTEXPR basic_string_view ( const Char * s,
size_t count )

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

Definition at line 293 of file core.h.

◆ basic_string_view() [3/5]

template<typename Char >
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. \endrst

Definition at line 303 of file core.h.

◆ basic_string_view() [4/5]

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

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

Definition at line 308 of file core.h.

◆ basic_string_view() [5/5]

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

Definition at line 316 of file core.h.

Member Function Documentation

◆ begin()

◆ compare()

template<typename Char >
int compare ( basic_string_view< Char > other) const

Definition at line 336 of file core.h.

References basic_string_view< Char >::data_, and basic_string_view< Char >::size_.

◆ data()

template<typename Char >
FMT_CONSTEXPR const Char * data ( ) const

◆ end()

◆ operator[]()

template<typename Char >
FMT_CONSTEXPR const Char & operator[] ( size_t pos) const

Definition at line 328 of file core.h.

References basic_string_view< Char >::data_.

◆ remove_prefix()

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

Definition at line 330 of file core.h.

References basic_string_view< Char >::data_, and basic_string_view< Char >::size_.

◆ size()

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 347 of file core.h.

◆ operator<

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

Definition at line 350 of file core.h.

◆ operator<=

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

Definition at line 353 of file core.h.

◆ operator==

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

Definition at line 344 of file core.h.

◆ operator>

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

Definition at line 356 of file core.h.

◆ operator>=

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

Definition at line 359 of file core.h.

Member Data Documentation

◆ data_

◆ size_

template<typename Char >
size_t size_
private