Seastar
High performance C++ framework for concurrent servers
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
seastar::basic_sstring< char_type, Size, max_size, NulTerminate > Class Template Reference

Classes

struct  initialized_later
 

Public Types

using value_type = char_type
 
using traits_type = std::char_traits< char_type >
 
using allocator_type = std::allocator< char_type >
 
using reference = char_type &
 
using const_reference = const char_type &
 
using pointer = char_type *
 
using const_pointer = const char_type *
 
using iterator = char_type *
 
using const_iterator = const char_type *
 
using difference_type = ssize_t
 
using size_type = Size
 

Public Member Functions

 basic_sstring (const basic_sstring &x)
 
 basic_sstring (basic_sstring &&x) noexcept
 
 basic_sstring (initialized_later, size_t size)
 
 basic_sstring (const char_type *x, size_t size)
 
 basic_sstring (size_t size, char_type x)
 
 basic_sstring (const char *x)
 
 basic_sstring (std::basic_string< char_type > &x)
 
 basic_sstring (std::initializer_list< char_type > x)
 
 basic_sstring (const char_type *b, const char_type *e)
 
 basic_sstring (const std::basic_string< char_type > &s)
 
template<typename InputIterator >
 basic_sstring (InputIterator first, InputIterator last)
 
 basic_sstring (compat::basic_string_view< char_type, traits_type > v)
 
basic_sstringoperator= (const basic_sstring &x)
 
basic_sstringoperator= (basic_sstring &&x) noexcept
 
 operator std::basic_string< char_type > () const
 
size_t size () const noexcept
 
size_t length () const noexcept
 
size_t find (char_type t, size_t pos=0) const noexcept
 
size_t find (const basic_sstring &s, size_t pos=0) const noexcept
 
size_t find_last_of (char_type c, size_t pos=npos) const noexcept
 
basic_sstringappend (const char_type *s, size_t n)
 
void resize (size_t n, const char_type c='\0')
 
basic_sstringreplace (size_type pos, size_type n1, const char_type *s, size_type n2)
 
template<class InputIterator >
basic_sstringreplace (const_iterator i1, const_iterator i2, InputIterator first, InputIterator last)
 
iterator erase (iterator first, iterator last)
 
template<class InputIterator >
void insert (const_iterator p, InputIterator beg, InputIterator end)
 
reference back () noexcept
 
const_reference back () const noexcept
 
basic_sstring substr (size_t from, size_t len=npos) const
 
const char_type & at (size_t pos) const
 
char_type & at (size_t pos)
 
bool empty () const noexcept
 
void reset () noexcept
 
temporary_buffer< char_type > release () &&
 
int compare (const basic_sstring &x) const noexcept
 
int compare (size_t pos, size_t sz, const basic_sstring &x) const
 
void swap (basic_sstring &x) noexcept
 
char_type * data ()
 
const char_type * data () const
 
const char_type * c_str () const
 
const char_type * begin () const
 
const char_type * end () const
 
const char_type * cbegin () const
 
const char_type * cend () const
 
char_type * begin ()
 
char_type * end ()
 
bool operator== (const basic_sstring &x) const
 
bool operator!= (const basic_sstring &x) const
 
bool operator< (const basic_sstring &x) const
 
basic_sstring operator+ (const basic_sstring &x) const
 
basic_sstringoperator+= (const basic_sstring &x)
 
char_type & operator[] (size_type pos)
 
const char_type & operator[] (size_type pos) const
 
 operator compat::basic_string_view< char_type > () const
 

Static Public Member Functions

static constexpr unsigned padding ()
 

Static Public Attributes

static constexpr size_type npos = static_cast<size_type>(-1)
 

Friends

template<typename string_type , typename T >
string_type to_sstring (T value)
 

Class Documentation

◆ seastar::basic_sstring::initialized_later

struct seastar::basic_sstring::initialized_later

Member Function Documentation

◆ append()

template<typename char_type, typename Size, Size max_size, bool NulTerminate>
basic_sstring& seastar::basic_sstring< char_type, Size, max_size, NulTerminate >::append ( const char_type *  s,
size_t  n 
)
inline

Append a C substring.

Parameters
sThe C string to append.
nThe number of characters to append.
Returns
Reference to this string.

◆ back() [1/2]

template<typename char_type, typename Size, Size max_size, bool NulTerminate>
reference seastar::basic_sstring< char_type, Size, max_size, NulTerminate >::back ( )
inlinenoexcept

Returns a read/write reference to the data at the last element of the string. This function shall not be called on empty strings.

◆ back() [2/2]

template<typename char_type, typename Size, Size max_size, bool NulTerminate>
const_reference seastar::basic_sstring< char_type, Size, max_size, NulTerminate >::back ( ) const
inlinenoexcept

Returns a read-only (constant) reference to the data at the last element of the string. This function shall not be called on empty strings.

◆ find_last_of()

template<typename char_type, typename Size, Size max_size, bool NulTerminate>
size_t seastar::basic_sstring< char_type, Size, max_size, NulTerminate >::find_last_of ( char_type  c,
size_t  pos = npos 
) const
inlinenoexcept

find_last_of find the last occurrence of c in the string. When pos is specified, the search only includes characters at or before position pos.

◆ insert()

template<typename char_type, typename Size, Size max_size, bool NulTerminate>
template<class InputIterator >
void seastar::basic_sstring< char_type, Size, max_size, NulTerminate >::insert ( const_iterator  p,
InputIterator  beg,
InputIterator  end 
)
inline

Inserts additional characters into the string right before the character indicated by p.

◆ replace()

template<typename char_type, typename Size, Size max_size, bool NulTerminate>
basic_sstring& seastar::basic_sstring< char_type, Size, max_size, NulTerminate >::replace ( size_type  pos,
size_type  n1,
const char_type *  s,
size_type  n2 
)
inline

Replace characters with a value of a C style substring.

◆ resize()

template<typename char_type, typename Size, Size max_size, bool NulTerminate>
void seastar::basic_sstring< char_type, Size, max_size, NulTerminate >::resize ( size_t  n,
const char_type  c = '\0' 
)
inline

Resize string.

Parameters
nnew size.
cif n greater than current size character to fill newly allocated space with.

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