CsString  1.3.2
CsString::CsBasicString< E, A > Class Template Reference

Templated class for Unicode aware string support. More...

Public Typedefs

using const_iterator = CsStringIterator< E, A >
 
using const_reverse_iterator = CsStringReverseIterator< CsString::CsBasicString::const_iterator >
 
using iterator = CsStringIterator< E, A >
 
using reverse_iterator = CsStringReverseIterator< CsString::CsBasicString::iterator >
 
using size_type = std::ptrdiff_t
 

Public Member Functions

 CsBasicString ()
 
explicit CsBasicString (const A &a)
 
 CsBasicString (const char (&str)[N], const A &a=A ())
 
 CsBasicString (const char (&str)[N], size_type size, const A &a=A ())
 
 CsBasicString (const char32_t *str, const A &a=A ())
 
 CsBasicString (const char8_t *str, const A &a=A ())
 
 CsBasicString (const char8_t *str, size_type size, const A &a=A ())
 
 CsBasicString (const CsBasicString< E, A > &str) = default
 
 CsBasicString (const CsBasicString< E, A > &str, const A &a)
 
 CsBasicString (const CsBasicString< E, A > &str, size_type indexStart, const A &a=A ())
 
 CsBasicString (const CsBasicString< E, A > &str, size_type indexStart, size_type size, const A &a=A ())
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
 CsBasicString (const T &str, const A &a=A ())
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
 CsBasicString (const T &str, size_type size, const A &a=A ())
 
 CsBasicString (CsBasicString< E, A > &&str) = default
 
 CsBasicString (CsBasicString< E, A > &&str, const A &a)
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
 CsBasicString (CsBasicStringView< U > str, const A &a=A ())
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
 CsBasicString (CsBasicStringView< U > str, size_type indexStart, size_type size, const A &a=A ())
 
template<typename Iterator>
 CsBasicString (Iterator begin, Iterator end, const A &a=A ())
 
 CsBasicString (size_type count, CsString::CsChar c, const A &a=A ())
 
CsBasicString< E, A > & append (const char (&str)[N])
 
CsBasicString< E, A > & append (const char (&str)[N], size_type size)
 
CsBasicString< E, A > & append (const CsBasicString< E, A > &str)
 
CsBasicString< E, A > & append (const CsBasicString< E, A > &str, size_type indexStart, size_type size=npos)
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString< E, A > & append (const T &str)
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString< E, A > & append (const T &str, size_type size)
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString< E, A > & append (CsBasicStringView< U > str)
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString< E, A > & append (CsBasicStringView< U > str, size_type indexStart, size_type size)
 
CsBasicString< E, A > & append (CsString::CsChar c)
 
template<typename Iterator>
CsBasicString< E, A > & append (Iterator begin, Iterator end)
 
CsBasicString< E, A > & append (size_type count, CsString::CsChar c)
 
CsBasicString< E, A > & assign (const CsBasicString< E, A > &str)
 
CsBasicString< E, A > & assign (const CsBasicString< E, A > &str, size_type indexStart, size_type size=npos)
 
template<typename T>
CsBasicString< E, A > & assign (const T &str)
 
template<typename T>
CsBasicString< E, A > & assign (const T &str, size_type size)
 
CsBasicString< E, A > & assign (CsBasicString< E, A > &&str)
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString< E, A > & assign (CsBasicStringView< U > str)
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString< E, A > & assign (CsBasicStringView< U > str, size_type indexStart, size_type size)
 
template<typename Iterator>
CsBasicString< E, A > & assign (Iterator begin, Iterator end)
 
CsBasicString< E, A > & assign (size_type count, CsString::CsChar c)
 
CsString::CsChar at (size_type index) const
 
CsString::CsChar back () const
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
const typename E::storage_unit * constData () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
bool empty () const
 
const_iterator end () const
 
iterator erase (const_iterator iter)
 
iterator erase (const_iterator iter_begin, const_iterator iter_end)
 
CsBasicString< E, A > & erase (size_type indexStart=0, size_type size=npos)
 
size_type find (const char (&str)[N], size_type indexStart, size_type size) const
 
size_type find (const char (&str)[N], size_type indexStart=0) const
 
size_type find (const CsBasicString< E, A > &str, size_type indexStart=0) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find (const T &str, size_type indexStart, size_type size) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find (const T &str, size_type indexStart=0) const
 
size_type find (CsString::CsChar c, size_type indexStart=0) const
 
const_iterator find_fast (const char (&str)[N]) const
 
const_iterator find_fast (const char (&str)[N], const_iterator iter_begin) const
 
const_iterator find_fast (const char (&str)[N], const_iterator iter_begin, size_type size) const
 
const_iterator find_fast (const CsBasicString< E, A > &str) const
 
const_iterator find_fast (const CsBasicString< E, A > &str, const_iterator iter_begin) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
const_iterator find_fast (const T &str) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
const_iterator find_fast (const T &str, const_iterator iter_begin) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
const_iterator find_fast (const T &str, const_iterator iter_begin, size_type size) const
 
const_iterator find_fast (CsString::CsChar c) const
 
const_iterator find_fast (CsString::CsChar c, const_iterator iter_begin) const
 
size_type find_first_not_of (const char (&str)[N], size_type indexStart, size_type size) const
 
size_type find_first_not_of (const char (&str)[N], size_type indexStart=0) const
 
size_type find_first_not_of (const CsBasicString< E, A > &str, size_type indexStart=0) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find_first_not_of (const T &str, size_type indexStart, size_type size) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find_first_not_of (const T &strc, size_type indexStart=0) const
 
size_type find_first_not_of (CsString::CsChar c, size_type indexStart=0) const
 
size_type find_first_of (const char (&str)[N], size_type indexStart, size_type size) const
 
size_type find_first_of (const char (&str)[N], size_type indexStart=0) const
 
size_type find_first_of (const CsBasicString< E, A > &str, size_type indexStart=0) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find_first_of (const T &str, size_type indexStart, size_type size) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find_first_of (const T &str, size_type indexStart=0) const
 
size_type find_first_of (CsString::CsChar c, size_type indexStart=0) const
 
size_type find_last_not_of (const char (&str)[N], size_type indexStart, size_type size) const
 
size_type find_last_not_of (const char (&str)[N], size_type indexStart=npos) const
 
