Scippy

SoPlex

Sequential object-oriented simPlex

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

using char_type = Char

Definition at line 287 of file core.h.

◆ iterator

using iterator = const Char*

Definition at line 288 of file core.h.

Constructor & Destructor Documentation

◆ basic_string_view() [1/5]

Definition at line 290 of file core.h.

◆ basic_string_view() [2/5]

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]

basic_string_view ( const Char *  s)

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

Definition at line 303 of file core.h.

◆ basic_string_view() [4/5]

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]

Definition at line 316 of file core.h.

Member Function Documentation

◆ begin()

◆ compare()

int compare ( basic_string_view< Char >  other) const

Definition at line 336 of file core.h.

◆ data()

◆ end()

◆ operator[]()

FMT_CONSTEXPR const Char& operator[] ( size_t  pos) const

Definition at line 328 of file core.h.

◆ remove_prefix()

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

◆ size()

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 347 of file core.h.

◆ operator<

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

Definition at line 350 of file core.h.

◆ operator<=

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

Definition at line 353 of file core.h.

◆ operator==

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

Definition at line 344 of file core.h.

◆ operator>

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

Definition at line 356 of file core.h.

◆ operator>=

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_

const Char* data_
private

Definition at line 283 of file core.h.

Referenced by basic_string_view< char >::compare().

◆ size_

size_t size_
private

Definition at line 284 of file core.h.

Referenced by basic_string_view< char >::compare().