tinyutf8 4.0.2
Unicode (UTF-8) capable std::string
Loading...
Searching...
No Matches
tiny_utf8::basic_string< ValueType, DataType, Allocator > Class Template Reference

#include <tinyutf8.h>

Inheritance diagram for tiny_utf8::basic_string< ValueType, DataType, Allocator >:
Collaboration diagram for tiny_utf8::basic_string< ValueType, DataType, Allocator >:

Classes

struct  NON_SSO
 Layout specifications. More...
 
struct  SSO
 

Public Types

enum  : size_type { npos = (size_type)-1 }
 
typedef DataType data_type
 
typedef std::allocator_traits< Allocator >::size_type size_type
 
typedef std::allocator_traits< Allocator >::difference_type difference_type
 
typedef ValueType value_type
 
typedef codepoint_reference< basic_string, false > reference
 
typedef codepoint_reference< basic_string, true > checked_reference
 
typedef raw_codepoint_reference< basic_string, false > raw_reference
 
typedef raw_codepoint_reference< basic_string, true > raw_checked_reference
 
typedef const value_typeconst_reference
 
typedef std::uint_fast8_t width_type
 
typedef tiny_utf8::iterator< basic_string, false > iterator
 
typedef tiny_utf8::const_iterator< basic_string, false > const_iterator
 
typedef tiny_utf8::reverse_iterator< basic_string, false > reverse_iterator
 
typedef tiny_utf8::const_reverse_iterator< basic_string, false > const_reverse_iterator
 
typedef tiny_utf8::iterator< basic_string, true > raw_iterator
 
typedef tiny_utf8::const_iterator< basic_string, true > raw_const_iterator
 
typedef tiny_utf8::reverse_iterator< basic_string, true > raw_reverse_iterator
 
typedef tiny_utf8::const_reverse_iterator< basic_string, true > raw_const_reverse_iterator
 
typedef Allocator allocator_type
 
typedef size_type indicator_type
 

Public Member Functions

 basic_string () noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_default_constructible< Allocator >())
 
 basic_string (const allocator_type &alloc) noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_copy_constructible< Allocator >())
 