size_type find_last_not_of (const CsBasicString< E, A > &str, size_type indexStart=npos) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find_last_not_of (const T &str, size_type indexStart, size_type size) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find_last_not_of (const T &str, size_type indexStart=npos) const
 
size_type find_last_not_of (CsString::CsChar c, size_type indexStart=npos) const
 
size_type find_last_of (const char (&str)[N], size_type indexStart, size_type size) const
 
size_type find_last_of (const char (&str)[N], size_type indexStart=npos) const
 
size_type find_last_of (const CsBasicString< E, A > &str, size_type indexStart=npos) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find_last_of (const T &str, size_type indexStart, size_type size) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type find_last_of (const T &str, size_type indexStart=npos) const
 
size_type find_last_of (CsString::CsChar c, size_type indexStart=npos) const
 
CsString::CsChar front () const
 
getAllocator () const
 
iterator insert (const_iterator posStart, const char (&str)[N], size_type size)
 
iterator insert (const_iterator posStart, const CsBasicString< E, A > &str)
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
iterator insert (const_iterator posStart, const T &str, size_type size)
 
iterator insert (const_iterator posStart, CsString::CsChar c)
 
template<typename Iterator>
iterator insert (const_iterator posStart, Iterator begin, Iterator end)
 
iterator insert (const_iterator posStart, size_type count, CsString::CsChar c)
 
CsBasicString< E, A > & insert (size_type indexStart, const char (&str)[N])
 
CsBasicString< E, A > & insert (size_type indexStart, const char (&str)[N], size_type size)
 
CsBasicString< E, A > & insert (size_type indexStart, const CsBasicString< E, A > &str)
 
CsBasicString< E, A > & insert (size_type indexStart, const CsBasicString< E, A > &str, size_type srcStart, size_type size=npos)
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString< E, A > & insert (size_type indexStart, const T &str)
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString< E, A > & insert (size_type indexStart, const T &str, size_type size)
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
iterator insert (size_type indexStart, CsBasicStringView< U > str)
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
iterator insert (size_type indexStart, CsBasicStringView< U > str, size_type srcStart, size_type size=npos)
 
CsBasicString< E, A > & insert (size_type indexStart, size_type count, CsString::CsChar c)
 
size_type length () const
 
CsBasicString< E, A > & operator+= (const CsBasicString< E, A > &str)
 
template<typename T>
CsBasicString< E, A > & operator+= (const T &str)
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString< E, A > & operator+= (CsBasicStringView< U > str)
 
CsBasicString< E, A > & operator+= (CsString::CsChar c)
 
CsBasicString< E, A > & operator= (const CsBasicString< E, A > &str) = default
 
template<typename T>
CsBasicString< E, A > & operator= (const T &str)
 
CsBasicString< E, A > & operator= (CsBasicString< E, A > &&str) = default
 
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString< E, A > & operator= (CsBasicStringView< U > str)
 
CsBasicString< E, A > & operator= (CsString::CsChar c)
 
CsString::CsChar operator[] (size_type index) const
 
void pop_back ()
 
void push_back (CsString::CsChar c)
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
CsBasicString< E, A > & replace (const_iterator first, const_iterator last, const char (&str)[N])
 
CsBasicString< E, A > & replace (const_iterator first, const_iterator last, const char (&str)[N], size_type size)
 
CsBasicString< E, A > & replace (const_iterator first, const_iterator last, const CsBasicString< E, A > &str)
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString< E, A > & replace (const_iterator first, const_iterator last, const T &str)
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString< E, A > & replace (const_iterator first, const_iterator last, const T &str, size_type size)
 
template<class T>
CsBasicString< E, A > & replace (const_iterator first, const_iterator last, const T &str, size_type srcStart, size_type size=npos)
 
CsBasicString< E, A > & replace (const_iterator first, const_iterator last, size_type count, CsString::CsChar c)
 
template<class Iterator>
CsBasicString< E, A > & replace (const_iterator first1, const_iterator last1, Iterator first2, Iterator last2)
 
CsBasicString< E, A > & replace (size_type indexStart, size_type count, const char (&str)[N], size_type size)
 
CsBasicString< E, A > & replace (size_type indexStart, size_type count, const CsBasicString< E, A > &str, size_type srcStart, size_type size=npos)
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString< E, A > & replace (size_type indexStart, size_type count, const T &str, size_type size)
 
template<class T>
CsBasicString< E, A > & replace (size_type indexStart, size_type count, const T &str, size_type srcStart, size_type size=npos)
 
CsBasicString< E, A > & replace (size_type indexStart, size_type size, const char (&str)[N])
 
CsBasicString< E, A > & replace (size_type indexStart, size_type size, const CsBasicString< E, A > &str)
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString< E, A > & replace (size_type indexStart, size_type size, const T &str)
 
CsBasicString< E, A > & replace (size_type indexStart, size_type size, size_type count, CsString::CsChar c)
 
void resize (size_type size)
 
void resize (size_type size, CsString::CsChar c)
 
size_type rfind (const char (&str)[N], size_type indexStart, size_type size) const
 
size_type rfind (const char (&str)[N], size_type indexStart=npos) const
 
size_type rfind (const CsBasicString< E, A > &str, size_type indexStart=npos) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type rfind (const T &str, size_type indexStart, size_type size) const
 
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type rfind (const T &str, size_type indexStart=npos) const
 
size_type rfind (CsString::CsChar c, size_type indexStart=npos) const
 
const_iterator rfind_fast (const CsBasicString< E, A > &str) const
 
const_iterator rfind_fast (const CsBasicString< E, A > &str, const_iterator iter_end) const
 
void shrink_to_fit ()
 
size_type size () const
 
size_type size_codePoints () const
 
size_type size_storage () const
 
CsBasicString< E, A > substr (size_type indexStart=0, size_type size=npos) const
 
void swap (CsBasicString< E, A > &str)
 

Static Public Member Functions

static CsBasicString< E, A > fromUtf8 (const char *str, size_type numOfChars=-1, const A &a=A ())
 
static CsBasicString< E, A > fromUtf8 (const char8_t *str, size_type numOfChars=-1, const A &a=A ())
 

Static Public Attributes

constexpr inline static const size_type npos
 

Related Functions

These are not member functions

void convert (const CsBasicString< E_FROM, A_FROM > &str_from, CsBasicString< E_TO, A_TO > &str_to)
 
