MOS Source Code
Loading...
Searching...
No Matches
basic_string_view< CharT > Class Template Reference

#include <string_view.hpp>

Public Member Functions

 basic_string_view (std::nullptr_t)=delete
 
constexpr basic_string_view ()
 
constexpr basic_string_view (const CharT *cs)
 
constexpr basic_string_view (const CharT *s, size_t length)
 
constexpr basic_string_view (const CharT *begin, const CharT *end)
 
const CharT * data () const
 
const CharT & operator[] (size_t index) const
 
size_t size () const
 
bool begins_with (CharT c) const
 
bool begins_with (basic_string_view str) const
 
bool ends_with (CharT c) const
 
bool ends_with (basic_string_view str) const
 
constexpr bool empty () const
 
bool operator== (basic_string_view other) const
 
constexpr basic_string_view substr (size_t start, size_t end=-1) const
 
constexpr size_t find (CharT c, size_t start=0) const
 
constexpr size_t find (basic_string_view str) const
 
constexpr bool starts_with (basic_string_view str) const
 

Static Public Attributes

static constexpr auto npos = size_t(-1)
 

Private Attributes

const CharT * _pointer
 
size_t _length
 

Detailed Description

template<typename CharT>
class mos::basic_string_view< CharT >

Definition at line 47 of file string_view.hpp.

Constructor & Destructor Documentation

◆ basic_string_view() [1/5]

template<typename CharT>
basic_string_view ( std::nullptr_t )
delete

◆ basic_string_view() [2/5]

template<typename CharT>
basic_string_view ( )
inlineconstexpr

Definition at line 52 of file string_view.hpp.

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

◆ basic_string_view() [3/5]

template<typename CharT>
basic_string_view ( const CharT * cs)
inlineconstexpr

Definition at line 53 of file string_view.hpp.

◆ basic_string_view() [4/5]

template<typename CharT>
basic_string_view ( const CharT * s,
size_t length )
inlineconstexpr

Definition at line 59 of file string_view.hpp.

◆ basic_string_view() [5/5]

template<typename CharT>
basic_string_view ( const CharT * begin,
const CharT * end )
inlineconstexpr

Definition at line 65 of file string_view.hpp.

Member Function Documentation

◆ data()

◆ operator[]()

template<typename CharT>
const CharT & operator[] ( size_t index) const
inline

Definition at line 76 of file string_view.hpp.

◆ size()

◆ begins_with() [1/2]

template<typename CharT>
bool begins_with ( CharT c) const
inline

Definition at line 86 of file string_view.hpp.

◆ begins_with() [2/2]

template<typename CharT>
bool begins_with ( basic_string_view< CharT > str) const
inline

Definition at line 91 of file string_view.hpp.

◆ ends_with() [1/2]

template<typename CharT>
bool ends_with ( CharT c) const
inline

Definition at line 99 of file string_view.hpp.

Referenced by dentry_resolve_to_parent().

◆ ends_with() [2/2]

template<typename CharT>
bool ends_with ( basic_string_view< CharT > str) const
inline

Definition at line 104 of file string_view.hpp.

◆ empty()

template<typename CharT>
bool empty ( ) const
inlineconstexpr

Definition at line 112 of file string_view.hpp.

Referenced by cmdline_string_truthiness(), Process::Process(), and split_string().

◆ operator==()

template<typename CharT>
bool operator== ( basic_string_view< CharT > other) const
inline

Definition at line 117 of file string_view.hpp.

◆ substr()

template<typename CharT>
basic_string_view substr ( size_t start,
size_t end = -1 ) const
inlineconstexpr

Definition at line 125 of file string_view.hpp.

Referenced by split_string().

◆ find() [1/2]

template<typename CharT>
size_t find ( CharT c,
size_t start = 0 ) const
inlineconstexpr

Definition at line 131 of file string_view.hpp.

Referenced by split_string().

◆ find() [2/2]

template<typename CharT>
size_t find ( basic_string_view< CharT > str) const
inlineconstexpr

Definition at line 144 of file string_view.hpp.

◆ starts_with()

template<typename CharT>
bool starts_with ( basic_string_view< CharT > str) const
inlineconstexpr

Definition at line 154 of file string_view.hpp.

Member Data Documentation

◆ npos

template<typename CharT>
auto npos = size_t(-1)
staticconstexpr

Definition at line 50 of file string_view.hpp.

◆ _pointer

◆ _length


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