template<typename T >
 basic_string (T &&str, const allocator_type &alloc=allocator_type(), enable_if_ptr< T, data_type > *={}) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (const data_type *str, size_type len, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (const data_type *str, size_type pos, size_type len, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
 basic_string (const data_type(&str)[LITLEN], const allocator_type &alloc=allocator_type(), enable_if_small_string< LITLEN >={}) noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_copy_constructible< Allocator >())
 
template<size_type LITLEN>
 basic_string (const data_type(&str)[LITLEN], const allocator_type &alloc=allocator_type(), enable_if_not_small_string< LITLEN >={}) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
 basic_string (const data_type(&str)[LITLEN], size_type len, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
 basic_string (const data_type(&str)[LITLEN], size_type pos, size_type len, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename C , typename A >
 basic_string (std::basic_string< data_type, C, A > str, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename C , typename A >
 basic_string (std::basic_string< data_type, C, A > str, size_type len, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename C , typename A >
 basic_string (std::basic_string< data_type, C, A > str, size_type pos, size_type len, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (size_type n, value_type cp, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (size_type n, data_type cp, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (const basic_string &str, size_type pos, size_type count=basic_string::npos, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename InputIt >
 basic_string (InputIt first, InputIt last, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (const basic_string &str, const allocator_type &alloc) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (const value_type *str, size_type len, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename T >
 basic_string (T &&str, const allocator_type &alloc=allocator_type(), enable_if_ptr< T, value_type > *={}) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
 basic_string (const value_type(&str)[LITLEN], const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (std::initializer_list< value_type > ilist, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (value_type cp, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (data_type ch, const allocator_type &alloc=allocator_type()) noexcept(TINY_UTF8_NOEXCEPT)
 
 basic_string (basic_string &&str) noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_move_constructible< Allocator >())
 
 basic_string (basic_string &&str, const allocator_type &alloc) noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_copy_constructible< Allocator >())
 
 ~basic_string () noexcept
 
basic_stringoperator= (const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringoperator= (basic_string &&str) noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_move_assignable< Allocator >())
 
void clear () noexcept
 
allocator_type get_allocator () const noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_copy_constructible< Allocator >())
 
void shrink_to_fit () noexcept(TINY_UTF8_NOEXCEPT)
 
void swap (basic_string &str) noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_move_assignable< Allocator >())
 
size_type capacity () const noexcept
 
value_type at (size_type n) const noexcept(TINY_UTF8_NOEXCEPT)
 
value_type at (size_type n, std::nothrow_t) const noexcept
 
checked_reference at (size_type n) noexcept(TINY_UTF8_NOEXCEPT)
 
reference at (size_type n, std::nothrow_t) noexcept
 
raw_checked_reference raw_at (size_type byte_index) noexcept(TINY_UTF8_NOEXCEPT)
 
raw_reference raw_at (size_type byte_index, std::nothrow_t) noexcept
 
value_type raw_at (size_type byte_index) const noexcept(TINY_UTF8_NOEXCEPT)
 
value_type raw_at (size_type byte_index, std::nothrow_t) const noexcept
 
iterator get (size_type n) noexcept
 
const_iterator get (size_type n) const noexcept
 
raw_iterator raw_get (size_type n) noexcept
 
raw_const_iterator raw_get (size_type n) const noexcept
 
reverse_iterator rget (size_type n) noexcept
 
const_reverse_iterator rget (size_type n) const noexcept
 
raw_reverse_iterator raw_rget (size_type n) noexcept
 
raw_const_reverse_iterator raw_rget (size_type n) const noexcept
 
reference operator[] (size_type n) noexcept
 
value_type operator[] (size_type n) const noexcept
 
raw_reference operator() (size_type n) noexcept
 
value_type operator() (size_type n) const noexcept
 
const data_typec_str () const noexcept
 
const data_typedata () const noexcept
 
data_typedata () noexcept
 
size_type length () const noexcept
 
size_type size () const noexcept
 
bool empty () const noexcept
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
raw_iterator raw_begin () noexcept
 
raw_const_iterator raw_begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
raw_iterator raw_end () noexcept
 
raw_const_iterator raw_end () const noexcept
 
reverse_iterator rbegin () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
raw_reverse_iterator raw_rbegin () noexcept
 
raw_const_reverse_iterator raw_rbegin () const noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rend () const noexcept
 
raw_reverse_iterator raw_rend () noexcept
 
raw_const_reverse_iterator raw_rend () const noexcept
 
const_iterator cbegin () const noexcept
 
raw_const_iterator raw_cbegin () const noexcept
 
const_iterator cend () const noexcept
 
raw_const_iterator raw_cend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
raw_const_reverse_iterator raw_crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
raw_const_reverse_iterator raw_crend () const noexcept
 
raw_reference front () noexcept
 
value_type front () const noexcept
 
raw_reference back () noexcept
 
value_type back () const noexcept
 
basic_stringreplace (size_type index, value_type repl, size_type n=1) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (size_type index, size_type len, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (size_type index, size_type len, value_type repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (raw_iterator first, raw_iterator last, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (raw_iterator first, raw_iterator last, value_type repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (raw_iterator first, iterator last, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (iterator first, raw_iterator last, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (iterator first, iterator last, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (raw_iterator first, iterator last, value_type repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (iterator first, raw_iterator last, value_type repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (iterator first, iterator last, value_type repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (raw_iterator first, raw_iterator last, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (raw_iterator first, iterator last, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (iterator first, raw_iterator last, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (iterator first, iterator last, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringreplace (size_type index, size_type count, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringraw_replace (size_type start_byte, size_type byte_count, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringprepend (const basic_string &prependix) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringappend (const basic_string &appendix) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringoperator+= (const basic_string &appendix) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringpush_back (value_type cp) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringoperator+= (value_type cp) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string operator+ (basic_string summand) const &noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string operator+ (const basic_string &summand) &&noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringassign (size_type count, value_type cp) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringassign (const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringassign (const basic_string &str, size_type pos, size_type count) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringassign (basic_string &&str) noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_move_assignable< Allocator >())
 
template<typename T >
basic_stringassign (T &&str, enable_if_ptr< T, data_type > *={}) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringassign (const data_type *str, size_type len) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
basic_stringassign (const data_type(&str)[LITLEN]) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename T >
basic_stringassign (T &&str, enable_if_ptr< T, value_type > *={}) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringassign (const value_type *str, size_type len) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
basic_stringassign (const value_type(&str)[LITLEN]) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename InputIt >
basic_stringassign (InputIt first, InputIt last) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringassign (std::initializer_list< value_type > ilist) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringinsert (size_type pos, value_type cp) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringinsert (size_type pos, const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringinsert (raw_iterator it, value_type cp) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringinsert (raw_iterator it, const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringraw_insert (size_type pos, const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringraw_insert (size_type pos, value_type cp) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringpop_back () noexcept(TINY_UTF8_NOEXCEPT)
 Removes the last codepoint in the basic_string.
 
basic_stringerase (raw_iterator pos) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringerase (raw_iterator first, raw_iterator last) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringerase (raw_iterator first, iterator last) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringerase (iterator first, raw_iterator last) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringerase (iterator first, iterator last) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringerase (size_type pos, size_type len=1) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_stringraw_erase (size_type pos, size_type len) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string substr (raw_iterator first, raw_iterator last) const noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string substr (raw_iterator first, iterator last) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string substr (iterator first, raw_iterator last) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string substr (iterator first, iterator last) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string substr (size_type pos, size_type len=basic_string::npos) const noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string raw_substr (size_type start_byte, size_type byte_count) const noexcept(TINY_UTF8_NOEXCEPT)
 
size_type find (value_type cp, size_type start_codepoint=0) const noexcept
 
size_type find (const basic_string &pattern, size_type start_codepoint=0) const noexcept
 
size_type find (const data_type *pattern, size_type start_codepoint=0) const noexcept
 
size_type raw_find (value_type cp, size_type start_byte=0) const noexcept
 
size_type raw_find (const basic_string &pattern, size_type start_byte=0) const noexcept
 
size_type raw_find (const data_type *pattern, size_type start_byte=0) const noexcept
 
size_type rfind (value_type cp, size_type start_codepoint=basic_string::npos) const noexcept
 
size_type raw_rfind (value_type cp, size_type start_byte=basic_string::npos) const noexcept
 
size_type find_first_of (const value_type *str, size_type start_codepoint=0) const noexcept
 Find characters in string.
 
size_type raw_find_first_of (const value_type *str, size_type start_byte=0) const noexcept
 
size_type find_last_of (const value_type *str, size_type start_codepoint=basic_string::npos) const noexcept
 
size_type raw_find_last_of (const value_type *str, size_type start_byte=basic_string::npos) const noexcept
 
size_type find_first_not_of (const value_type *str, size_type start_codepoint=0) const noexcept
 Find absence of characters in string.
 
size_type raw_find_first_not_of (const value_type *str, size_type start_byte=0) const noexcept
 
size_type find_last_not_of (const value_type *str, size_type start_codepoint=basic_string::npos) const noexcept
 
size_type raw_find_last_not_of (const value_type *str, size_type start_byte=basic_string::npos) const noexcept
 
bool starts_with (const basic_string &str) const noexcept
 
bool starts_with (const std::string &str) const noexcept
 
bool starts_with (value_type cp) const noexcept
 
template<typename T >
bool starts_with (T str, enable_if_ptr< T, data_type > *={}) const noexcept
 
template<size_type LITLEN>
bool starts_with (const data_type(&str)[LITLEN]) const noexcept
 
template<typename T >
bool starts_with (T str, enable_if_ptr< T, value_type > *={}) const noexcept
 
template<size_type LITLEN>
bool starts_with (const value_type(&str)[LITLEN]) const noexcept
 
bool ends_with (const basic_string &str) const noexcept
 
bool ends_with (const std::string &str) const noexcept
 
bool ends_with (value_type cp) const noexcept
 
template<typename T >
bool ends_with (T str, enable_if_ptr< T, data_type > *={}) const noexcept
 
template<size_type LITLEN>
bool ends_with (const data_type(&str)[LITLEN]) const noexcept
 
template<typename T >
bool ends_with (T str, enable_if_ptr< T, value_type > *={}) const noexcept
 
template<size_type LITLEN>
bool ends_with (const value_type(&str)[LITLEN]) const noexcept
 
int compare (const basic_string &str) const noexcept
 
int compare (const std::string &str) const noexcept
 
template<typename T >
int compare (T str, enable_if_ptr< T, data_type > *={}) const noexcept
 
template<size_type LITLEN>
int compare (const data_type(&str)[LITLEN]) const noexcept
 
template<typename T >
int compare (T str, enable_if_ptr< T, value_type > *={}) const noexcept
 
template<size_type LITLEN>
int compare (const value_type(&str)[LITLEN]) const noexcept
 
bool operator== (const basic_string &str) const noexcept
 Equality Comparison Operators.
 
bool operator!= (const basic_string &str) const noexcept
 
bool operator== (const std::string &str) const noexcept
 
bool operator!= (const std::string &str) const noexcept
 
template<typename T >
enable_if_ptr< T, data_typeoperator== (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, data_typeoperator!= (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, value_typeoperator== (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, value_typeoperator!= (T &&str) const noexcept
 
template<size_type LITLEN>
bool operator== (const data_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator!= (const data_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator== (const value_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator!= (const value_type(&str)[LITLEN]) const noexcept
 
bool operator> (const basic_string &str) const noexcept
 Lexicographical comparison Operators.
 
bool operator>= (const basic_string &str) const noexcept
 
bool operator< (const basic_string &str) const noexcept
 
bool operator<= (const basic_string &str) const noexcept
 
bool operator> (const std::string &str) const noexcept
 
bool operator>= (const std::string &str) const noexcept
 
bool operator< (const std::string &str) const noexcept
 
bool operator<= (const std::string &str) const noexcept
 
template<typename T >
enable_if_ptr< T, data_typeoperator> (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, data_typeoperator>= (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, data_typeoperator< (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, data_typeoperator<= (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, value_typeoperator> (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, value_typeoperator>= (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, value_typeoperator< (T &&str) const noexcept
 
template<typename T >
enable_if_ptr< T, value_typeoperator<= (T &&str) const noexcept
 
template<size_type LITLEN>
bool operator> (const data_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator>= (const data_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator< (const data_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator<= (const data_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator> (const value_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator>= (const value_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator< (const value_type(&str)[LITLEN]) const noexcept
 
template<size_type LITLEN>
bool operator<= (const value_type(&str)[LITLEN]) const noexcept
 
width_type get_index_bytes (size_type byte_index) const noexcept
 Get the number of bytes of codepoint in basic_string.
 
width_type get_codepoint_bytes (size_type codepoint_index) const noexcept
 
width_type get_index_pre_bytes (size_type byte_index) const noexcept
 Get the number of bytes before a codepoint, that build up a new codepoint.
 
width_type get_codepoint_pre_bytes (size_type codepoint_index) const noexcept
 
size_type raw_back_index () const noexcept
 Get the byte index of the last codepoint.
 
size_type get_num_codepoints (size_type byte_start, size_type byte_count) const noexcept
 
size_type get_num_bytes (size_type byte_start, size_type cp_count) const noexcept
 
size_type get_num_bytes_from_start (size_type cp_count) const noexcept
 
bool requires_unicode () const noexcept
 tinyutf8-specific features
 
bool sso_active () const noexcept
 
bool lut_active () const noexcept
 
void to_wide_literal (value_type *dest) const noexcept
 
std::basic_string< data_typecpp_str (bool prepend_bom=false) const noexcept(TINY_UTF8_NOEXCEPT)
 

Protected Types

template<size_type L>
using enable_if_small_string = typename std::enable_if<( L <= SSO::size ), bool>::type
 SFINAE helpers for constructors.
 
template<size_type L>
using enable_if_not_small_string = typename std::enable_if<( L > SSO::size ), bool>::type
 
template<typename T , typename CharType , typename _DataType = bool>
using enable_if_ptr
 

Protected Member Functions

void set_non_sso_string_len (size_type string_len) noexcept
 Non-static helper methods.
 
size_type get_non_sso_string_len () const noexcept
 Get buffer size, if SSO is disabled.
 
void set_sso_data_len (unsigned char data_len=0) noexcept
 Set the data length (also enables SSO)
 
size_type get_sso_data_len () const noexcept
 Get the data length (when SSO is active)
 
size_type get_non_sso_capacity () const noexcept
 Return a good guess of how many codepoints the currently allocated buffer can hold.
 
bool sso_inactive () const noexcept
 Check, if sso is inactive (this operation doesn't require a negation and is faster)
 
bool requires_unicode_sso () const noexcept
 Check, whether the string contains codepoints > 127.
 
const data_typeget_buffer () const noexcept
 Get buffer.
 
data_typeget_buffer () noexcept
 
size_type get_buffer_size () const noexcept
 Get buffer size (excluding the trailing LUT indicator)
 
std::basic_string< data_typecpp_str_bom () const noexcept
 Returns an std::string with the UTF-8 BOM prepended.
 
data_typeallocate (size_type total_buffer_size) const noexcept
 Allocates size_type-aligned storage (make sure, total_buffer_size is a multiple of sizeof(size_type)!)
 
void deallocate (data_type *buffer, size_type buffer_size) const noexcept
 Allocates size_type-aligned storage (make sure, buffer_size is a multiple of sizeof(size_type)!)
 
 basic_string (const data_type *str, size_type pos, size_type count, size_type data_left, const allocator_type &alloc, tiny_utf8_detail::read_codepoints_tag) noexcept(TINY_UTF8_NOEXCEPT)
 Constructs an basic_string from a character literal.
 
 basic_string (const data_type *str, size_type count, const allocator_type &alloc, tiny_utf8_detail::read_bytes_tag) noexcept(TINY_UTF8_NOEXCEPT)
 

Static Protected Member Functions

static constexpr size_type get_sso_capacity () noexcept
 Static helper methods.
 
static bool is_lut_active (const data_type *lut_base_ptr) noexcept
 Check, if the lut is active using the lut base ptr.
 
static size_type round_up_to_align (size_type val) noexcept
 Rounds the supplied value to a multiple of sizeof(size_type)
 
static data_typeget_lut_base_ptr (data_type *buffer, size_type buffer_size) noexcept
 Get the LUT base pointer from buffer and buffer size.
 
static const data_typeget_lut_base_ptr (const data_type *buffer, size_type buffer_size) noexcept
 
static void set_lut_indiciator (data_type *lut_base_ptr, bool active, size_type lut_len=0) noexcept
 Construct the lut mode indicator.
 
static void copy_lut_indicator (data_type *dest, const data_type *source) noexcept
 Copy lut indicator.
 
static width_type get_lut_width (size_type buffer_size) noexcept
 
static bool is_lut_worth (size_type pot_lut_len, size_type string_len, bool lut_present, bool biased=true) noexcept
 Determine, whether or not a LUT is worth to set up. General case: worth below 25%. If LUT present <33,3%, otherwise <16,7%.
 
static size_type determine_main_buffer_size (size_type data_len, size_type lut_len, width_type *lut_width) noexcept
 Determine the needed buffer size and the needed lut width (excluding the trailling LUT indicator)
 
static size_type determine_main_buffer_size (size_type data_len, size_type lut_len, width_type lut_width) noexcept
 Determine the needed buffer size if the lut width is known (excluding the trailling LUT indicator)
 
static size_type determine_main_buffer_size (size_type data_len) noexcept
 Determine the needed buffer size if the lut is empty (excluding the trailling LUT indicator)
 
static size_type determine_total_buffer_size (size_type main_buffer_size) noexcept
 Same as above but this time including the LUT indicator.
 
static size_type get_lut (const data_type *iter, width_type lut_width) noexcept
 Get the nth index within a multibyte index table.
 
static void set_lut (data_type *iter, width_type lut_width, size_type value) noexcept
 
static size_type get_lut_len (const data_type *lut_base_ptr) noexcept
 Get the LUT size (given the lut is active!)
 
static width_type get_codepoint_bytes (data_type first_byte, size_type data_left) noexcept
 
static width_type get_codepoint_bytes (value_type cp) noexcept
 
static width_type get_num_bytes_of_utf8_char_before (const data_type *data_start, size_type index) noexcept
 Returns the number of bytes to expect before this one (including this one) that belong to this utf8 char.
 
static value_type decode_utf8 (const data_type *data, width_type num_bytes) noexcept
 Decodes a given input of rle utf8 data to a unicode codepoint, given the number of bytes it's made of.
 
static width_type decode_utf8_and_len (const data_type *data, value_type &dest, size_type data_left) noexcept
 
static void encode_utf8 (value_type cp, data_type *dest, width_type cp_bytes) noexcept
 
static width_type encode_utf8 (value_type cp, data_type *dest) noexcept
 
template<typename T >
static constexpr T get_msb_mask (width_type bytes=sizeof(T)) noexcept
 

Protected Attributes

union { 
 
   SSO   t_sso 
 
   NON_SSO   t_non_sso 
 
};  
 Attributes.
 

Friends

basic_string operator+ (basic_string lhs, data_type rhs) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string operator+ (basic_string lhs, value_type rhs) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename T >
enable_if_ptr< T, data_type, basic_stringoperator+ (basic_string lhs, T &&rhs) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename T >
enable_if_ptr< T, value_type, basic_stringoperator+ (basic_string lhs, T &&rhs) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
basic_string operator+ (basic_string lhs, const data_type(&rhs)[LITLEN]) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
basic_string operator+ (basic_string lhs, const value_type(&rhs)[LITLEN]) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string operator+ (data_type lhs, basic_string rhs) noexcept(TINY_UTF8_NOEXCEPT)
 
basic_string operator+ (value_type lhs, basic_string rhs) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename T >
enable_if_ptr< T, data_type, basic_stringoperator+ (T &&lhs, basic_string rhs) noexcept(TINY_UTF8_NOEXCEPT)
 
template<typename T >
enable_if_ptr< T, value_type, basic_stringoperator+ (T &&lhs, basic_string rhs) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
basic_string operator+ (const data_type(&lhs)[LITLEN], basic_string rhs) noexcept(TINY_UTF8_NOEXCEPT)
 
template<size_type LITLEN>
basic_string operator+ (const value_type(&lhs)[LITLEN], basic_string rhs) noexcept(TINY_UTF8_NOEXCEPT)
 

Member Typedef Documentation

◆ allocator_type

template<typename ValueType , typename DataType , typename Allocator >
Allocator tiny_utf8::basic_string< ValueType, DataType, Allocator >::allocator_type

◆ checked_reference

template<typename ValueType , typename DataType , typename Allocator >
codepoint_reference<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::checked_reference

◆ const_iterator

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::const_iterator<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::const_iterator

◆ const_reference

template<typename ValueType , typename DataType , typename Allocator >
const value_type& tiny_utf8::basic_string< ValueType, DataType, Allocator >::const_reference

◆ const_reverse_iterator

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::const_reverse_iterator<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::const_reverse_iterator

◆ data_type

template<typename ValueType , typename DataType , typename Allocator >
DataType tiny_utf8::basic_string< ValueType, DataType, Allocator >::data_type

◆ difference_type

template<typename ValueType , typename DataType , typename Allocator >
std::allocator_traits<Allocator>::difference_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::difference_type

◆ enable_if_not_small_string

template<typename ValueType , typename DataType , typename Allocator >
template<size_type L>
using tiny_utf8::basic_string< ValueType, DataType, Allocator >::enable_if_not_small_string = typename std::enable_if<( L > SSO::size ), bool>::type
protected

◆ enable_if_ptr

template<typename ValueType , typename DataType , typename Allocator >
template<typename T , typename CharType , typename _DataType = bool>
using tiny_utf8::basic_string< ValueType, DataType, Allocator >::enable_if_ptr
protected
Initial value:
typename std::enable_if<
std::is_pointer<typename std::remove_reference<T>::type>::value
&&
std::is_same<
CharType
, typename std::remove_cv<
typename std::remove_pointer<
typename std::remove_reference<T>::type
>::type
>::type
>::value
, _DataType
>::type

◆ enable_if_small_string

template<typename ValueType , typename DataType , typename Allocator >
template<size_type L>
using tiny_utf8::basic_string< ValueType, DataType, Allocator >::enable_if_small_string = typename std::enable_if<( L <= SSO::size ), bool>::type
protected

SFINAE helpers for constructors.

◆ indicator_type

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::indicator_type

◆ iterator

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::iterator<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::iterator

◆ raw_checked_reference

template<typename ValueType , typename DataType , typename Allocator >
raw_codepoint_reference<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_checked_reference

◆ raw_const_iterator

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::const_iterator<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_const_iterator

◆ raw_const_reverse_iterator

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::const_reverse_iterator<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_const_reverse_iterator

◆ raw_iterator

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::iterator<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_iterator

◆ raw_reference

template<typename ValueType , typename DataType , typename Allocator >
raw_codepoint_reference<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_reference

◆ raw_reverse_iterator

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::reverse_iterator<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_reverse_iterator

◆ reference

template<typename ValueType , typename DataType , typename Allocator >
codepoint_reference<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::reference

◆ reverse_iterator

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::reverse_iterator<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::reverse_iterator

◆ size_type

template<typename ValueType , typename DataType , typename Allocator >
std::allocator_traits<Allocator>::size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::size_type

◆ value_type

template<typename ValueType , typename DataType , typename Allocator >
ValueType tiny_utf8::basic_string< ValueType, DataType, Allocator >::value_type

◆ width_type

template<typename ValueType , typename DataType , typename Allocator >
std::uint_fast8_t tiny_utf8::basic_string< ValueType, DataType, Allocator >::width_type

Member Enumeration Documentation

◆ anonymous enum

template<typename ValueType , typename DataType , typename Allocator >
anonymous enum : size_type
Enumerator
npos 

Constructor & Destructor Documentation

◆ basic_string() [1/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const data_type * str,
size_type pos,
size_type count,
size_type data_left,
const allocator_type & alloc,
tiny_utf8_detail::read_codepoints_tag  )
protectednoexcept

Constructs an basic_string from a character literal.

◆ basic_string() [2/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const data_type * str,
size_type count,
const allocator_type & alloc,
tiny_utf8_detail::read_bytes_tag  )
protectednoexcept

◆ basic_string() [3/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( )
inlinenoexcept

Default Ctor

Note
Creates an Instance of type basic_string that is empty

◆ basic_string() [4/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const allocator_type & alloc)
inlineexplicitnoexcept

Ctor taking an alloc

Note
Creates an Instance of type basic_string that is empty

◆ basic_string() [5/28]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( T && str,
const allocator_type & alloc = allocator_type(),
enable_if_ptr< T, data_type > * = {} )
inlinenoexcept

Constructor taking an utf8 sequence and the maximum length to read from it (in number of codepoints)

Note
Creates an Instance of type basic_string that holds the given utf8 sequence
Parameters
strThe UTF-8 sequence to fill the basic_string with
pos(Optional) The codepoint position of the first codepoint to read
len(Optional) The maximum number of codepoints to read from the sequence
alloc(Optional) The allocator instance to use

◆ basic_string() [6/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const data_type * str,
size_type len,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

Constructor taking an utf8 sequence and the maximum length to read from it (in number of codepoints)

Note
Creates an Instance of type basic_string that holds the given utf8 sequence
Parameters
strThe UTF-8 sequence to fill the basic_string with
lenThe maximum number of codepoints to read from the sequence
alloc(Optional) The allocator instance to use

◆ basic_string() [7/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const data_type * str,
size_type pos,
size_type len,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

Constructor taking an utf8 sequence, a codepoint position to start reading from the sequence and the maximum length to read from it (in number of codepoints)

Note
Creates an Instance of type basic_string that holds the given utf8 sequence
Parameters
strThe UTF-8 sequence to fill the basic_string with
posThe codepoint position of the first codepoint to read
lenThe maximum number of codepoints to read from the sequence
alloc(Optional) The allocator instance to use

◆ basic_string() [8/28]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const data_type(&) str[LITLEN],
const allocator_type & alloc = allocator_type(),
enable_if_small_string< LITLEN > = {} )
inlinenoexcept

Constructor taking an utf8 char literal

Note
Creates an Instance of type basic_string that holds the given utf8 sequence
Parameters
strThe UTF-8 literal to fill the basic_string with
pos(Optional) The position of the first codepoint to read (bounds-checked)
len(Optional) The maximum number of codepoints to read from the sequence
alloc(Optional) The allocator instance to use

◆ basic_string() [9/28]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const data_type(&) str[LITLEN],
const allocator_type & alloc = allocator_type(),
enable_if_not_small_string< LITLEN > = {} )
inlinenoexcept

◆ basic_string() [10/28]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const data_type(&) str[LITLEN],
size_type len,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

Constructor taking an utf8 char literal and the maximum number of codepoints to read

Note
Creates an Instance of type basic_string that holds the given utf8 sequence
Parameters
strThe UTF-8 literal to fill the basic_string with
lenThe maximum number of codepoints to read from the sequence
alloc(Optional) The allocator instance to use

◆ basic_string() [11/28]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const data_type(&) str[LITLEN],
size_type pos,
size_type len,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

Constructor taking an utf8 char literal, a codepoint position to start reading from the sequence and the maximum number of codepoints to read

Note
Creates an Instance of type basic_string that holds the given utf8 sequence
Parameters
strThe UTF-8 literal to fill the basic_string with
posThe codepoint position of the first codepoint to read (bounds-checked)
lenThe maximum number of codepoints to read from the sequence
alloc(Optional) The allocator instance to use

◆ basic_string() [12/28]

template<typename ValueType , typename DataType , typename Allocator >
template<typename C , typename A >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( std::basic_string< data_type, C, A > str,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

Constructor taking an std::string

Note
Creates an Instance of type basic_string copying the string data from the supplied std::basic_string
Parameters
strThe string object from which the data will be copied (interpreted as UTF-8)
alloc(Optional) The allocator instance to use

◆ basic_string() [13/28]

template<typename ValueType , typename DataType , typename Allocator >
template<typename C , typename A >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( std::basic_string< data_type, C, A > str,
size_type len,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

Constructor taking an std::string

Note
Creates an Instance of type basic_string copying the string data from the supplied std::basic_string
Parameters
strThe string object from which the data will be copied (interpreted as UTF-8)
lenThe maximum number of codepoints to read from 'str'
alloc(Optional) The allocator instance to use

◆ basic_string() [14/28]

template<typename ValueType , typename DataType , typename Allocator >
template<typename C , typename A >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( std::basic_string< data_type, C, A > str,
size_type pos,
size_type len,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

◆ basic_string() [15/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( size_type n,
value_type cp,
const allocator_type & alloc = allocator_type() )
noexcept

Constructor that fills the string with a certain amount of codepoints

Note
Creates an Instance of type basic_string that gets filled with 'n' codepoints
Parameters
nThe number of codepoints generated
cpThe codepoint that the whole buffer will be set to
alloc(Optional) The allocator instance to use

◆ basic_string() [16/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( size_type n,
data_type cp,
const allocator_type & alloc = allocator_type() )
noexcept

Constructor that fills the string with a certain amount of characters

Note
Creates an Instance of type basic_string that gets filled with 'n' characters
Parameters
nThe number of characters generated
cpThe characters that the whole buffer will be set to
alloc(Optional) The allocator instance to use

◆ basic_string() [17/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const basic_string< ValueType, DataType, Allocator > & str,
size_type pos,
size_type count = basic_string< ValueType, DataType, Allocator >::npos,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

Constructs the string with a portion of the supplied string

Parameters
strThe string that the constructed string shall be a substring of
posThe codepoint position indicating the start of the string to be used for construction
countThe number of codepoints to be taken from 'str'
alloc(Optional) The allocator instance to use

◆ basic_string() [18/28]

template<typename ValueType , typename DataType , typename Allocator >
template<typename InputIt >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( InputIt first,
InputIt last,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

Constructs the string from the range of codepoints supplied. The resulting string will equal [first,last)

Note
The Range is expected to contain codepoints (rather than code units, i.e. bytes)
Parameters
firstThe start of the range to construct from
lastThe end of the range
alloc(Optional) The allocator instance to use

◆ basic_string() [19/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const basic_string< ValueType, DataType, Allocator > & str)
inlinenoexcept

Copy Constructor that copies the supplied basic_string to construct the string

Note
Creates an Instance of type basic_string that has the exact same data and allocator as 'str'
Parameters
strThe basic_string to copy from

◆ basic_string() [20/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const basic_string< ValueType, DataType, Allocator > & str,
const allocator_type & alloc )
inlinenoexcept

Copy Constructor that copies the supplied basic_string to construct the string

Note
Creates an Instance of type basic_string that has the exact same data as 'str'
Parameters
strThe basic_string to copy from
allocThe new allocator instance to use

◆ basic_string() [21/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const value_type * str,
size_type len,
const allocator_type & alloc = allocator_type() )
noexcept

Constructor taking a wide codepoint literal that will be copied to construct this basic_string

Note
Creates an Instance of type basic_string that holds the given codepoints The data itself will be first converted to UTF-8
Parameters
strThe codepoint sequence to fill the basic_string with
len(Optional) The maximum number of codepoints to read from the sequence

◆ basic_string() [22/28]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( T && str,
const allocator_type & alloc = allocator_type(),
enable_if_ptr< T, value_type > * = {} )
inlinenoexcept

◆ basic_string() [23/28]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( const value_type(&) str[LITLEN],
const allocator_type & alloc = allocator_type() )
inlinenoexcept

◆ basic_string() [24/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( std::initializer_list< value_type > ilist,
const allocator_type & alloc = allocator_type() )
inlinenoexcept

Constructor taking an initializer list of codepoints.

Note
The initializer list is expected to contain codepoints (rather than code units, i.e. bytes)
Parameters
ilistThe initializer list with the contents to be applied to this string

◆ basic_string() [25/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( value_type cp,
const allocator_type & alloc = allocator_type() )
inlineexplicitnoexcept

Constructor that fills the string with the supplied codepoint

Note
Creates an Instance of type basic_string that gets filled with 'n' codepoints
Parameters
cpThe codepoint written at the beginning of the buffer

◆ basic_string() [26/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( data_type ch,
const allocator_type & alloc = allocator_type() )
inlineexplicitnoexcept

Constructor that fills the string with the supplied character

Note
Creates an Instance of type basic_string that gets filled with 'n' codepoints
Parameters
chThe codepoint written at the beginning of the buffer

◆ basic_string() [27/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( basic_string< ValueType, DataType, Allocator > && str)
inlinenoexcept

Move Constructor that moves the supplied basic_string content into the new basic_string

Note
Creates an Instance of type basic_string that takes all data as well as the allocator from 'str' The supplied basic_string is invalid afterwards and may not be used anymore
Parameters
strThe basic_string to move from

◆ basic_string() [28/28]

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::basic_string ( basic_string< ValueType, DataType, Allocator > && str,
const allocator_type & alloc )
inlinenoexcept

Move Constructor that moves the supplied basic_string content into the new basic_string

Note
Creates an Instance of type basic_string that takes all data from 'str' The supplied basic_string is invalid afterwards and may not be used anymore
Parameters
strThe basic_string to move from

◆ ~basic_string()

template<typename ValueType , typename DataType , typename Allocator >
tiny_utf8::basic_string< ValueType, DataType, Allocator >::~basic_string ( )
inlinenoexcept

Destructor

Note
Destructs a basic_string at the end of its lifetime releasing all held memory

Member Function Documentation

◆ allocate()

template<typename ValueType , typename DataType , typename Allocator >
data_type * tiny_utf8::basic_string< ValueType, DataType, Allocator >::allocate ( size_type total_buffer_size) const
inlineprotectednoexcept

Allocates size_type-aligned storage (make sure, total_buffer_size is a multiple of sizeof(size_type)!)

◆ append()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A > & tiny_utf8::basic_string< V, D, A >::append ( const basic_string< ValueType, DataType, Allocator > & appendix)
noexcept

Appends the supplied basic_string to the end of this basic_string

Parameters
appendixThe basic_string to be appended
Returns
A reference to this basic_string, which now has the supplied string appended

Ok, obviously no small string, we have to update the data, the lut and the number of codepoints

◆ assign() [1/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( basic_string< ValueType, DataType, Allocator > && str)
inlinenoexcept

Moves the contents out of the supplied string into this one

Parameters
strThe basic_string this string shall move from
Returns
A reference to this basic_string, updated to the new string

◆ assign() [2/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( const basic_string< ValueType, DataType, Allocator > & str)
inlinenoexcept

Sets the contents of this string to a copy of the supplied basic_string

Parameters
strThe basic_string this string shall be made a copy of
Returns
A reference to this basic_string, updated to the new string

◆ assign() [3/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( const basic_string< ValueType, DataType, Allocator > & str,
size_type pos,
size_type count )
inlinenoexcept

Sets the contents of this string to a substring of the supplied basic_string

Parameters
strThe basic_string this string shall be constructed a substring of
posThe codepoint position indicating the start of the string to be used for construction
cpThe number of codepoints to be taken from 'str'
Returns
A reference to this basic_string, updated to the new string

◆ assign() [4/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( const data_type * str,
size_type len )
inlinenoexcept

◆ assign() [5/12]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( const data_type(&) str[LITLEN])
inlinenoexcept

Assigns an utf8 char literal to this string (with possibly embedded '\0's)

Parameters
strThe UTF-8 literal to fill the basic_string with

◆ assign() [6/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( const value_type * str,
size_type len )
inlinenoexcept

◆ assign() [7/12]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( const value_type(&) str[LITLEN])
inlinenoexcept

Assigns an utf-32 char literal to this string (with possibly embedded '\0's)

Parameters
strThe UTF-32 literal to fill the basic_string with

◆ assign() [8/12]

template<typename ValueType , typename DataType , typename Allocator >
template<typename InputIt >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( InputIt first,
InputIt last )
inlinenoexcept

Assigns the range of codepoints supplied to this string. The resulting string will equal [first,last)

Note
The Range is expected to contain codepoints (rather than code units, i.e. bytes)
Parameters
firstThe start of the range to read from
lastThe end of the range

◆ assign() [9/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( size_type count,
value_type cp )
inlinenoexcept

Sets the contents of this string to 'count' times 'cp'

Parameters
countThe number of times the supplied codepoint is to be repeated
cpThe codepoint to repeat 'count' times
Returns
A reference to this basic_string, updated to the new string

◆ assign() [10/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( std::initializer_list< value_type > ilist)
inlinenoexcept

Assigns the supplied initializer list of codepoints to this string.

Note
The initializer list is expected to contain codepoints (rather than code units, i.e. bytes)
Parameters
ilistThe initializer list with the contents to be applied to this string

◆ assign() [11/12]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( T && str,
enable_if_ptr< T, data_type > * = {} )
inlinenoexcept

Assigns an utf8 sequence and the maximum length to read from it (in number of codepoints) to this string

Parameters
strThe UTF-8 sequence to fill the this basic_string with
len(Optional) The maximum number of codepoints to read from the sequence

◆ assign() [12/12]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::assign ( T && str,
enable_if_ptr< T, value_type > * = {} )
inlinenoexcept

Assigns an utf-32 sequence and the maximum length to read from it (in number of codepoints) to this string

Parameters
strThe UTF-8 sequence to fill the this basic_string with
len(Optional) The maximum number of codepoints to read from the sequence

◆ at() [1/4]

template<typename ValueType , typename DataType , typename Allocator >
value_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::at ( size_type n) const
inlinenoexcept

Returns the codepoint at the supplied index

Parameters
nThe codepoint index of the codepoint to receive
Returns
The codepoint at position 'n'

◆ at() [2/4]

template<typename ValueType , typename DataType , typename Allocator >
checked_reference tiny_utf8::basic_string< ValueType, DataType, Allocator >::at ( size_type n)
inlinenoexcept

◆ at() [3/4]

template<typename ValueType , typename DataType , typename Allocator >
value_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::at ( size_type n,
std::nothrow_t  ) const
inlinenoexcept

◆ at() [4/4]

template<typename ValueType , typename DataType , typename Allocator >
reference tiny_utf8::basic_string< ValueType, DataType, Allocator >::at ( size_type n,
std::nothrow_t  )
inlinenoexcept

◆ back() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
value_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::back ( ) const
inlinenoexcept

◆ back() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_reference tiny_utf8::basic_string< ValueType, DataType, Allocator >::back ( )
inlinenoexcept

Returns a reference to the last codepoint in the basic_string

Returns
A reference wrapper to the last codepoint in the basic_string

◆ begin() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::begin ( ) const
inlinenoexcept

◆ begin() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::begin ( )
inlinenoexcept

Get an iterator to the beginning of the basic_string

Returns
An iterator class pointing to the beginning of this basic_string

◆ c_str()

template<typename ValueType , typename DataType , typename Allocator >
const data_type * tiny_utf8::basic_string< ValueType, DataType, Allocator >::c_str ( ) const
inlinenoexcept

Get the raw data contained in this basic_string

Note
Returns the UTF-8 formatted content of this basic_string
Returns
UTF-8 formatted data, trailled by a '\0'

◆ capacity()

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::capacity ( ) const
inlinenoexcept

Returns the current capacity of this string. That is, the number of codepoints it can hold without reallocation

Returns
The number of bytes currently allocated

◆ cbegin()

template<typename ValueType , typename DataType , typename Allocator >
const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::cbegin ( ) const
inlinenoexcept

Get a const iterator to the beginning of the basic_string

Returns
A const iterator class pointing to the beginning of this basic_string, which cannot alter things inside this basic_string

◆ cend()

template<typename ValueType , typename DataType , typename Allocator >
const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::cend ( ) const
inlinenoexcept

Get an iterator to the end of the basic_string

Returns
A const iterator class, which cannot alter this basic_string, pointing to the end of this basic_string, that is pointing behind the last codepoint

◆ clear()

template<typename ValueType , typename DataType , typename Allocator >
void tiny_utf8::basic_string< ValueType, DataType, Allocator >::clear ( )
inlinenoexcept

Clears the content of this basic_string

Note
Resets the data to an empty string ("")

◆ compare() [1/6]

template<typename ValueType , typename DataType , typename Allocator >
int tiny_utf8::basic_string< ValueType, DataType, Allocator >::compare ( const basic_string< ValueType, DataType, Allocator > & str) const
inlinenoexcept

Compare this string with the supplied one.

Parameters
strThe string to compare this one with
Returns
0 They compare equal <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter. >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer.

◆ compare() [2/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
int tiny_utf8::basic_string< ValueType, DataType, Allocator >::compare ( const data_type(&) str[LITLEN]) const
inlinenoexcept

Compares this string with the supplied one.

Parameters
strPointer to a string literal with possibly embedded zeros, interpreted as UTF-8. The pointer is expected to be valid
Returns
0 They compare equal <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter. >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer.

◆ compare() [3/6]

template<typename ValueType , typename DataType , typename Allocator >
int tiny_utf8::basic_string< ValueType, DataType, Allocator >::compare ( const std::string & str) const
inlinenoexcept

Compare this string with the supplied one.

Parameters
strThe string to compare this one with, interpreted as UTF-8.
Returns
0 They compare equal <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter. >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer.

◆ compare() [4/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
int tiny_utf8::basic_string< ValueType, DataType, Allocator >::compare ( const value_type(&) str[LITLEN]) const
inlinenoexcept

Compares this string with the supplied one.

Parameters
strPointer to a string literal with possibly embedded zeros, interpreted as UTF-32. The pointer is expected to be valid
Returns
0 They compare equal <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter. >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer.

◆ compare() [5/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
int tiny_utf8::basic_string< ValueType, DataType, Allocator >::compare ( T str,
enable_if_ptr< T, data_type > * = {} ) const
inlinenoexcept

Compares this string with the supplied one. The supplied string literal is assumed to end at the (possibly trailling) '\0'. This is especially important, if this utf8 string contains embedded zeros.

Parameters
strNull-terminated string literal, interpreted as UTF-8. The pointer is expected to be valid
Returns
0 They compare equal <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter. >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer.

◆ compare() [6/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
int tiny_utf8::basic_string< ValueType, DataType, Allocator >::compare ( T str,
enable_if_ptr< T, value_type > * = {} ) const
inlinenoexcept

Compares this string with the supplied one. Thes supplied string literal is assumed to end at the (possibly trailling) '\0'. This is especially important, if this utf8 string contains embedded zeros.

Parameters
strPointer to a null-terminated string literal, interpreted as UTF-32. The pointer is expected to be valid
Returns
0 They compare equal <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter. >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer.

◆ copy_lut_indicator()

template<typename ValueType , typename DataType , typename Allocator >
static void tiny_utf8::basic_string< ValueType, DataType, Allocator >::copy_lut_indicator ( data_type * dest,
const data_type * source )
inlinestaticprotectednoexcept

Copy lut indicator.

◆ cpp_str()

template<typename ValueType , typename DataType , typename Allocator >
std::basic_string< data_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::cpp_str ( bool prepend_bom = false) const
inlinenoexcept

Get the raw data contained in this basic_string wrapped by an std::string

Note
Returns the UTF-8 formatted content of this basic_string
Returns
UTF-8 formatted data, wrapped inside an std::string

◆ cpp_str_bom()

template<typename V , typename D , typename A >
std::basic_string< typename basic_string< V, D, A >::data_type > tiny_utf8::basic_string< V, D, A >::cpp_str_bom ( ) const
protectednoexcept

Returns an std::string with the UTF-8 BOM prepended.

◆ crbegin()

template<typename ValueType , typename DataType , typename Allocator >
const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::crbegin ( ) const
inlinenoexcept

Get a const reverse iterator to the end of this basic_string

Returns
A const reverse iterator class, which cannot alter this basic_string, pointing to the end of this basic_string, that is exactly to the last codepoint

◆ crend()

template<typename ValueType , typename DataType , typename Allocator >
const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::crend ( ) const
inlinenoexcept

Get a const reverse iterator to the beginning of this basic_string

Returns
A const reverse iterator class, which cannot alter this basic_string, pointing to the end of this basic_string, that is pointing before the first codepoint

◆ data() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
const data_type * tiny_utf8::basic_string< ValueType, DataType, Allocator >::data ( ) const
inlinenoexcept

◆ data() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
data_type * tiny_utf8::basic_string< ValueType, DataType, Allocator >::data ( )
inlinenoexcept

◆ deallocate()

template<typename ValueType , typename DataType , typename Allocator >
void tiny_utf8::basic_string< ValueType, DataType, Allocator >::deallocate ( data_type * buffer,
size_type buffer_size ) const
inlineprotectednoexcept

Allocates size_type-aligned storage (make sure, buffer_size is a multiple of sizeof(size_type)!)

◆ decode_utf8()

template<typename ValueType , typename DataType , typename Allocator >
static value_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::decode_utf8 ( const data_type * data,
width_type num_bytes )
inlinestaticprotectednoexcept

Decodes a given input of rle utf8 data to a unicode codepoint, given the number of bytes it's made of.

◆ decode_utf8_and_len()

template<typename ValueType , typename DataType , typename Allocator >
static width_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::decode_utf8_and_len ( const data_type * data,
value_type & dest,
size_type data_left )
inlinestaticprotectednoexcept

Decodes a given input of rle utf8 data to a unicode codepoint and returns the number of bytes it used

◆ determine_main_buffer_size() [1/3]

template<typename ValueType , typename DataType , typename Allocator >
static size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::determine_main_buffer_size ( size_type data_len)
inlinestaticprotectednoexcept

Determine the needed buffer size if the lut is empty (excluding the trailling LUT indicator)

◆ determine_main_buffer_size() [2/3]

template<typename ValueType , typename DataType , typename Allocator >
static size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::determine_main_buffer_size ( size_type data_len,
size_type lut_len,
width_type * lut_width )
inlinestaticprotectednoexcept

Determine the needed buffer size and the needed lut width (excluding the trailling LUT indicator)

◆ determine_main_buffer_size() [3/3]

template<typename ValueType , typename DataType , typename Allocator >
static size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::determine_main_buffer_size ( size_type data_len,
size_type lut_len,
width_type lut_width )
inlinestaticprotectednoexcept

Determine the needed buffer size if the lut width is known (excluding the trailling LUT indicator)

◆ determine_total_buffer_size()

template<typename ValueType , typename DataType , typename Allocator >
static size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::determine_total_buffer_size ( size_type main_buffer_size)
inlinestaticprotectednoexcept

Same as above but this time including the LUT indicator.

◆ empty()

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::empty ( ) const
inlinenoexcept

Check, whether this basic_string is empty

Note
Returns True, if this basic_string is empty, that also is comparing true with ""
Returns
True, if this basic_string is empty, false if its length is >0

◆ encode_utf8() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
static width_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::encode_utf8 ( value_type cp,
data_type * dest )
inlinestaticprotectednoexcept

Encodes a given codepoint to a character buffer of at least 7 bytes and returns the number of bytes it used

◆ encode_utf8() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
static void tiny_utf8::basic_string< ValueType, DataType, Allocator >::encode_utf8 ( value_type cp,
data_type * dest,
width_type cp_bytes )
inlinestaticprotectednoexcept

Encodes a given codepoint (expected to use 'cp_bytes') to a character buffer capable of holding that many bytes.

◆ end() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::end ( ) const
inlinenoexcept

◆ end() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::end ( )
inlinenoexcept

Get an iterator to the end of the basic_string

Returns
An iterator class pointing to the end of this basic_string, that is pointing behind the last codepoint

◆ ends_with() [1/7]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::ends_with ( const basic_string< ValueType, DataType, Allocator > & str) const
inlinenoexcept

Check, whether this string ends with the supplied character sequence

Parameters
strThe string to compare the end of this string with
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ ends_with() [2/7]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::ends_with ( const data_type(&) str[LITLEN]) const
inlinenoexcept

Check, whether this string ends with the supplied UTF-8 sequence.

Parameters
strPointer to a string literal with possibly embedded zeros, interpreted as UTF-8. The pointer is expected to be valid
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ ends_with() [3/7]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::ends_with ( const std::string & str) const
inlinenoexcept

Check, whether this string ends with the supplied character sequence

Parameters
strThe string to compare the end of this string with
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ ends_with() [4/7]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::ends_with ( const value_type(&) str[LITLEN]) const
inlinenoexcept

Check, whether this string ends with the supplied codepoint sequence.

Parameters
strPointer to a string literal with possibly embedded zeros, interpreted as UTF-32. The pointer is expected to be valid
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ ends_with() [5/7]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::ends_with ( T str,
enable_if_ptr< T, data_type > * = {} ) const
inlinenoexcept

Check, whether this string ends with the supplied UTF-8 sequence.

Parameters
strNull-terminated string literal, interpreted as UTF-8. The pointer is expected to be valid
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ ends_with() [6/7]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::ends_with ( T str,
enable_if_ptr< T, value_type > * = {} ) const
inlinenoexcept

Check, whether this string ends with the supplied codepoint sequence.

Parameters
strPointer to a null-terminated string literal, interpreted as UTF-32. The pointer is expected to be valid
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ ends_with() [7/7]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::ends_with ( value_type cp) const
inlinenoexcept

Check, whether this string ends with the supplied codepoint

Parameters
strThe codepoint to compare the end of this string with
Returns
true, if this string ends with the codepoint 'cp', false otherwise.

◆ erase() [1/6]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::erase ( iterator first,
iterator last )
inlinenoexcept

◆ erase() [2/6]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::erase ( iterator first,
raw_iterator last )
inlinenoexcept

◆ erase() [3/6]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::erase ( raw_iterator first,
iterator last )
inlinenoexcept

◆ erase() [4/6]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::erase ( raw_iterator first,
raw_iterator last )
inlinenoexcept

Erases the codepoints inside the supplied range

Parameters
firstAn iterator pointing to the first codepoint to be erased
lastAn iterator pointing to the codepoint behind the last codepoint to be erased
Returns
A reference to this basic_string, which now has the codepoints erased

◆ erase() [5/6]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::erase ( raw_iterator pos)
inlinenoexcept

Erases the codepoint at the supplied iterator position

Parameters
posThe iterator pointing to the position being erased
Returns
A reference to this basic_string, which now has the codepoint erased

◆ erase() [6/6]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::erase ( size_type pos,
size_type len = 1 )
inlinenoexcept

Erases a portion of this string

Parameters
posThe codepoint index to start eraseing from
lenThe number of codepoints to be erased from this basic_string
Returns
A reference to this basic_string, with the supplied portion erased

◆ find() [1/3]

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::find ( const basic_string< ValueType, DataType, Allocator > & pattern,
size_type start_codepoint = 0 ) const
inlinenoexcept

Finds a specific pattern within the basic_string starting at the supplied codepoint index

Parameters
cpThe codepoint to look for
start_codepointThe index of the first codepoint to start looking from
Returns
The codepoint index where and if the pattern was found or basic_string::npos

◆ find() [2/3]

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::find ( const data_type * pattern,
size_type start_codepoint = 0 ) const
inlinenoexcept

Finds a specific pattern within the basic_string starting at the supplied codepoint index

Parameters
cpThe codepoint to look for
start_codepointThe index of the first codepoint to start looking from
Returns
The codepoint index where and if the pattern was found or basic_string::npos

◆ find() [3/3]

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::find ( value_type cp,
size_type start_codepoint = 0 ) const
inlinenoexcept

Finds a specific codepoint inside the basic_string starting at the supplied codepoint index

Parameters
cpThe codepoint to look for
start_codepointThe index of the first codepoint to start looking from
Returns
The codepoint index where and if the codepoint was found or basic_string::npos

◆ find_first_not_of()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::find_first_not_of ( const value_type * str,
size_type start_codepoint = 0 ) const
noexcept

Find absence of characters in string.

◆ find_first_of()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::find_first_of ( const value_type * str,
size_type start_codepoint = 0 ) const
noexcept

Find characters in string.

◆ find_last_not_of()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::find_last_not_of ( const value_type * str,
size_type start_codepoint = basic_string< ValueType, DataType, Allocator >::npos ) const
noexcept

◆ find_last_of()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::find_last_of ( const value_type * str,
size_type start_codepoint = basic_string< ValueType, DataType, Allocator >::npos ) const
noexcept

◆ front() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
value_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::front ( ) const
inlinenoexcept

◆ front() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_reference tiny_utf8::basic_string< ValueType, DataType, Allocator >::front ( )
inlinenoexcept

Returns a reference to the first codepoint in the basic_string

Returns
A reference wrapper to the first codepoint in the basic_string

◆ get() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::get ( size_type n) const
inlinenoexcept

◆ get() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::get ( size_type n)
inlinenoexcept

Returns an iterator pointing to the supplied codepoint index

Parameters
nThe index of the codepoint to get the iterator to
Returns
An iterator pointing to the specified codepoint index

◆ get_allocator()

template<typename ValueType , typename DataType , typename Allocator >
allocator_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_allocator ( ) const
inlinenoexcept

Returns a copy of the stored allocator

Returns
A copy of the stored allocator instance

◆ get_buffer() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
const data_type * tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_buffer ( ) const
inlineprotectednoexcept

Get buffer.

◆ get_buffer() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
data_type * tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_buffer ( )
inlineprotectednoexcept

◆ get_buffer_size()

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_buffer_size ( ) const
inlineprotectednoexcept

Get buffer size (excluding the trailing LUT indicator)

◆ get_codepoint_bytes() [1/3]

template<typename ValueType , typename DataType , typename Allocator >
static width_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_codepoint_bytes ( data_type first_byte,
size_type data_left )
staticprotectednoexcept

Returns the number of code units (bytes) using the supplied first byte of a utf8 codepoint

◆ get_codepoint_bytes() [2/3]

template<typename ValueType , typename DataType , typename Allocator >
width_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_codepoint_bytes ( size_type codepoint_index) const
inlinenoexcept

◆ get_codepoint_bytes() [3/3]

template<typename ValueType , typename DataType , typename Allocator >
static width_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_codepoint_bytes ( value_type cp)
inlinestaticprotectednoexcept

Returns the number of code units (bytes) a codepoint will translate to in utf8

◆ get_codepoint_pre_bytes()

template<typename ValueType , typename DataType , typename Allocator >
width_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_codepoint_pre_bytes ( size_type codepoint_index) const
inlinenoexcept

◆ get_index_bytes()

template<typename ValueType , typename DataType , typename Allocator >
width_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_index_bytes ( size_type byte_index) const
inlinenoexcept

Get the number of bytes of codepoint in basic_string.

◆ get_index_pre_bytes()

template<typename ValueType , typename DataType , typename Allocator >
width_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_index_pre_bytes ( size_type byte_index) const
inlinenoexcept

Get the number of bytes before a codepoint, that build up a new codepoint.

◆ get_lut()

template<typename ValueType , typename DataType , typename Allocator >
static size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_lut ( const data_type * iter,
width_type lut_width )
inlinestaticprotectednoexcept

Get the nth index within a multibyte index table.

◆ get_lut_base_ptr() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
static const data_type * tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_lut_base_ptr ( const data_type * buffer,
size_type buffer_size )
inlinestaticprotectednoexcept

◆ get_lut_base_ptr() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
static data_type * tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_lut_base_ptr ( data_type * buffer,
size_type buffer_size )
inlinestaticprotectednoexcept

Get the LUT base pointer from buffer and buffer size.

◆ get_lut_len()

template<typename ValueType , typename DataType , typename Allocator >
static size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_lut_len ( const data_type * lut_base_ptr)
inlinestaticprotectednoexcept

Get the LUT size (given the lut is active!)

◆ get_lut_width()

template<typename ValueType , typename DataType , typename Allocator >
static width_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_lut_width ( size_type buffer_size)
inlinestaticprotectednoexcept

Determine, whether we will use a 'std::uint8_t', 'std::uint16_t', 'std::uint32_t' or 'std::uint64_t'-based index table. Returns the number of bytes of the destination data type

◆ get_msb_mask()

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
static constexpr T tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_msb_mask ( width_type bytes = sizeof(T))
inlinestaticconstexprprotectednoexcept

◆ get_non_sso_capacity()

template<typename V , typename D , typename A >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::get_non_sso_capacity ( ) const
protectednoexcept

Return a good guess of how many codepoints the currently allocated buffer can hold.

◆ get_non_sso_string_len()

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_non_sso_string_len ( ) const
inlineprotectednoexcept

Get buffer size, if SSO is disabled.

◆ get_num_bytes()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::get_num_bytes ( size_type byte_start,
size_type cp_count ) const
noexcept

Counts the number of bytes required to hold the supplied amount of codepoints starting at the supplied byte index (or '0' for the '_from_start' version)

◆ get_num_bytes_from_start()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::get_num_bytes_from_start ( size_type cp_count) const
noexcept

◆ get_num_bytes_of_utf8_char_before()

template<typename V , typename D , typename A >
basic_string< V, D, A >::width_type tiny_utf8::basic_string< V, D, A >::get_num_bytes_of_utf8_char_before ( const data_type * data_start,
size_type index )
staticprotectednoexcept

Returns the number of bytes to expect before this one (including this one) that belong to this utf8 char.

◆ get_num_codepoints()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::get_num_codepoints ( size_type byte_start,
size_type byte_count ) const
noexcept

Counts the number of codepoints that are contained within the supplied range of bytes

◆ get_sso_capacity()

template<typename ValueType , typename DataType , typename Allocator >
static constexpr size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_sso_capacity ( )
inlinestaticconstexprprotectednoexcept

Static helper methods.

Get the maximum number of bytes (excluding the trailing '\0') that can be stored within a basic_string object

◆ get_sso_data_len()

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::get_sso_data_len ( ) const
inlineprotectednoexcept

Get the data length (when SSO is active)

◆ insert() [1/4]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::insert ( raw_iterator it,
const basic_string< ValueType, DataType, Allocator > & str )
inlinenoexcept

Inserts a given basic_string into this basic_string at the supplied iterator position

Parameters
itThe iterator position to insert at
cpThe basic_string to be inserted
Returns
A reference to this basic_string, with the supplied codepoint inserted

◆ insert() [2/4]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::insert ( raw_iterator it,
value_type cp )
inlinenoexcept

Inserts a given codepoint into this basic_string at the supplied iterator position

Parameters
itThe iterator position to insert at
cpThe codepoint to be inserted
Returns
A reference to this basic_string, with the supplied codepoint inserted

◆ insert() [3/4]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::insert ( size_type pos,
const basic_string< ValueType, DataType, Allocator > & str )
inlinenoexcept

Inserts a given basic_string into this basic_string at the supplied codepoint index

Parameters
posThe codepoint index to insert at
strThe basic_string to be inserted
Returns
A reference to this basic_string, with the supplied basic_string inserted

◆ insert() [4/4]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::insert ( size_type pos,
value_type cp )
inlinenoexcept

Inserts a given codepoint into this basic_string at the supplied codepoint index

Parameters
posThe codepoint index to insert at
cpThe codepoint to be inserted
Returns
A reference to this basic_string, with the supplied codepoint inserted

◆ is_lut_active()

template<typename ValueType , typename DataType , typename Allocator >
static bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::is_lut_active ( const data_type * lut_base_ptr)
inlinestaticprotectednoexcept

Check, if the lut is active using the lut base ptr.

◆ is_lut_worth()

template<typename ValueType , typename DataType , typename Allocator >
static bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::is_lut_worth ( size_type pot_lut_len,
size_type string_len,
bool lut_present,
bool biased = true )
inlinestaticprotectednoexcept

Determine, whether or not a LUT is worth to set up. General case: worth below 25%. If LUT present <33,3%, otherwise <16,7%.

◆ length()

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::length ( ) const
inlinenoexcept

Get the number of codepoints in this basic_string

Note
Returns the number of codepoints that are taken care of For the number of bytes,
See also
size()
Returns
Number of codepoints (not bytes!)

◆ lut_active()

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::lut_active ( ) const
inlinenoexcept

Determine, if small string optimization is active

Returns
True, if the utf8 data is stored within the basic_string object itself false, otherwise

◆ operator!=() [1/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator!= ( const basic_string< ValueType, DataType, Allocator > & str) const
inlinenoexcept

◆ operator!=() [2/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator!= ( const data_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator!=() [3/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator!= ( const std::string & str) const
inlinenoexcept

◆ operator!=() [4/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator!= ( const value_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator!=() [5/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, data_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator!= ( T && str) const
inlinenoexcept

◆ operator!=() [6/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, value_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator!= ( T && str) const
inlinenoexcept

◆ operator()() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
value_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator() ( size_type n) const
inlinenoexcept

◆ operator()() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_reference tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator() ( size_type n)
inlinenoexcept

Returns a reference to the codepoint at the supplied byte position

Note
As this access is raw, that is not looking up for the actual byte position, it is very fast
Parameters
nThe byte position of the codepoint to receive
Returns
A reference wrapper to the codepoint at byte position 'n'

◆ operator+() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
basic_string tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator+ ( basic_string< ValueType, DataType, Allocator > summand) const &
inlinenoexcept

Appends/prepends the supplied basic_string resp. data_type/value_type (value/literal) to a copy of this basic_string

Parameters
lhsThe basic_string to be added
Returns
The newly created basic_string, consisting of the concatenated parts.

◆ operator+() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
basic_string tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator+ ( const basic_string< ValueType, DataType, Allocator > & summand) &&
inlinenoexcept

◆ operator+=() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator+= ( const basic_string< ValueType, DataType, Allocator > & appendix)
inlinenoexcept

◆ operator+=() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator+= ( value_type cp)
inlinenoexcept

◆ operator<() [1/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator< ( const basic_string< ValueType, DataType, Allocator > & str) const
inlinenoexcept

◆ operator<() [2/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator< ( const data_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator<() [3/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator< ( const std::string & str) const
inlinenoexcept

◆ operator<() [4/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator< ( const value_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator<() [5/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, data_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator< ( T && str) const
inlinenoexcept

◆ operator<() [6/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, value_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator< ( T && str) const
inlinenoexcept

◆ operator<=() [1/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator<= ( const basic_string< ValueType, DataType, Allocator > & str) const
inlinenoexcept

◆ operator<=() [2/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator<= ( const data_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator<=() [3/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator<= ( const std::string & str) const
inlinenoexcept

◆ operator<=() [4/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator<= ( const value_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator<=() [5/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, data_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator<= ( T && str) const
inlinenoexcept

◆ operator<=() [6/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, value_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator<= ( T && str) const
inlinenoexcept

◆ operator=() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator= ( basic_string< ValueType, DataType, Allocator > && str)
inlinenoexcept

Move Assignment operator that moves all data out of the supplied and into this basic_string

Note
Moves all data from 'str' into this basic_string deleting all data that previously was in there The supplied basic_string is invalid afterwards and may not be used anymore
Parameters
strThe basic_string to move from
Returns
A reference to the string now holding the data (*this)

◆ operator=() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator= ( const basic_string< ValueType, DataType, Allocator > & str)
noexcept

Copy Assignment operator that sets the basic_string to a copy of the supplied one

Note
Assigns a copy of 'str' to this basic_string deleting all data that previously was in there
Parameters
strThe basic_string to copy from
Returns
A reference to the string now holding the data (*this)

◆ operator==() [1/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator== ( const basic_string< ValueType, DataType, Allocator > & str) const
inlinenoexcept

Equality Comparison Operators.

◆ operator==() [2/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator== ( const data_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator==() [3/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator== ( const std::string & str) const
inlinenoexcept

◆ operator==() [4/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator== ( const value_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator==() [5/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, data_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator== ( T && str) const
inlinenoexcept

◆ operator==() [6/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, value_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator== ( T && str) const
inlinenoexcept

◆ operator>() [1/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator> ( const basic_string< ValueType, DataType, Allocator > & str) const
inlinenoexcept

Lexicographical comparison Operators.

◆ operator>() [2/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator> ( const data_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator>() [3/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator> ( const std::string & str) const
inlinenoexcept

◆ operator>() [4/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator> ( const value_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator>() [5/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, data_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator> ( T && str) const
inlinenoexcept

◆ operator>() [6/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, value_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator> ( T && str) const
inlinenoexcept

◆ operator>=() [1/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator>= ( const basic_string< ValueType, DataType, Allocator > & str) const
inlinenoexcept

◆ operator>=() [2/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator>= ( const data_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator>=() [3/6]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator>= ( const std::string & str) const
inlinenoexcept

◆ operator>=() [4/6]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator>= ( const value_type(&) str[LITLEN]) const
inlinenoexcept

◆ operator>=() [5/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, data_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator>= ( T && str) const
inlinenoexcept

◆ operator>=() [6/6]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, value_type > tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator>= ( T && str) const
inlinenoexcept

◆ operator[]() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
value_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator[] ( size_type n) const
inlinenoexcept

◆ operator[]() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
reference tiny_utf8::basic_string< ValueType, DataType, Allocator >::operator[] ( size_type n)
inlinenoexcept

Returns a reference to the codepoint at the supplied index

Parameters
nThe codepoint index of the codepoint to receive
Returns
A reference wrapper to the codepoint at position 'n'

◆ pop_back()

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::pop_back ( )
inlinenoexcept

Removes the last codepoint in the basic_string.

◆ prepend()

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::prepend ( const basic_string< ValueType, DataType, Allocator > & prependix)
inlinenoexcept

Prepend the supplied basic_string to this basic_string

Parameters
prependixThe basic_string to be prepended
Returns
A reference to this basic_string, which now has the supplied string prepended

◆ push_back()

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::push_back ( value_type cp)
inlinenoexcept

Appends the supplied codepoint to the end of this basic_string

Parameters
cpThe codepoint to be appended
Returns
A reference to this basic_string, which now has the supplied codepoint appended

◆ raw_at() [1/4]

template<typename ValueType , typename DataType , typename Allocator >
value_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_at ( size_type byte_index) const
inlinenoexcept

◆ raw_at() [2/4]

template<typename ValueType , typename DataType , typename Allocator >
raw_checked_reference tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_at ( size_type byte_index)
inlinenoexcept

Returns the codepoint at the supplied byte position

Note
As this access is raw, that is not looking up for the actual byte position, it is very fast.
Parameters
byte_indexThe byte position of the codepoint to receive
Returns
The codepoint at the supplied position

◆ raw_at() [3/4]

template<typename ValueType , typename DataType , typename Allocator >
value_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_at ( size_type byte_index,
std::nothrow_t  ) const
inlinenoexcept

◆ raw_at() [4/4]

template<typename ValueType , typename DataType , typename Allocator >
raw_reference tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_at ( size_type byte_index,
std::nothrow_t  )
inlinenoexcept

◆ raw_back_index()

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_back_index ( ) const
inlinenoexcept

Get the byte index of the last codepoint.

◆ raw_begin() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_begin ( ) const
inlinenoexcept

◆ raw_begin() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_begin ( )
inlinenoexcept

◆ raw_cbegin()

template<typename ValueType , typename DataType , typename Allocator >
raw_const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_cbegin ( ) const
inlinenoexcept

◆ raw_cend()

template<typename ValueType , typename DataType , typename Allocator >
raw_const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_cend ( ) const
inlinenoexcept

◆ raw_crbegin()

template<typename ValueType , typename DataType , typename Allocator >
raw_const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_crbegin ( ) const
inlinenoexcept

◆ raw_crend()

template<typename ValueType , typename DataType , typename Allocator >
raw_const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_crend ( ) const
inlinenoexcept

◆ raw_end() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_end ( ) const
inlinenoexcept

◆ raw_end() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_end ( )
inlinenoexcept

◆ raw_erase()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A > & tiny_utf8::basic_string< V, D, A >::raw_erase ( size_type pos,
size_type len )
noexcept

Erases a byte range of this string

Note
As this function is raw, that is without having to compute actual byte indices, it is much faster that erase()
Parameters
posThe byte position index to start erasing from
lenThe number of bytes to be erased from the basic_string
Returns
A reference to this basic_string, with the supplied bytes erased

Ok, obviously no small string, we have to update the data, the lut and the number of codepoints. BUT: We will keep the lut in the mode it is: inactive stay inactive, active stays active

◆ raw_find() [1/3]

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_find ( const basic_string< ValueType, DataType, Allocator > & pattern,
size_type start_byte = 0 ) const
inlinenoexcept

Finds a specific pattern within the basic_string starting at the supplied byte position

Parameters
needleThe pattern to look for
start_byteThe byte position of the first codepoint to start looking from
Returns
The byte position where and if the pattern was found or basic_string::npos

◆ raw_find() [2/3]

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_find ( const data_type * pattern,
size_type start_byte = 0 ) const
inlinenoexcept

Finds a specific pattern within the basic_string starting at the supplied byte position

Parameters
needleThe pattern to look for
start_byteThe byte position of the first codepoint to start looking from
Returns
The byte position where and if the pattern was found or basic_string::npos

◆ raw_find() [3/3]

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_find ( value_type cp,
size_type start_byte = 0 ) const
inlinenoexcept

Finds a specific codepoint inside the basic_string starting at the supplied byte position

Parameters
cpThe codepoint to look for
start_byteThe byte position of the first codepoint to start looking from
Returns
The byte position where and if the codepoint was found or basic_string::npos

◆ raw_find_first_not_of()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::raw_find_first_not_of ( const value_type * str,
size_type start_byte = 0 ) const
noexcept

◆ raw_find_first_of()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::raw_find_first_of ( const value_type * str,
size_type start_byte = 0 ) const
noexcept

◆ raw_find_last_not_of()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::raw_find_last_not_of ( const value_type * str,
size_type start_byte = basic_string< ValueType, DataType, Allocator >::npos ) const
noexcept

◆ raw_find_last_of()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::raw_find_last_of ( const value_type * str,
size_type start_byte = basic_string< ValueType, DataType, Allocator >::npos ) const
noexcept

◆ raw_get() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_const_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_get ( size_type n) const
inlinenoexcept

◆ raw_get() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_get ( size_type n)
inlinenoexcept

Returns an iterator pointing to the codepoint at the supplied byte position

Note
As this access is raw, that is not looking up for the actual byte position, it is very fast
Parameters
nThe byte position of the codepoint to get the iterator to
Returns
An iterator pointing to the specified byte position

◆ raw_insert() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_insert ( size_type pos,
const basic_string< ValueType, DataType, Allocator > & str )
noexcept

Inserts a given basic_string into this basic_string at the supplied byte position

Note
As this function is raw, that is without having to compute actual byte indices, it is much faster that insert()
Parameters
posThe byte position index to insert at
strThe basic_string to be inserted
Returns
A reference to this basic_string, with the supplied basic_string inserted

◆ raw_insert() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_insert ( size_type pos,
value_type cp )
inlinenoexcept

Inserts a given codepoint into this basic_string at the supplied byte position

Note
As this function is raw, that is without having to compute actual byte indices, it is much faster that insert()
Parameters
posThe byte position index to insert at
cpThe codepoint to be inserted
Returns
A reference to this basic_string, with the supplied basic_string inserted

◆ raw_rbegin() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_rbegin ( ) const
inlinenoexcept

◆ raw_rbegin() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_rbegin ( )
inlinenoexcept

◆ raw_rend() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_rend ( ) const
inlinenoexcept

◆ raw_rend() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_rend ( )
inlinenoexcept

◆ raw_replace()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A > & tiny_utf8::basic_string< V, D, A >::raw_replace ( size_type start_byte,
size_type byte_count,
const basic_string< ValueType, DataType, Allocator > & repl )
noexcept

Replace a number of bytes of this basic_string with the contents of the supplied basic_string

Note
As this function is raw, that is not having to compute byte indices, it is much faster than the codepoint-base replace function
Parameters
start_byteThe byte position at which the replacement is being started
byte_countThe number of bytes that are being replaced
replThe basic_string to replace all bytes inside the range
Returns
A reference to this basic_string, which now has the replaced part in it

Ok, obviously no small string, we have to update the data, the lut and the number of codepoints

◆ raw_rfind()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A >::size_type tiny_utf8::basic_string< V, D, A >::raw_rfind ( value_type cp,
size_type start_byte = basic_string< ValueType, DataType, Allocator >::npos ) const
noexcept

Finds the last occourence of a specific codepoint inside the basic_string starting backwards at the supplied byte index

Parameters
cpThe codepoint to look for
start_codepointThe byte index of the first codepoint to start looking from (backwards)
Returns
The codepoint index where and if the codepoint was found or basic_string::npos

◆ raw_rget() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_rget ( size_type n) const
inlinenoexcept

◆ raw_rget() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
raw_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_rget ( size_type n)
inlinenoexcept

Returns a reverse iterator pointing to the codepoint at the supplied byte position

Note
As this access is raw, that is not looking up for the actual byte position, it is very fast
Parameters
nThe byte position of the codepoint to get the reverse iterator to
Returns
A reverse iterator pointing to the specified byte position

◆ raw_substr()

template<typename ValueType , typename DataType , typename Allocator >
basic_string< V, D, A > tiny_utf8::basic_string< V, D, A >::raw_substr ( size_type start_byte,
size_type byte_count ) const
noexcept

Returns a portion of the basic_string (indexed on byte-base)

Note
As this function is raw, that is without having to compute actual byte indices, it is much faster that substr()
Parameters
start_byteThe byte position where the substring shall start
byte_countThe number of bytes that the substring shall have
Returns
The basic_string holding the specified bytes

◆ rbegin() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::rbegin ( ) const
inlinenoexcept

◆ rbegin() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::rbegin ( )
inlinenoexcept

Get a reverse iterator to the end of this basic_string

Returns
A reverse iterator class pointing to the end of this basic_string, that is exactly to the last codepoint

◆ rend() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::rend ( ) const
inlinenoexcept

◆ rend() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::rend ( )
inlinenoexcept

Get a reverse iterator to the beginning of this basic_string

Returns
A reverse iterator class pointing to the end of this basic_string, that is pointing before the first codepoint

◆ replace() [1/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( iterator first,
iterator last,
const basic_string< ValueType, DataType, Allocator > & repl )
inlinenoexcept

◆ replace() [2/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( iterator first,
iterator last,
value_type repl )
inlinenoexcept

◆ replace() [3/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( iterator first,
iterator last,
value_type repl,
size_type n )
inlinenoexcept

◆ replace() [4/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( iterator first,
raw_iterator last,
const basic_string< ValueType, DataType, Allocator > & repl )
inlinenoexcept

◆ replace() [5/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( iterator first,
raw_iterator last,
value_type repl )
inlinenoexcept

◆ replace() [6/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( iterator first,
raw_iterator last,
value_type repl,
size_type n )
inlinenoexcept

◆ replace() [7/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( raw_iterator first,
iterator last,
const basic_string< ValueType, DataType, Allocator > & repl )
inlinenoexcept

◆ replace() [8/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( raw_iterator first,
iterator last,
value_type repl )
inlinenoexcept

◆ replace() [9/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( raw_iterator first,
iterator last,
value_type repl,
size_type n )
inlinenoexcept

◆ replace() [10/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( raw_iterator first,
raw_iterator last,
const basic_string< ValueType, DataType, Allocator > & repl )
inlinenoexcept

Replace a range of codepoints with the contents of the supplied basic_string

Parameters
firstAn iterator pointing to the first codepoint to be replaced
lastAn iterator pointing to the codepoint behind the last codepoint to be replaced
replThe basic_string to replace all codepoints in the range
Returns
A reference to this basic_string, which now has the replaced part in it

◆ replace() [11/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( raw_iterator first,
raw_iterator last,
value_type repl )
inlinenoexcept

◆ replace() [12/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( raw_iterator first,
raw_iterator last,
value_type repl,
size_type n )
inlinenoexcept

Replace a range of codepoints by a number of codepoints

Parameters
firstAn iterator pointing to the first codepoint to be replaced
lastAn iterator pointing to the codepoint behind the last codepoint to be replaced
replThe wide character that will be used to replace the codepoints in the range
n(Optional) The number of codepoint that will replace the old ones
Returns
A reference to this basic_string, which now has the replaced part in it

◆ replace() [13/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( size_type index,
size_type count,
const basic_string< ValueType, DataType, Allocator > & repl )
inlinenoexcept

Replace a number of codepoints of this basic_string with the contents of the supplied basic_string

Parameters
indexThe codpoint index at which the replacement is being started
lenThe number of codepoints that are being replaced
replThe basic_string to replace all codepoints in the range
Returns
A reference to this basic_string, which now has the replaced part in it

◆ replace() [14/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( size_type index,
size_type len,
value_type repl )
inlinenoexcept

◆ replace() [15/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( size_type index,
size_type len,
value_type repl,
size_type n )
inlinenoexcept

Replace a number of codepoints of this basic_string by a number of other codepoints

Parameters
indexThe codpoint index at which the replacement is being started
lenThe number of codepoints that are being replaced
replThe wide character that will be used to replace the codepoints
nThe number of codepoint that will replace the old ones
Returns
A reference to this basic_string, which now has the replaced part in it

◆ replace() [16/16]

template<typename ValueType , typename DataType , typename Allocator >
basic_string & tiny_utf8::basic_string< ValueType, DataType, Allocator >::replace ( size_type index,
value_type repl,
size_type n = 1 )
inlinenoexcept

Replace a codepoint of this basic_string by a number of codepoints

Parameters
indexThe codpoint index to be replaced
replThe wide character that will be used to replace the codepoint
nThe number of codepoint that will be inserted instead of the one residing at position 'index'
Returns
A reference to this basic_string, which now has the replaced part in it

◆ requires_unicode()

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::requires_unicode ( ) const
inlinenoexcept

tinyutf8-specific features

Check whether the data inside this basic_string cannot be iterated by an std::string

Note
Returns true, if the basic_string has codepoints that exceed 7 bits to be stored
Returns
True, if there are UTF-8 formatted byte sequences, false, if there are only ascii characters (<128) inside

◆ requires_unicode_sso()

template<typename V , typename D , typename A >
bool tiny_utf8::basic_string< V, D, A >::requires_unicode_sso ( ) const
protectednoexcept

Check, whether the string contains codepoints > 127.

◆ rfind()

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::rfind ( value_type cp,
size_type start_codepoint = basic_string< ValueType, DataType, Allocator >::npos ) const
inlinenoexcept

Finds the last occourence of a specific codepoint inside the basic_string starting backwards at the supplied codepoint index

Parameters
cpThe codepoint to look for
start_codepointThe index of the first codepoint to start looking from (backwards)
Returns
The codepoint index where and if the codepoint was found or basic_string::npos

◆ rget() [1/2]

template<typename ValueType , typename DataType , typename Allocator >
const_reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::rget ( size_type n) const
inlinenoexcept

◆ rget() [2/2]

template<typename ValueType , typename DataType , typename Allocator >
reverse_iterator tiny_utf8::basic_string< ValueType, DataType, Allocator >::rget ( size_type n)
inlinenoexcept

Returns a reverse iterator pointing to the supplied codepoint index

Parameters
nThe index of the codepoint to get the reverse iterator to
Returns
A reverse iterator pointing to the specified codepoint index

◆ round_up_to_align()

template<typename ValueType , typename DataType , typename Allocator >
static size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::round_up_to_align ( size_type val)
inlinestaticprotectednoexcept

Rounds the supplied value to a multiple of sizeof(size_type)

◆ set_lut()

template<typename ValueType , typename DataType , typename Allocator >
static void tiny_utf8::basic_string< ValueType, DataType, Allocator >::set_lut ( data_type * iter,
width_type lut_width,
size_type value )
inlinestaticprotectednoexcept

◆ set_lut_indiciator()

template<typename ValueType , typename DataType , typename Allocator >
static void tiny_utf8::basic_string< ValueType, DataType, Allocator >::set_lut_indiciator ( data_type * lut_base_ptr,
bool active,
size_type lut_len = 0 )
inlinestaticprotectednoexcept

Construct the lut mode indicator.

◆ set_non_sso_string_len()

template<typename ValueType , typename DataType , typename Allocator >
void tiny_utf8::basic_string< ValueType, DataType, Allocator >::set_non_sso_string_len ( size_type string_len)
inlineprotectednoexcept

Non-static helper methods.

Set the main buffer size (also disables SSO)

◆ set_sso_data_len()

template<typename ValueType , typename DataType , typename Allocator >
void tiny_utf8::basic_string< ValueType, DataType, Allocator >::set_sso_data_len ( unsigned char data_len = 0)
inlineprotectednoexcept

Set the data length (also enables SSO)

◆ shrink_to_fit()

template<typename V , typename D , typename A >
void tiny_utf8::basic_string< V, D, A >::shrink_to_fit ( )
noexcept

Requests the removal of unused capacity.

Determine the threshold above which it's profitable to reallocate (at least 10 bytes and at least a quarter of the memory)

Determine the threshold above which it's profitable to reallocate (at least 10 bytes and at least a quarter of the memory)

◆ size()

template<typename ValueType , typename DataType , typename Allocator >
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::size ( ) const
inlinenoexcept

Get the number of bytes that are used by this basic_string

Note
Returns the number of bytes required to hold the contained wide string, That is, without counting the trailling '\0'
Returns
Number of bytes (not codepoints!)

◆ sso_active()

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::sso_active ( ) const
inlinenoexcept

Determine, if small string optimization is active

Returns
True, if the utf8 data is stored within the basic_string object itself false, otherwise

◆ sso_inactive()

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::sso_inactive ( ) const
inlineprotectednoexcept

Check, if sso is inactive (this operation doesn't require a negation and is faster)

◆ starts_with() [1/7]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::starts_with ( const basic_string< ValueType, DataType, Allocator > & str) const
inlinenoexcept

Check, whether this string ends with the supplied character sequence

Parameters
strThe string to compare the end of this string with
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ starts_with() [2/7]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::starts_with ( const data_type(&) str[LITLEN]) const
inlinenoexcept

Check, whether this string ends with the supplied UTF-8 sequence.

Parameters
strPointer to a string literal with possibly embedded zeros, interpreted as UTF-8. The pointer is expected to be valid
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ starts_with() [3/7]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::starts_with ( const std::string & str) const
inlinenoexcept

Check, whether this string ends with the supplied character sequence

Parameters
strThe string to compare the end of this string with
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ starts_with() [4/7]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::starts_with ( const value_type(&) str[LITLEN]) const
inlinenoexcept

Check, whether this string ends with the supplied codepoint sequence.

Parameters
strPointer to a string literal with possibly embedded zeros, interpreted as UTF-32. The pointer is expected to be valid
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ starts_with() [5/7]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::starts_with ( T str,
enable_if_ptr< T, data_type > * = {} ) const
inlinenoexcept

Check, whether this string ends with the supplied UTF-8 sequence.

Parameters
strNull-terminated string literal, interpreted as UTF-8. The pointer is expected to be valid
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ starts_with() [6/7]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::starts_with ( T str,
enable_if_ptr< T, value_type > * = {} ) const
inlinenoexcept

Check, whether this string ends with the supplied codepoint sequence.

Parameters
strPointer to a null-terminated string literal, interpreted as UTF-32. The pointer is expected to be valid
Returns
true, if this string ends with the sequence 'str', false otherwise.

◆ starts_with() [7/7]

template<typename ValueType , typename DataType , typename Allocator >
bool tiny_utf8::basic_string< ValueType, DataType, Allocator >::starts_with ( value_type cp) const
inlinenoexcept

Check, whether this string ends with the supplied codepoint

Parameters
strThe codepoint to compare the end of this string with
Returns
true, if this string ends with the codepoint 'cp', false otherwise.

◆ substr() [1/5]

template<typename ValueType , typename DataType , typename Allocator >
basic_string tiny_utf8::basic_string< ValueType, DataType, Allocator >::substr ( iterator first,
iterator last )
inlinenoexcept

◆ substr() [2/5]

template<typename ValueType , typename DataType , typename Allocator >
basic_string tiny_utf8::basic_string< ValueType, DataType, Allocator >::substr ( iterator first,
raw_iterator last )
inlinenoexcept

◆ substr() [3/5]

template<typename ValueType , typename DataType , typename Allocator >
basic_string tiny_utf8::basic_string< ValueType, DataType, Allocator >::substr ( raw_iterator first,
iterator last )
inlinenoexcept

◆ substr() [4/5]

template<typename ValueType , typename DataType , typename Allocator >
basic_string tiny_utf8::basic_string< ValueType, DataType, Allocator >::substr ( raw_iterator first,
raw_iterator last ) const
inlinenoexcept

Returns a portion of the basic_string

Parameters
firstAn iterator pointing to the first codepoint to be included in the substring
lastAn iterator pointing to the codepoint behind the last codepoint in the substring
Returns
The basic_string holding the specified range

◆ substr() [5/5]

template<typename ValueType , typename DataType , typename Allocator >
basic_string tiny_utf8::basic_string< ValueType, DataType, Allocator >::substr ( size_type pos,
size_type len = basic_string< ValueType, DataType, Allocator >::npos ) const
inlinenoexcept

Returns a portion of the basic_string

Parameters
posThe codepoint index that should mark the start of the substring
lenThe number codepoints to be included within the substring
Returns
The basic_string holding the specified codepoints

◆ swap()

template<typename ValueType , typename DataType , typename Allocator >
void tiny_utf8::basic_string< ValueType, DataType, Allocator >::swap ( basic_string< ValueType, DataType, Allocator > & str)
inlinenoexcept

Swaps the contents of this basic_string with the supplied one

Note
Swaps all data with the supplied basic_string
Parameters
strThe basic_string to swap contents with

◆ to_wide_literal()

template<typename ValueType , typename DataType , typename Allocator >
void tiny_utf8::basic_string< ValueType, DataType, Allocator >::to_wide_literal ( value_type * dest) const
inlinenoexcept

Receive a (null-terminated) wide string literal from this UTF-8 string

Parameters
destA buffer capable of holding at least 'length()+1' elements of type 'value_type'
Returns
void

Friends And Related Symbol Documentation

◆ operator+ [1/12]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
basic_string operator+ ( basic_string< ValueType, DataType, Allocator > lhs,
const data_type(&) rhs[LITLEN] )
friend

◆ operator+ [2/12]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
basic_string operator+ ( basic_string< ValueType, DataType, Allocator > lhs,
const value_type(&) rhs[LITLEN] )
friend

◆ operator+ [3/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string operator+ ( basic_string< ValueType, DataType, Allocator > lhs,
data_type rhs )
friend

◆ operator+ [4/12]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, data_type, basic_string > operator+ ( basic_string< ValueType, DataType, Allocator > lhs,
T && rhs )
friend

◆ operator+ [5/12]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, value_type, basic_string > operator+ ( basic_string< ValueType, DataType, Allocator > lhs,
T && rhs )
friend

◆ operator+ [6/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string operator+ ( basic_string< ValueType, DataType, Allocator > lhs,
value_type rhs )
friend

◆ operator+ [7/12]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
basic_string operator+ ( const data_type(&) lhs[LITLEN],
basic_string< ValueType, DataType, Allocator > rhs )
friend

◆ operator+ [8/12]

template<typename ValueType , typename DataType , typename Allocator >
template<size_type LITLEN>
basic_string operator+ ( const value_type(&) lhs[LITLEN],
basic_string< ValueType, DataType, Allocator > rhs )
friend

◆ operator+ [9/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string operator+ ( data_type lhs,
basic_string< ValueType, DataType, Allocator > rhs )
friend

◆ operator+ [10/12]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, data_type, basic_string > operator+ ( T && lhs,
basic_string< ValueType, DataType, Allocator > rhs )
friend

◆ operator+ [11/12]

template<typename ValueType , typename DataType , typename Allocator >
template<typename T >
enable_if_ptr< T, value_type, basic_string > operator+ ( T && lhs,
basic_string< ValueType, DataType, Allocator > rhs )
friend

◆ operator+ [12/12]

template<typename ValueType , typename DataType , typename Allocator >
basic_string operator+ ( value_type lhs,
basic_string< ValueType, DataType, Allocator > rhs )
friend

Member Data Documentation

◆ [union]

union { ... } tiny_utf8::basic_string< ValueType, DataType, Allocator >

Attributes.

◆ t_non_sso

template<typename ValueType , typename DataType , typename Allocator >
NON_SSO tiny_utf8::basic_string< ValueType, DataType, Allocator >::t_non_sso

◆ t_sso

template<typename ValueType , typename DataType , typename Allocator >
SSO tiny_utf8::basic_string< ValueType, DataType, Allocator >::t_sso

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