bool operator!= (const CsBasicString< E, A > &str1, const T &str2)
 
bool operator!= (const CsBasicString< E1, A1 > &str1, const CsBasicString< E2, A2 > &str2)
 
bool operator!= (const T &str1, const CsBasicString< E, A > &str2)
 
CsBasicString< E, A > operator+ (const CsBasicString< E, A > &str, CsChar c)
 
CsBasicString< E, A > operator+ (const CsBasicString< E, A > &str1, const T &str2)
 
CsBasicString< E, A > operator+ (const T &str1, const CsBasicString< E, A > &str2)
 
CsBasicString< E, A > operator+ (CsBasicString< E, A > &&str, CsChar c)
 
CsBasicString< E, A > operator+ (CsChar c, const CsBasicString< E, A > &str)
 
CsBasicString< E, A > operator+ (CsChar c, CsBasicString< E, A > &&str)
 
bool operator< (const CsBasicString< E1, A1 > &str1, const CsBasicString< E2, A2 > &str2)
 
bool operator<= (const CsBasicString< E1, A1 > &str1, const CsBasicString< E2, A2 > &str2)
 
bool operator== (const CsBasicString< E, A > &str1, const T &str2)
 
bool operator== (const CsBasicString< E1, A1 > &str1, const CsBasicString< E2, A2 > &str2)
 
bool operator== (const T &str1, const CsBasicString< E, A > &str2)
 
bool operator> (const CsBasicString< E1, A1 > &str1, const CsBasicString< E2, A2 > &str2)
 
bool operator>= (const CsBasicString< E1, A1 > &str1, const CsBasicString< E2, A2 > &str2)
 

Detailed Description

template<typename E, typename A = std::allocator<typename E::storage_unit>>
class CsString::CsBasicString< E, A >

The CsBasicString class is a templated class which provides Unicode aware string support. The character encoding is passed to the CsBasicString template. The encoding for a CsString is UTF-8. Other encodings can be added to this library and the source code for the encoding policy class should be located in the cs_encoding.h file.

The following typedefs are provided for convenience.

using CsString = CsBasicString<utf8>;
using CsString_utf8 = CsBasicString<utf8>;
using CsString_utf16 = CsBasicString<utf16>;

For additional information about CsBasicString refer to Why CsString was Created.

For information about character encoding, code points, and Unicode refer to String Terminology.

Member Typedef Documentation

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString::const_iterator

Provides an STL style const iterator for string.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString::const_reverse_iterator

Provides an STL style const reverse iterator for string.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString::iterator

Provides an STL style const iterator for string.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString::reverse_iterator

Provides an STL style non-const reverse iterator for string.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString::size_type

Typedef for an integer type representing sizes in a string.

Constructor & Destructor Documentation

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( )
inline

Constructs an empty CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const A &  a)
inlineexplicit

Constructs an empty CsBasicString using the specified allocator a.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsString::CsBasicString< E, A >::CsBasicString ( const T &  str,
const A &  a = A() 
)

Constructs a CsBasicString using the null terminated C style string str. Uses the specified or default constructed allocator.

This constructor is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const char (&  str)[N],
const A &  a = A() 
)

Constructs a CsBasicString using the string literal str. Uses the specified or default constructed allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsString::CsBasicString< E, A >::CsBasicString ( const T &  str,
size_type  size,
const A &  a = A() 
)

Constructs a CsBasicString using the first size code points of the null terminated C style string str. Uses the specified or default constructed allocator.

This constructor is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const char (&  str)[N],
size_type  size,
const A &  a = A() 
)

Constructs a CsBasicString using the first size code points of the specified string literal str. Uses the specified or default constructed allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const char32_t *  str,
const A &  a = A() 
)

Constructs a CsBasicString using the specified UTF-32 string literal. Uses the specified or default constructed allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const CsBasicString<E, A> &  str,
size_type  indexStart,
const A &  a = A() 
)

Constructs a CsBasicString using the string str, beginning at position indexStart. Uses the specified or default constructed allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const CsBasicString<E, A> &  str,
size_type  indexStart,
size_type  size,
const A &  a = A() 
)

Constructs a CsBasicString using the string str, beginning at position indexStart and continuing for the length size. Uses the specified or default constructed allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( size_type  count,
CsString::CsChar  c,
const A &  a = A() 
)

Constructs a CsBasicString containing count number of copies of CsChar c. Uses the specified or default constructed allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsString::CsBasicString< E, A >::CsBasicString ( CsBasicStringView<U>  str,
const A &  a = A() 
)

Constructs a CsBasicString using the string view str. Uses the specified or default constructed allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsString::CsBasicString< E, A >::CsBasicString ( CsBasicStringView<U>  str,
size_type  indexStart,
size_type  size,
const A &  a = A() 
)

Constructs a CsBasicString using the string view str, beginning at position indexStart and continuing for the length size. Uses the specified or default constructed allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename Iterator>
CsString::CsBasicString< E, A >::CsBasicString ( Iterator  begin,
Iterator  end,
const A &  a = A() 
)

Constructs a CsBasicString using the iterator range begin to end. Values in the range must be convertible to a CsChar. Uses the specified or default constructed allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const CsBasicString<E, A> &  str)
inlinedefault

Copy constructs a CsBasicString from str.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const CsBasicString<E, A> &  str,
const A &  a 
)

Copy constructs a CsBasicString from str using the specified allocator a.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( CsBasicString<E, A> &&  str)
inlinedefault

Move constructs a CsBasicString from str.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( CsBasicString<E, A> &&  str,
const A &  a 
)

Move constructs a CsBasicString from str using the specified allocator.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const char8_t *  str,
const A &  a = A() 
)

Constructs a CsBasicString using the null terminated UTF-8 string str. Uses the specified or default constructed allocator.

The type char8_t was added in C++20. For more information refer the Using C++20 documentation.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::CsBasicString ( const char8_t *  str,
size_type  size,
const A &  a = A() 
)

Constructs a CsBasicString using the first size code points of the null terminated UTF-8 string str. Uses the specified or default constructed allocator.

The type char8_t was added in C++20. For more information refer the Using C++20 documentation.

Member Function Documentation

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::append ( const char (&  str)[N])

Appends the specified string literal str to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::append ( const char (&  str)[N],
size_type  size 
)

Appends the specified code points to this CsBasicString. The code points appended from the string literal str begin at position 0 and continue for size number of code points.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::append ( const CsBasicString<E, A> &  str)

Appends the str str to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::append ( const CsBasicString<E, A> &  str,
size_type  indexStart,
size_type  size = npos 
)

Appends the str str to this CsBasicString, beginning at position indexStart and continuing for the length size. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::append ( const T &  str)

Appends the specified null terminated C style string str to this CsBasicString. Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::append ( const T &  str,
size_type  size 
)

Appends the null terminated C style string c to this CsBasicString, beginning at position 0 and continuing for size number of code points. Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::append ( CsBasicStringView<U>  str)

Appends the string view str to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::append ( CsBasicStringView<U>  str,
size_type  indexStart,
size_type  size 
)

Appends the given string view str to this CsBasicString, beginning at position indexStart and continuing for the length size. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::append ( CsString::CsChar  c)

Appends the CsChar c to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename Iterator>
CsBasicString & CsString::CsBasicString< E, A >::append ( Iterator  begin,
Iterator  end 
)

Appends the iterator range begin to end to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::append ( size_type  count,
CsString::CsChar  c 
)

Appends the CsChar c to this CsBasicString. The code points appended are count number of copies of c. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::assign ( const CsBasicString<E, A> &  str)

Assigns the string str to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::assign ( const CsBasicString<E, A> &  str,
size_type  indexStart,
size_type  size = npos 
)

Assigns the string str to this CsBasicString, beginning at position indexStart and continuing for the length size. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T>
CsBasicString & CsString::CsBasicString< E, A >::assign ( const T &  str)

Assigns the null terminated C style string str to this CsBasicString. Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T>
CsBasicString & CsString::CsBasicString< E, A >::assign ( const T &  str,
size_type  size 
)

Assigns the null terminated C style string str to this CsBasicString, beginning at position 0 and continuing for the length size. Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::assign ( CsBasicString<E, A> &&  str)

Move assigns the specified CsBasicString str to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::assign ( CsBasicStringView<U>  str)

Assign the string view str to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::assign ( CsBasicStringView<U>  str,
size_type  indexStart,
size_type  size 
)

Assign the string view str to this CsBasicString, beginning at position indexStart and continuing for the length size.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename Iterator>
CsBasicString & CsString::CsBasicString< E, A >::assign ( Iterator  begin,
Iterator  end 
)

Assigns the iterator range from begin to end to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::assign ( size_type  count,
CsString::CsChar  c 
)

Assigns the code point to this CsBasicString. The code points assigned are count number of copies of the specified CsChar c. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsChar CsString::CsBasicString< E, A >::at ( size_type  index) const

Returns a copy of the CsChar at specified position index.

See also
operator[]()
template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsChar CsString::CsBasicString< E, A >::back ( ) const

Returns a copy of the last CsChar in this CsBasicString.

See also
front(), push_back()
template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::begin ( ) const

Returns a const iterator to the first code point of this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::cbegin ( ) const

Returns a const iterator to the first code point of this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::cend ( ) const

Returns a const iterator to the element after the last code point of this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
void CsString::CsBasicString< E, A >::clear ( )

Removes all of the code points in this CsBasicString. The allocated memory will not be released.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
void CsString::CsBasicString< E, A >::constData ( ) const
inline

Returns a pointer to the null terminated data stored in this CsBasicString. The pointer is valid until the string is modified.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_reverse_iterator CsString::CsBasicString< E, A >::crbegin ( ) const

Returns a const iterator to the last code point of this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_reverse_iterator CsString::CsBasicString< E, A >::crend ( ) const

Returns a const iterator to the element before the first code point of this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
bool & CsString::CsBasicString< E, A >::empty ( ) const

Returns true if this CsBasicString contains no code points.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::end ( ) const

Returns a const iterator to the element after the last code point of this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
iterator CsString::CsBasicString< E, A >::erase ( const_iterator  iter)

Removes the code point at the position specified by iter in this CsBasicString. Returns an iterator to the element after the one removed.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
iterator CsString::CsBasicString< E, A >::erase ( const_iterator  iter_begin,
const_iterator  iter_end 
)

Removes the code points specified by the iterator range in this CsBasicString. Returns an iterator to the element after the last one removed.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::erase ( size_type  indexStart = 0,
size_type  size = npos 
)

Removes size number of code points starting at the position specified by indexStart in this CsBasicString. Returns a reference to the CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find ( const char (&  str)[N],
size_type  indexStart,
size_type  size 
) const

Find the specified string literal str in this CsBasicString. Begins searching at position indexStart in this CsBasicString. Only the first size number of code points of str are used for searching in CsBasicString.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find ( const char (&  str)[N],
size_type  indexStart = 0 
) const

Find the specified string literal str in this CsBasicString. Begins searching at position indexStart in this CsBasicString.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find ( const CsBasicString<E, A> &  str,
size_type  indexStart = 0 
) const

Find the specified CsBasicString str in this CsBasicString. Begin searching at position indexStart in this CsBasicString.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find ( const T &  str,
size_type  indexStart,
size_type  size 
) const

Find the null terminated C style string str in this CsBasicString. Begin searching at position indexStart in this CsBasicString. Only the first size number of code points of str are used for searching in CsBasicString.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find ( const T &  str,
size_type  indexStart = 0 
) const

Find the null terminated C style string str in this CsBasicString. Begins searching at position indexStart in this CsBasicString.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find ( CsString::CsChar  c,
size_type  indexStart = 0 
) const

Find the specified CsChar c in this CsBasicString. Begins searching at position indexStart in this CsBasicString.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::find_fast ( const char (&  str)[N]) const

Find the specified string literal str in this CsBasicString. Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::find_fast ( const char (&  str)[N],
const_iterator  iter_begin 
) const

Find the specified string literal str in this CsBasicString. Begins searching from iter_begin in this CsBasicString.

Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::find_fast ( const char (&  str)[N],
const_iterator  iter_begin,
size_type  size 
) const

Find the specified string literal str in this CsBasicString. Begin searching from iter_begin in this CsBasicString. Only the first size number of code points of str are used for searching in CsBasicString.

Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::find_fast ( const CsBasicString<E, A> &  str) const

Find the specified CsBasicString str in this CsBasicString. Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::find_fast ( const CsBasicString<E, A> &  str,
const_iterator  iter_begin 
) const

Find the specified CsBasicString str in this CsBasicString. Begin searching from iter_begin in this CsBasicString. Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
const_iterator CsString::CsBasicString< E, A >::find_fast ( const T &  str) const

Find the null terminated C style string str in this CsBasicString. Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
const_iterator CsString::CsBasicString< E, A >::find_fast ( const T &  str,
const_iterator  iter_begin 
) const

Find the null terminated C style string str in this CsBasicString. Begin searching from iter_begin in this CsBasicString.

Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
const_iterator CsString::CsBasicString< E, A >::find_fast ( const T &  str,
const_iterator  iter_begin,
size_type  size 
) const

Find the null terminated C style string str in this CsBasicString. Begin searching from iter_begin in this CsBasicString. Only the first size number of code points of str are used for searching in CsBasicString.

Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::find_fast ( CsString::CsChar  c) const

Find the specified CsChar c in this CsBasicString. Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::find_fast ( CsString::CsChar  c,
const_iterator  iter_begin 
) const

Find the specified CsChar c in this CsBasicString. Begin searching from iter_begin in this CsBasicString.

Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_first_not_of ( const char (&  str)[N],
size_type  indexStart,
size_type  size 
) const

Find the first code point not equal to any of the code points in the specified string literal str. Begins searching at position indexStart in this CsBasicString. Only the first size number of code points of str are used for searching in CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_first_not_of ( const char (&  str)[N],
size_type  indexStart = 0 
) const

Find the first code point not equal to any of the code points in the specified string literal str. Begins searching at position indexStart in this CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_first_not_of ( const CsBasicString<E, A> &  str,
size_type  indexStart = 0 
) const

Find the first code point not equal to any of the code points in the specified CsBasicString str. Begins searching at position indexStart in this CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find_first_not_of ( const T &  str,
size_type  indexStart,
size_type  size 
) const

Find the first code point not equal to any of the code points in the null terminated C style string str. Begins searching at position indexStart in this CsBasicString. Only the first size number of code points of str are used for searching in CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find_first_not_of ( const T &  str,
size_type  indexStart = 0 
) const

Find the first code point not equal to any of the code points in the null terminated C style string str. Begins searching at position indexStart in this CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_first_not_of ( CsString::CsChar  c,
size_type  indexStart = 0 
) const

Find the first code point not equal to the specified CsChar c. Begins searching at position indexStart in this CsBasicString.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_first_of ( const char (&  str)[N],
size_type  indexStart,
size_type  size 
) const

Find the first code point equal to one of the code points in the specified string literal str. Begins searching at position indexStart in this CsBasicString. Only the first size number of code points of str are used for searching in CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_first_of ( const char (&  str)[N],
size_type  indexStart = 0 
) const

Find the first code point equal to one of the code points in the specified string literal str. Begins searching at position indexStart in this CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_first_of ( const CsBasicString<E, A> &  str,
size_type  indexStart = 0 
) const

Find the first code point equal to one of the code points in the specified CsBasicString str. Begins searching at position indexStart in this CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find_first_of ( const T &  str,
size_type  indexStart,
size_type  size 
) const

Find the first code point equal to one of the code points in the specified null terminated C style string str. Begin search at position indexStart in this CsBasicString. Only the first size number of code points of str are searched.

Returns the position of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find_first_of ( const T &  str,
size_type  indexStart = 0 
) const

Find the first code point equal to one of the code points in the specified null terminated C style string str. Begins searching at position indexStart in this CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_first_of ( CsString::CsChar  c,
size_type  indexStart = 0 
) const

Find the first code point equal to the specified CsChar c. Begins searching at position indexStart in this CsBasicString.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_last_not_of ( const char (&  str)[N],
size_type  indexStart,
size_type  size 
) const

Find the first code point not equal to any of the code points in the specified string literal str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning. Only the first size number of code points of str are used for searching in CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_last_not_of ( const char (&  str)[N],
size_type  indexStart = npos 
) const

Find the first code point not equal to any of the code points in the specified string literal str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_last_not_of ( const CsBasicString<E, A> &  str,
size_type  indexStart = npos 
) const

Find the first code point not equal to any of the code points in the specified CsBasicString str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find_last_not_of ( const T &  str,
size_type  indexStart,
size_type  size 
) const

Find the first code point not equal to any of the code points in the null terminated C style string str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning. Only the first size number of code points of str are used for searching in CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find_last_not_of ( const T &  str,
size_type  indexStart = npos 
) const

Find the first code point not equal to any of the code points in the null terminated C style string str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning.

Returns the position of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_last_not_of ( CsString::CsChar  c,
size_type  indexStart = npos 
) const

Find the first code point not equal to the specified CsChar c, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_last_of ( const char (&  str)[N],
size_type  indexStart,
size_type  size 
) const

Find the first code point equal to one of the code points in the specified string literal str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning. Only the first size number of code points of str are used for searching in CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_last_of ( const char (&  str)[N],
size_type  indexStart = npos 
) const

Find the first code point equal to one of the code points in the specified string literal str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_last_of ( const CsBasicString<E, A> &  str,
size_type  indexStart = npos 
) const

Find the first code point equal to one of the code points in the specified CsBasicString str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning.

Returns the position of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find_last_of ( const T &  str,
size_type  indexStart,
size_type  size 
) const

Find the first code point equal to one of the code points in the specified null terminated C style string str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning. Only the first size number of code points of str are used for searching in CsBasicString.

Returns the position of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::find_last_of ( const T &  str,
size_type  indexStart = npos 
) const

Find the first code point equal to one of the code points in the null terminated C style string str, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning.

Returns the position of the match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::find_last_of ( CsString::CsChar  c,
size_type  indexStart = npos 
) const

Find the first code point equal to the specified CsChar c, searching in reverse. Begins searching at position indexStart in this CsBasicString and search towards the beginning.

Returns the position of the first code point of the match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A > CsString::CsBasicString< E, A >::fromUtf8 ( const char *  str,
size_type  numOfChars = -1,
const A &  a = A() 
)
static

Returns a CsBasicString containing the first numOfChars number of characters from the C string str. If the value for numOfChars is -1 the str must be null terminated.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A > CsString::CsBasicString< E, A >::fromUtf8 ( const char8_t *  str,
size_type  numOfChars = -1,
const A &  a = A() 
)
static

Returns a CsBasicString containing the first numOfChars number of characters from the C string str. If the value for numOfChars is -1 the str must be null terminated.

The type char8_t was added in C++20. For more information refer the Using C++20 documentation.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsChar CsString::CsBasicString< E, A >::front ( ) const

Returns the first code point in this CsBasicString.

See also
back()
template<typename E, typename A = std::allocator<typename E::storage_unit>>
A CsString::CsBasicString< E, A >::getAllocator ( ) const

Return the allocator associated with this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
iterator CsString::CsBasicString< E, A >::insert ( const_iterator  posStart,
const char (&  str)[N],
size_type  size 
)

Inserts the string literal str in this CsBasicString, beginning at the iterator position posStart. Only the first size number of code points of the string literal str are inserted.

Returns an iterator to the element after the last one inserted.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
iterator CsString::CsBasicString< E, A >::insert ( const_iterator  posStart,
const CsBasicString<E, A> &  str 
)

Inserts the string str in this CsBasicString, beginning at the iterator position posStart in this CsBasicString. Returns an iterator to the element after the last one inserted.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
iterator CsString::CsBasicString< E, A >::insert ( const_iterator  posStart,
const T &  str,
size_type  size 
)

Inserts the null terminated C style string str in this CsBasicString, beginning at the iterator position posStart and continuing for the length size. Returns an iterator to the element after the last one inserted.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
iterator CsString::CsBasicString< E, A >::insert ( const_iterator  posStart,
CsString::CsChar  c 
)

Inserts CsChar c in this CsBasicString, beginning at iterator position posStart in this CsBasicString. Returns an iterator to the element after the inserted code point.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename Iterator>
iterator CsString::CsBasicString< E, A >::insert ( const_iterator  posStart,
Iterator  begin,
Iterator  end 
)

Inserts the string using the iterator range begin to end in this CsBasicString, beginning at iterator position posStart in this CsBasicString.

Returns an iterator to the element after the last one inserted.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
iterator CsString::CsBasicString< E, A >::insert ( const_iterator  posStart,
size_type  count,
CsString::CsChar  c 
)

Inserts count copies of the CsChar c in this CsBasicString, beginning at iterator position posStart in this CsBasicString. Returns an iterator to the element after the code point inserted.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::insert ( size_type  indexStart,
const char (&  str)[N] 
)

Inserts the string literal str in this CsBasicString, beginning at position indexStart in this CsBasicString.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::insert ( size_type  indexStart,
const char (&  str)[N],
size_type  size 
)

Inserts the string literal str in this CsBasicString, beginning at position indexStart in str and continuing for the length size.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::insert ( size_type  indexStart,
const CsBasicString<E, A> &  str 
)

Inserts the string str in this CsBasicString, beginning at position indexStart in str and continuing for the length size.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::insert ( size_type  indexStart,
const CsBasicString<E, A> &  str,
size_type  srcStart,
size_type  size = npos 
)

Inserts the string str in this CsBasicString, beginning at position indexStart. Only the first size number of code points of str are inserted starting from srcStart. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::insert ( size_type  indexStart,
const T &  str 
)

Inserts the null terminated C style string str in this CsBasicString, beginning at position indexStart in in this CsBasicString.

Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::insert ( size_type  indexStart,
const T &  str,
size_type  size 
)

Inserts the null terminated C style string str in this CsBasicString, beginning at position indexStart and continuing for the length size.

Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
iterator CsString::CsBasicString< E, A >::insert ( size_type  indexStart,
CsBasicStringView<U>  str 
)

Inserts the string view str in this CsBasicString, beginning at the position indexStart in this CsBasicString.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
iterator CsString::CsBasicString< E, A >::insert ( size_type  indexStart,
CsBasicStringView<U>  str,
size_type  srcStart,
size_type  size = npos 
)

Inserts the string view str in this CsBasicString, beginning at position indexStart. Only the first size number of code points of str are inserted starting from srcStart.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::insert ( size_type  indexStart,
size_type  count,
CsString::CsChar  c 
)

Inserts count number of copies of the CsChar c in this CsBasicString, beginning at position indexStart in this CsBasicString.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::length ( ) const

Returns the number of code points required for this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::operator+= ( const CsBasicString<E, A> &  str)

Appends the string str to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T>
CsBasicString & CsString::CsBasicString< E, A >::operator+= ( const T &  str)

Appends the null terminated C style string str to this CsBasicString. Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::operator+= ( CsBasicStringView<U>  str)

Appends the string view str to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::operator+= ( CsString::CsChar  c)

Appends CsChar c to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::operator= ( const CsBasicString<E, A> &  str)
inlinedefault

Assigns the string str to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T>
CsBasicString & CsString::CsBasicString< E, A >::operator= ( const T &  str)

Assigns the null terminated C style string str to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::operator= ( CsBasicString<E, A> &&  str)
inlinedefault

Move assigns the string str to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename U, typename = typename std::enable_if<std::is_convertible<decltype(*(std::declval<typename U::const_iterator>())), CsChar>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::operator= ( CsBasicStringView<U>  str)

Assigns the string view str to this CsBasicString. Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::operator= ( CsString::CsChar  c)

Assigns CsChar c to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsChar CsString::CsBasicString< E, A >::operator[] ( size_type  index) const

Returns a copy of the CsChar at position index.

See also
at()
template<typename E, typename A = std::allocator<typename E::storage_unit>>
void CsString::CsBasicString< E, A >::pop_back ( )

Removes the last code point in this CsBasicString. If this CsBasicString is empty the method will do nothing.

See also
back(), push_back()
template<typename E, typename A = std::allocator<typename E::storage_unit>>
void CsString::CsBasicString< E, A >::push_back ( CsString::CsChar  c)

Appends CsChar c to this CsBasicString.

See also
back(), pop_back()
template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_reverse_iterator CsString::CsBasicString< E, A >::rbegin ( ) const

Returns a const iterator to the last code point of this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_reverse_iterator CsString::CsBasicString< E, A >::rend ( ) const

Returns a const iterator to the element before the first code point of this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::replace ( const_iterator  first,
const_iterator  last,
const char (&  str)[N] 
)

Remove code points in this CsBasicString, beginning at iterator position first up to but not including last. Insert the string literal str in this CsBasicString, beginning at the iterator position first.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::replace ( const_iterator  first,
const_iterator  last,
const char (&  str)[N],
size_type  size 
)

Remove code points in this CsBasicString, beginning at iterator position first up to but not including last. Insert a portion of the string literal str in this CsBasicString, beginning at iterator position first. The portion of str inserted is from the beginning and continuing for the length size.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::replace ( const_iterator  first,
const_iterator  last,
const CsBasicString<E, A> &  str 
)

Remove code points in this CsBasicString, beginning at iterator position first up to but not including last. Insert the string str in this CsBasicString, beginning at iterator first.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::replace ( const_iterator  first,
const_iterator  last,
const T &  str 
)

Remove code points in this CsBasicString, beginning at iterator position first up to but not including last. Insert the null terminated C style string str in this CsBasicString, beginning at the iterator position first.

Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::replace ( const_iterator  first,
const_iterator  last,
const T &  str,
size_type  size 
)

Remove code points in this CsBasicString, beginning at iterator position first up to but not including last. Insert a portion of the null terminated C style string str in this CsBasicString, beginning at iterator position first. The portion of str inserted is from the beginning and continuing for the length size.

Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<class T>
CsBasicString & CsString::CsBasicString< E, A >::replace ( const_iterator  first,
const_iterator  last,
const T &  str,
size_type  srcStart,
size_type  size = npos 
)

Remove code points in this CsBasicString, beginning at iterator position first up to but not including last. Insert a portion of the null terminated C style string str in this CsBasicString, beginning at iterator position first. The portion of str inserted is from srcStart and continuing for the length size.

Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::replace ( const_iterator  first,
const_iterator  last,
size_type  count,
CsString::CsChar  c 
)

Remove code points in this CsBasicString, beginning at iterator position first up to but not including last. Insert count number of copies of CsChar c in this CsBasicString, beginning at iterator position first.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<class Iterator>
CsBasicString & CsString::CsBasicString< E, A >::replace ( const_iterator  first1,
const_iterator  last1,
Iterator  first2,
Iterator  last2 
)

Remove code points in this CsBasicString, beginning at iterator position first1 up to but not including last1. Insert the code points from first2 up to but not including last2 in this CsBasicString beginning at iterator position first1.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::replace ( size_type  indexStart,
size_type  count,
const char (&  str)[N],
size_type  size 
)

Remove code points in this CsBasicString, beginning at indexStart and continuing for the length count. Insert a portion of the string literal str in this CsBasicString, beginning at position indexStart. The portion of str inserted is from the beginning and continuing for the length size.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::replace ( size_type  indexStart,
size_type  count,
const CsBasicString<E, A> &  str,
size_type  srcStart,
size_type  size = npos 
)

Remove code points in this CsBasicString, beginning at indexStart and continuing for the length count. Insert a portion of the string str in this CsBasicString, beginning at position indexStart. The portion of str inserted is from srcStart and continuing for the length size.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::replace ( size_type  indexStart,
size_type  size,
const T &  str,
size_type  size 
)

Remove code points in this CsBasicString, beginning at indexStart and continuing for the length size. Insert a portion of the null terminated C style string str in this CsBasicString, beginning at position indexStart. The portion of str inserted is from the beginning and continuing for the length size.

Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<class T>
CsBasicString & CsString::CsBasicString< E, A >::replace ( size_type  indexStart,
size_type  count,
const T &  str,
size_type  srcStart,
size_type  size = npos 
)

Remove code points in this CsBasicString, beginning at indexStart and continuing for the length count. Insert a portion of the null terminated C style string str in this CsBasicString, beginning at position indexStart. The portion of str inserted is from srcStart and continuing for the length size.

Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::replace ( size_type  indexStart,
size_type  size,
const char (&  str)[N] 
)

Remove code points in this CsBasicString, beginning at indexStart and continuing for the length size. Insert the string literal str in this CsBasicString, beginning at position indexStart.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::replace ( size_type  indexStart,
size_type  size,
const CsBasicString<E, A> &  str 
)

Remove code points in this CsBasicString, beginning at indexStart and continuing for the length size. Insert the string str in this CsBasicString, beginning at position indexStart.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
CsBasicString & CsString::CsBasicString< E, A >::replace ( size_type  indexStart,
size_type  size,
const T &  str 
)

Remove code points in this CsBasicString, beginning at indexStart and continuing for the length size. Insert the null terminated C style string str in this CsBasicString, beginning at position indexStart.

Returns a reference to this CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString & CsString::CsBasicString< E, A >::replace ( size_type  indexStart,
size_type  size,
size_type  count,
CsString::CsChar  c 
)

Remove code points in this CsBasicString, beginning at indexStart and continuing for the length size. Insert count number of copies of CsChar c in this CsBasicString, beginning at position indexStart.

Returns a reference to this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
void CsString::CsBasicString< E, A >::resize ( size_type  size)

Resize this CsBasicString to size number of code points. If the new length is larger than the previous length this CsBasicString will be filled with null code points.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
void CsString::CsBasicString< E, A >::resize ( size_type  size,
CsString::CsChar  c 
)

Resize this CsBasicString to size number of code points. If the new length is larger than the previous length this CsBasicString will be filled with CsChar c.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::rfind ( const char (&  str)[N],
size_type  indexStart,
size_type  size 
) const

Find the specified string literal str in this CsBasicString. Begin search starting from indexStart and continue towards the beginning of this CsBasicString. Only the first size number of code points of str must match this CsBasicString.

Returns the position of the first code point of the last match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::rfind ( const char (&  str)[N],
size_type  indexStart = npos 
) const

Find the specified code points in this CsBasicString. The string literal str is used starting from indexStart. Returns the position of the first code point of the last match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::rfind ( const CsBasicString<E, A> &  str,
size_type  indexStart = npos 
) const

Find the specified CsBasicString str in this CsBasicString. Begin search starting from indexStart and continue towards the beginning of this CsBasicString.

Returns the position of the first code point of the last match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::rfind ( const T &  str,
size_type  indexStart,
size_type  size 
) const

Find the null terminated C style string str in this CsBasicString. Begin search starting from indexStart and continue towards the beginning of this CsBasicString. Only the first size number of code points of str must match this CsBasicString.

Returns the position of the first code point of the last match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
template<typename T, typename = typename std::enable_if<std::is_same<T, const char *>::value || std::is_same<T, char *>::value>::type>
size_type CsString::CsBasicString< E, A >::rfind ( const T &  str,
size_type  indexStart = npos 
) const

Find the null terminated C style string str in this CsBasicString, beginning at position indexStart. Returns the position of the first code point of the last match. Returns the static value npos if no match is found.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::rfind ( CsString::CsChar  c,
size_type  indexStart = npos 
) const

Find the specified code point in this CsBasicString. The CsChar c is used starting from position indexStart.

Returns the position of the first code point of the last match. Returns the static value npos if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::rfind_fast ( const CsBasicString<E, A> &  str) const

Find the specified CsBasicString str in this CsBasicString, searching is from the end towards the beginning of this CsBasicString.

Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
const_iterator CsString::CsBasicString< E, A >::rfind_fast ( const CsBasicString<E, A> &  str,
const_iterator  iter_begin 
) const

Find the specified CsBasicString str in this CsBasicString. Begin searching from iter_begin, searching is from the end towards the beginning of this CsBasicString.

Returns an iterator to the first code point of the match. Returns an iterator to the end of the string if no match is found.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
void CsString::CsBasicString< E, A >::shrink_to_fit ( )

Reallocate memory so this CsBasicString consumes as little memory as possible.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::size ( ) const

Returns the number of code points required for this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::size_codePoints ( ) const

Returns the number of code points required for this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
size_type CsString::CsBasicString< E, A >::size_storage ( ) const

Returns the number of code units (storage units) required for this CsBasicString.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsBasicString CsString::CsBasicString< E, A >::substr ( size_type  indexStart = 0,
size_type  size = npos 
) const

Return the string beginning at position indexStart and continuing for the length size.

template<typename E, typename A = std::allocator<typename E::storage_unit>>
void CsString::CsBasicString< E, A >::swap ( CsBasicString<E, A> &  str)

Exchanges this CsBasicString with the string str. All iterators may be invalidated.

Friends And Related Function Documentation

void convert ( const CsBasicString< E_FROM, A_FROM > &  str_from,
CsBasicString< E_TO, A_TO > &  str_to 
)
related

Copies the code points from CsBasicString str_from to CsBasicString str_to. Convert is used to copy a CsBasicString from one encoding to another encoding such as UTF-8 to UTF-16.

bool operator!= ( const CsBasicString< E, A > &  str1,
const T &  str2 
)
related

Compares the contents of the string str1 with null terminated C style string str2. The strings are not equal if any of the code points differ or number of code points does not match.

Returns true if the strings are not equal.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

bool operator!= ( const CsBasicString< E1, A1 > &  str1,
const CsBasicString< E2, A2 > &  str2 
)
related

Compares the contents of the string str1 with str2. The strings are not equal if any of the code points differ or number of code points does not match.

Returns true if the strings are not equal.

bool operator!= ( const T &  str1,
const CsBasicString< E, A > &  str2 
)
related

Compares the contents of the null terminated C style string str1 with the string str2. The strings are not equal if any of the code points differ or number of code points does not match.

Returns true if the strings are not equal.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

CsBasicString< E, A > operator+ ( const CsBasicString< E, A > &  str,
CsChar  c 
)
related

Appends CsChar c to CsBasicString str. Returns a new CsBasicString.

CsBasicString< E, A > operator+ ( const CsBasicString< E, A > &  str1,
const T &  str2 
)
related

Appends the null terminated C style string str2 to str1. Returns a new CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

CsBasicString< E, A > operator+ ( const T &  str1,
const CsBasicString< E, A > &  str2 
)
related

Appends string str2 to the null terminated C style string str1. Returns a new CsBasicString.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

CsBasicString< E, A > operator+ ( CsBasicString< E, A > &&  str,
CsChar  c 
)
related

Move appends CsChar c to the string str. Returns a copy or a move of the CsBasicString.

CsBasicString< E, A > operator+ ( CsChar  c,
const CsBasicString< E, A > &  str 
)
related

Appends string str to CsChar c. Returns a new CsBasicString.

CsBasicString< E, A > operator+ ( CsChar  c,
CsBasicString< E, A > &&  str 
)
related

Move appends string str to CsChar c. Returns a copy or a move of the CsBasicString.

bool operator< ( const CsBasicString< E1, A1 > &  str1,
const CsBasicString< E2, A2 > &  str2 
)
related

Compares the contents of string str1 with str2.

The values of the code points in str1 must be less than the corresponding code points in str2 and str1 must have the same or fewer code points than str2.

Returns true if str1 is less than str2.

bool operator<= ( const CsBasicString< E1, A1 > &  str1,
const CsBasicString< E2, A2 > &  str2 
)
related

Compares the contents of string str1 with str2. The values of the code points in str1 must be less than or equal to the corresponding code points in str2 and str1 must have the same or fewer code points than str2.

Returns true if str1 is less than or equal to str2.

bool operator== ( const CsBasicString< E, A > &  str1,
const T &  str2 
)
related

Compares the contents of the string str1 with the null terminated C style string str2. The strings are equal if both contain the same code points in the same order and they have the same number of code points.

Returns true if the strings are equal.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

bool operator== ( const CsBasicString< E1, A1 > &  str1,
const CsBasicString< E2, A2 > &  str2 
)
related

Compares the contents of the specified str1 with str2. The strings are equal if both contain the same code points in the same order and they have the same number of code points.

Returns true if the strings are equal.

bool operator== ( const T &  str1,
const CsBasicString< E, A > &  str2 
)
related

Compares the contents of null terminated C style string str1 with string str2. The strings are equal if both contain the same code points in the same order and they have the same number of code points.

Returns true if the strings are equal.

This method is only permitted if CS_STRING_ALLOW_UNSAFE is defined.

bool operator> ( const CsBasicString< E1, A1 > &  str1,
const CsBasicString< E2, A2 > &  str2 
)
related

Compares the contents of string str1 with str2. The values of the code points in str1 must be greater than the corresponding code points in str2 and str1 must have the same or more code points than str2.

Returns true if str1 is greater than str2.

bool operator>= ( const CsBasicString< E1, A1 > &  str1,
const CsBasicString< E2, A2 > &  str2 
)
related

Compares the contents of string str1 with str2. The values of the code points in str1 must be greater than or equal to the corresponding code points in str2 and str1 must have the same or more code points than str2.

Returns true if str1 is greater than or equal to str2.

Member Data Documentation

template<typename E, typename A = std::allocator<typename E::storage_unit>>
CsString::CsBasicString< E, A >::npos
inlinestaticconstexpr

Constant value to indicate an invalid position which equates to -1.