![]() |
tinyutf8 4.0.2
Unicode (UTF-8) capable std::string
|
#include <tinyutf8.h>
Classes | |
struct | NON_SSO |
Layout specifications. More... | |
struct | SSO |
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_string & | operator= (const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | operator= (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_type * | c_str () const noexcept |
const data_type * | data () const noexcept |
data_type * | data () 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_string & | replace (size_type index, value_type repl, size_type n=1) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (size_type index, size_type len, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (size_type index, size_type len, value_type repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (raw_iterator first, raw_iterator last, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (raw_iterator first, raw_iterator last, value_type repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (raw_iterator first, iterator last, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (iterator first, raw_iterator last, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (iterator first, iterator last, value_type repl, size_type n) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (raw_iterator first, iterator last, value_type repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (iterator first, raw_iterator last, value_type repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (iterator first, iterator last, value_type repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (raw_iterator first, raw_iterator last, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (raw_iterator first, iterator last, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (iterator first, raw_iterator last, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (iterator first, iterator last, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | replace (size_type index, size_type count, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | raw_replace (size_type start_byte, size_type byte_count, const basic_string &repl) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | prepend (const basic_string &prependix) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | append (const basic_string &appendix) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | operator+= (const basic_string &appendix) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | push_back (value_type cp) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | operator+= (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_string & | assign (size_type count, value_type cp) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | assign (const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | assign (const basic_string &str, size_type pos, size_type count) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | assign (basic_string &&str) noexcept(TINY_UTF8_NOEXCEPT &&std::is_nothrow_move_assignable< Allocator >()) |
template<typename T > | |
basic_string & | assign (T &&str, enable_if_ptr< T, data_type > *={}) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | assign (const data_type *str, size_type len) noexcept(TINY_UTF8_NOEXCEPT) |
template<size_type LITLEN> | |
basic_string & | assign (const data_type(&str)[LITLEN]) noexcept(TINY_UTF8_NOEXCEPT) |
template<typename T > | |
basic_string & | assign (T &&str, enable_if_ptr< T, value_type > *={}) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | assign (const value_type *str, size_type len) noexcept(TINY_UTF8_NOEXCEPT) |
template<size_type LITLEN> | |
basic_string & | assign (const value_type(&str)[LITLEN]) noexcept(TINY_UTF8_NOEXCEPT) |
template<typename InputIt > | |
basic_string & | assign (InputIt first, InputIt last) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | assign (std::initializer_list< value_type > ilist) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | insert (size_type pos, value_type cp) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | insert (size_type pos, const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | insert (raw_iterator it, value_type cp) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | insert (raw_iterator it, const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | raw_insert (size_type pos, const basic_string &str) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | raw_insert (size_type pos, value_type cp) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | pop_back () noexcept(TINY_UTF8_NOEXCEPT) |
Removes the last codepoint in the basic_string. | |
basic_string & | erase (raw_iterator pos) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | erase (raw_iterator first, raw_iterator last) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | erase (raw_iterator first, iterator last) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | erase (iterator first, raw_iterator last) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | erase (iterator first, iterator last) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | erase (size_type pos, size_type len=1) noexcept(TINY_UTF8_NOEXCEPT) |
basic_string & | raw_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_type > | operator== (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, data_type > | operator!= (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, value_type > | operator== (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, value_type > | operator!= (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_type > | operator> (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, data_type > | operator>= (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, data_type > | operator< (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, data_type > | operator<= (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, value_type > | operator> (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, value_type > | operator>= (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, value_type > | operator< (T &&str) const noexcept |
template<typename T > | |
enable_if_ptr< T, value_type > | operator<= (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_type > | cpp_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_type * | get_buffer () const noexcept |
Get buffer. | |
data_type * | get_buffer () noexcept |
size_type | get_buffer_size () const noexcept |
Get buffer size (excluding the trailing LUT indicator) | |
std::basic_string< data_type > | cpp_str_bom () const noexcept |
Returns an std::string with the UTF-8 BOM prepended. | |
data_type * | allocate (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_type * | get_lut_base_ptr (data_type *buffer, size_type buffer_size) noexcept |
Get the LUT base pointer from buffer and buffer size. | |
static const data_type * | get_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. | ||
Allocator tiny_utf8::basic_string< ValueType, DataType, Allocator >::allocator_type |
codepoint_reference<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::checked_reference |
tiny_utf8::const_iterator<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::const_iterator |
const value_type& tiny_utf8::basic_string< ValueType, DataType, Allocator >::const_reference |
tiny_utf8::const_reverse_iterator<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::const_reverse_iterator |
DataType tiny_utf8::basic_string< ValueType, DataType, Allocator >::data_type |
std::allocator_traits<Allocator>::difference_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::difference_type |
|
protected |
|
protected |
|
protected |
SFINAE helpers for constructors.
size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::indicator_type |
tiny_utf8::iterator<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::iterator |
raw_codepoint_reference<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_checked_reference |
tiny_utf8::const_iterator<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_const_iterator |
tiny_utf8::const_reverse_iterator<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_const_reverse_iterator |
tiny_utf8::iterator<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_iterator |
raw_codepoint_reference<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_reference |
tiny_utf8::reverse_iterator<basic_string, true> tiny_utf8::basic_string< ValueType, DataType, Allocator >::raw_reverse_iterator |
codepoint_reference<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::reference |
tiny_utf8::reverse_iterator<basic_string, false> tiny_utf8::basic_string< ValueType, DataType, Allocator >::reverse_iterator |
std::allocator_traits<Allocator>::size_type tiny_utf8::basic_string< ValueType, DataType, Allocator >::size_type |
ValueType tiny_utf8::basic_string< ValueType, DataType, Allocator >::value_type |
std::uint_fast8_t tiny_utf8::basic_string< ValueType, DataType, Allocator >::width_type |
anonymous enum : size_type |
|
protectednoexcept |
Constructs an basic_string from a character literal.
|
protectednoexcept |
|
inlinenoexcept |
Default Ctor
|
inlineexplicitnoexcept |
Ctor taking an alloc
|
inlinenoexcept |
Constructor taking an utf8 sequence and the maximum length to read from it (in number of codepoints)
str | The 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 |
|
inlinenoexcept |
Constructor taking an utf8 sequence and the maximum length to read from it (in number of codepoints)
str | The UTF-8 sequence to fill the basic_string with |
len | The maximum number of codepoints to read from the sequence |
alloc | (Optional) The allocator instance to use |
|
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)
str | The UTF-8 sequence to fill the basic_string with |
pos | The codepoint position of the first codepoint to read |
len | The maximum number of codepoints to read from the sequence |
alloc | (Optional) The allocator instance to use |
|
inlinenoexcept |
Constructor taking an utf8 char literal
str | The 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 |
|
inlinenoexcept |
|
inlinenoexcept |
Constructor taking an utf8 char literal and the maximum number of codepoints to read
str | The UTF-8 literal to fill the basic_string with |
len | The maximum number of codepoints to read from the sequence |
alloc | (Optional) The allocator instance to use |
|
inlinenoexcept |
Constructor taking an utf8 char literal, a codepoint position to start reading from the sequence and the maximum number of codepoints to read
str | The UTF-8 literal to fill the basic_string with |
pos | The codepoint position of the first codepoint to read (bounds-checked) |
len | The maximum number of codepoints to read from the sequence |
alloc | (Optional) The allocator instance to use |
|
inlinenoexcept |
Constructor taking an std::string
str | The string object from which the data will be copied (interpreted as UTF-8) |
alloc | (Optional) The allocator instance to use |
|
inlinenoexcept |
Constructor taking an std::string
str | The string object from which the data will be copied (interpreted as UTF-8) |
len | The maximum number of codepoints to read from 'str' |
alloc | (Optional) The allocator instance to use |
|
inlinenoexcept |
|
noexcept |
Constructor that fills the string with a certain amount of codepoints
n | The number of codepoints generated |
cp | The codepoint that the whole buffer will be set to |
alloc | (Optional) The allocator instance to use |
|
noexcept |
Constructor that fills the string with a certain amount of characters
n | The number of characters generated |
cp | The characters that the whole buffer will be set to |
alloc | (Optional) The allocator instance to use |
|
inlinenoexcept |
Constructs the string with a portion of the supplied string
str | The string that the constructed string shall be a substring of |
pos | The codepoint position indicating the start of the string to be used for construction |
count | The number of codepoints to be taken from 'str' |
alloc | (Optional) The allocator instance to use |
|
inlinenoexcept |
Constructs the string from the range of codepoints supplied. The resulting string will equal [first,last)
first | The start of the range to construct from |
last | The end of the range |
alloc | (Optional) The allocator instance to use |
|
inlinenoexcept |
Copy Constructor that copies the supplied basic_string to construct the string
str | The basic_string to copy from |
|
inlinenoexcept |
Copy Constructor that copies the supplied basic_string to construct the string
str | The basic_string to copy from |
alloc | The new allocator instance to use |
|
noexcept |
Constructor taking a wide codepoint literal that will be copied to construct this basic_string
str | The codepoint sequence to fill the basic_string with |
len | (Optional) The maximum number of codepoints to read from the sequence |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Constructor taking an initializer list of codepoints.
ilist | The initializer list with the contents to be applied to this string |
|
inlineexplicitnoexcept |
Constructor that fills the string with the supplied codepoint
cp | The codepoint written at the beginning of the buffer |
|
inlineexplicitnoexcept |
Constructor that fills the string with the supplied character
ch | The codepoint written at the beginning of the buffer |
|
inlinenoexcept |
Move Constructor that moves the supplied basic_string content into the new basic_string
str | The basic_string to move from |
|
inlinenoexcept |
Move Constructor that moves the supplied basic_string content into the new basic_string
str | The basic_string to move from |
|
inlinenoexcept |
Destructor
|
inlineprotectednoexcept |
Allocates size_type-aligned storage (make sure, total_buffer_size is a multiple of sizeof(size_type)!)
|
noexcept |
Appends the supplied basic_string to the end of this basic_string
appendix | The basic_string to be appended |
Ok, obviously no small string, we have to update the data, the lut and the number of codepoints
|
inlinenoexcept |
Moves the contents out of the supplied string into this one
str | The basic_string this string shall move from |
|
inlinenoexcept |
Sets the contents of this string to a copy of the supplied basic_string
str | The basic_string this string shall be made a copy of |
|
inlinenoexcept |
Sets the contents of this string to a substring of the supplied basic_string
str | The basic_string this string shall be constructed a substring of |
pos | The codepoint position indicating the start of the string to be used for construction |
cp | The number of codepoints to be taken from 'str' |
|
inlinenoexcept |
|
inlinenoexcept |
Assigns an utf8 char literal to this string (with possibly embedded '\0's)
str | The UTF-8 literal to fill the basic_string with |
|
inlinenoexcept |
|
inlinenoexcept |
Assigns an utf-32 char literal to this string (with possibly embedded '\0's)
str | The UTF-32 literal to fill the basic_string with |
|
inlinenoexcept |
Assigns the range of codepoints supplied to this string. The resulting string will equal [first,last)
first | The start of the range to read from |
last | The end of the range |
|
inlinenoexcept |
Sets the contents of this string to 'count' times 'cp'
count | The number of times the supplied codepoint is to be repeated |
cp | The codepoint to repeat 'count' times |
|
inlinenoexcept |
Assigns the supplied initializer list of codepoints to this string.
ilist | The initializer list with the contents to be applied to this string |
|
inlinenoexcept |
Assigns an utf8 sequence and the maximum length to read from it (in number of codepoints) to this string
str | The UTF-8 sequence to fill the this basic_string with |
len | (Optional) The maximum number of codepoints to read from the sequence |
|
inlinenoexcept |
Assigns an utf-32 sequence and the maximum length to read from it (in number of codepoints) to this string
str | The UTF-8 sequence to fill the this basic_string with |
len | (Optional) The maximum number of codepoints to read from the sequence |
|
inlinenoexcept |
Returns the codepoint at the supplied index
n | The codepoint index of the codepoint to receive |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a reference to the last codepoint in the basic_string
|
inlinenoexcept |
|
inlinenoexcept |
Get an iterator to the beginning of the basic_string
|
inlinenoexcept |
Get the raw data contained in this basic_string
|
inlinenoexcept |
Returns the current capacity of this string. That is, the number of codepoints it can hold without reallocation
|
inlinenoexcept |
Get a const iterator to the beginning of the basic_string
|
inlinenoexcept |
Get an iterator to the end of the basic_string
|
inlinenoexcept |
Clears the content of this basic_string
|
inlinenoexcept |
Compare this string with the supplied one.
str | The string to compare this one with |
|
inlinenoexcept |
Compares this string with the supplied one.
str | Pointer to a string literal with possibly embedded zeros, interpreted as UTF-8. The pointer is expected to be valid |
|
inlinenoexcept |
Compare this string with the supplied one.
str | The string to compare this one with, interpreted as UTF-8. |
|
inlinenoexcept |
Compares this string with the supplied one.
str | Pointer to a string literal with possibly embedded zeros, interpreted as UTF-32. The pointer is expected to be valid |
|
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.
str | Null-terminated string literal, interpreted as UTF-8. The pointer is expected to be valid |
|
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.
str | Pointer to a null-terminated string literal, interpreted as UTF-32. The pointer is expected to be valid |
|
inlinestaticprotectednoexcept |
Copy lut indicator.
|
inlinenoexcept |
Get the raw data contained in this basic_string wrapped by an std::string
|
protectednoexcept |
Returns an std::string with the UTF-8 BOM prepended.
|
inlinenoexcept |
Get a const reverse iterator to the end of this basic_string
|
inlinenoexcept |
Get a const reverse iterator to the beginning of this basic_string
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineprotectednoexcept |
Allocates size_type-aligned storage (make sure, buffer_size is a multiple of sizeof(size_type)!)
|
inlinestaticprotectednoexcept |
Decodes a given input of rle utf8 data to a unicode codepoint, given the number of bytes it's made of.
|
inlinestaticprotectednoexcept |
Decodes a given input of rle utf8 data to a unicode codepoint and returns the number of bytes it used
|
inlinestaticprotectednoexcept |
Determine the needed buffer size if the lut is empty (excluding the trailling LUT indicator)
|
inlinestaticprotectednoexcept |
Determine the needed buffer size and the needed lut width (excluding the trailling LUT indicator)
|
inlinestaticprotectednoexcept |
Determine the needed buffer size if the lut width is known (excluding the trailling LUT indicator)
|
inlinestaticprotectednoexcept |
Same as above but this time including the LUT indicator.
|
inlinenoexcept |
Check, whether this basic_string is empty
|
inlinestaticprotectednoexcept |
Encodes a given codepoint to a character buffer of at least 7 bytes and returns the number of bytes it used
|
inlinestaticprotectednoexcept |
Encodes a given codepoint (expected to use 'cp_bytes') to a character buffer capable of holding that many bytes.
|
inlinenoexcept |
|
inlinenoexcept |
Get an iterator to the end of the basic_string
|
inlinenoexcept |
Check, whether this string ends with the supplied character sequence
str | The string to compare the end of this string with |
|
inlinenoexcept |
Check, whether this string ends with the supplied UTF-8 sequence.
str | Pointer to a string literal with possibly embedded zeros, interpreted as UTF-8. The pointer is expected to be valid |
|
inlinenoexcept |
Check, whether this string ends with the supplied character sequence
str | The string to compare the end of this string with |
|
inlinenoexcept |
Check, whether this string ends with the supplied codepoint sequence.
str | Pointer to a string literal with possibly embedded zeros, interpreted as UTF-32. The pointer is expected to be valid |
|
inlinenoexcept |
Check, whether this string ends with the supplied UTF-8 sequence.
str | Null-terminated string literal, interpreted as UTF-8. The pointer is expected to be valid |
|
inlinenoexcept |
Check, whether this string ends with the supplied codepoint sequence.
str | Pointer to a null-terminated string literal, interpreted as UTF-32. The pointer is expected to be valid |
|
inlinenoexcept |
Check, whether this string ends with the supplied codepoint
str | The codepoint to compare the end of this string with |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Erases the codepoints inside the supplied range
first | An iterator pointing to the first codepoint to be erased |
last | An iterator pointing to the codepoint behind the last codepoint to be erased |
|
inlinenoexcept |
Erases the codepoint at the supplied iterator position
pos | The iterator pointing to the position being erased |
|
inlinenoexcept |
Erases a portion of this string
pos | The codepoint index to start eraseing from |
len | The number of codepoints to be erased from this basic_string |
|
inlinenoexcept |
Finds a specific pattern within the basic_string starting at the supplied codepoint index
cp | The codepoint to look for |
start_codepoint | The index of the first codepoint to start looking from |
|
inlinenoexcept |
Finds a specific pattern within the basic_string starting at the supplied codepoint index
cp | The codepoint to look for |
start_codepoint | The index of the first codepoint to start looking from |
|
inlinenoexcept |
Finds a specific codepoint inside the basic_string starting at the supplied codepoint index
cp | The codepoint to look for |
start_codepoint | The index of the first codepoint to start looking from |
|
noexcept |
Find absence of characters in string.
|
noexcept |
Find characters in string.
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a reference to the first codepoint in the basic_string
|
inlinenoexcept |
|
inlinenoexcept |
Returns an iterator pointing to the supplied codepoint index
n | The index of the codepoint to get the iterator to |
|
inlinenoexcept |
Returns a copy of the stored allocator
|
inlineprotectednoexcept |
Get buffer.
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
Get buffer size (excluding the trailing LUT indicator)
|
staticprotectednoexcept |
Returns the number of code units (bytes) using the supplied first byte of a utf8 codepoint
|
inlinenoexcept |
|
inlinestaticprotectednoexcept |
Returns the number of code units (bytes) a codepoint will translate to in utf8
|
inlinenoexcept |
|
inlinenoexcept |
Get the number of bytes of codepoint in basic_string.
|
inlinenoexcept |
Get the number of bytes before a codepoint, that build up a new codepoint.
|
inlinestaticprotectednoexcept |
Get the nth index within a multibyte index table.
|
inlinestaticprotectednoexcept |
|
inlinestaticprotectednoexcept |
Get the LUT base pointer from buffer and buffer size.
|
inlinestaticprotectednoexcept |
Get the LUT size (given the lut is active!)
|
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
|
inlinestaticconstexprprotectednoexcept |
|
protectednoexcept |
Return a good guess of how many codepoints the currently allocated buffer can hold.
|
inlineprotectednoexcept |
Get buffer size, if SSO is disabled.
|
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)
|
noexcept |
|
staticprotectednoexcept |
Returns the number of bytes to expect before this one (including this one) that belong to this utf8 char.
|
noexcept |
Counts the number of codepoints that are contained within the supplied range of bytes
|
inlinestaticconstexprprotectednoexcept |
Static helper methods.
Get the maximum number of bytes (excluding the trailing '\0') that can be stored within a basic_string object
|
inlineprotectednoexcept |
Get the data length (when SSO is active)
|
inlinenoexcept |
Inserts a given basic_string into this basic_string at the supplied iterator position
it | The iterator position to insert at |
cp | The basic_string to be inserted |
|
inlinenoexcept |
Inserts a given codepoint into this basic_string at the supplied iterator position
it | The iterator position to insert at |
cp | The codepoint to be inserted |
|
inlinenoexcept |
Inserts a given basic_string into this basic_string at the supplied codepoint index
pos | The codepoint index to insert at |
str | The basic_string to be inserted |
|
inlinenoexcept |
Inserts a given codepoint into this basic_string at the supplied codepoint index
pos | The codepoint index to insert at |
cp | The codepoint to be inserted |
|
inlinestaticprotectednoexcept |
Check, if the lut is active using the lut base ptr.
|
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%.
|
inlinenoexcept |
Get the number of codepoints in this basic_string
|
inlinenoexcept |
Determine, if small string optimization is active
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a reference to the codepoint at the supplied byte position
n | The byte position of the codepoint to receive |
|
inlinenoexcept |
Appends/prepends the supplied basic_string resp. data_type/value_type (value/literal) to a copy of this basic_string
lhs | The basic_string to be added |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Move Assignment operator that moves all data out of the supplied and into this basic_string
str | The basic_string to move from |
|
noexcept |
Copy Assignment operator that sets the basic_string to a copy of the supplied one
str | The basic_string to copy from |
|
inlinenoexcept |
Equality Comparison Operators.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Lexicographical comparison Operators.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a reference to the codepoint at the supplied index
n | The codepoint index of the codepoint to receive |
|
inlinenoexcept |
Removes the last codepoint in the basic_string.
|
inlinenoexcept |
Prepend the supplied basic_string to this basic_string
prependix | The basic_string to be prepended |
|
inlinenoexcept |
Appends the supplied codepoint to the end of this basic_string
cp | The codepoint to be appended |
|
inlinenoexcept |
|
inlinenoexcept |
Returns the codepoint at the supplied byte position
byte_index | The byte position of the codepoint to receive |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Get the byte index of the last codepoint.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
Erases a byte range of this string
pos | The byte position index to start erasing from |
len | The number of bytes to be erased from the basic_string |
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
|
inlinenoexcept |
Finds a specific pattern within the basic_string starting at the supplied byte position
needle | The pattern to look for |
start_byte | The byte position of the first codepoint to start looking from |
|
inlinenoexcept |
Finds a specific pattern within the basic_string starting at the supplied byte position
needle | The pattern to look for |
start_byte | The byte position of the first codepoint to start looking from |
|
inlinenoexcept |
Finds a specific codepoint inside the basic_string starting at the supplied byte position
cp | The codepoint to look for |
start_byte | The byte position of the first codepoint to start looking from |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns an iterator pointing to the codepoint at the supplied byte position
n | The byte position of the codepoint to get the iterator to |
|
noexcept |
Inserts a given basic_string into this basic_string at the supplied byte position
pos | The byte position index to insert at |
str | The basic_string to be inserted |
|
inlinenoexcept |
Inserts a given codepoint into this basic_string at the supplied byte position
pos | The byte position index to insert at |
cp | The codepoint to be inserted |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
Replace a number of bytes of this basic_string with the contents of the supplied basic_string
start_byte | The byte position at which the replacement is being started |
byte_count | The number of bytes that are being replaced |
repl | The basic_string to replace all bytes inside the range |
Ok, obviously no small string, we have to update the data, the lut and the number of codepoints
|
noexcept |
Finds the last occourence of a specific codepoint inside the basic_string starting backwards at the supplied byte index
cp | The codepoint to look for |
start_codepoint | The byte index of the first codepoint to start looking from (backwards) |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a reverse iterator pointing to the codepoint at the supplied byte position
n | The byte position of the codepoint to get the reverse iterator to |
|
noexcept |
Returns a portion of the basic_string (indexed on byte-base)
start_byte | The byte position where the substring shall start |
byte_count | The number of bytes that the substring shall have |
|
inlinenoexcept |
|
inlinenoexcept |
Get a reverse iterator to the end of this basic_string
|
inlinenoexcept |
|
inlinenoexcept |
Get a reverse iterator to the beginning of this basic_string
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Replace a range of codepoints with the contents of the supplied basic_string
first | An iterator pointing to the first codepoint to be replaced |
last | An iterator pointing to the codepoint behind the last codepoint to be replaced |
repl | The basic_string to replace all codepoints in the range |
|
inlinenoexcept |
|
inlinenoexcept |
Replace a range of codepoints by a number of codepoints
first | An iterator pointing to the first codepoint to be replaced |
last | An iterator pointing to the codepoint behind the last codepoint to be replaced |
repl | The 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 |
|
inlinenoexcept |
Replace a number of codepoints of this basic_string with the contents of the supplied basic_string
index | The codpoint index at which the replacement is being started |
len | The number of codepoints that are being replaced |
repl | The basic_string to replace all codepoints in the range |
|
inlinenoexcept |
|
inlinenoexcept |
Replace a number of codepoints of this basic_string by a number of other codepoints
index | The codpoint index at which the replacement is being started |
len | The number of codepoints that are being replaced |
repl | The wide character that will be used to replace the codepoints |
n | The number of codepoint that will replace the old ones |
|
inlinenoexcept |
Replace a codepoint of this basic_string by a number of codepoints
index | The codpoint index to be replaced |
repl | The wide character that will be used to replace the codepoint |
n | The number of codepoint that will be inserted instead of the one residing at position 'index' |
|
inlinenoexcept |
tinyutf8-specific features
Check whether the data inside this basic_string cannot be iterated by an std::string
|
protectednoexcept |
Check, whether the string contains codepoints > 127.
|
inlinenoexcept |
Finds the last occourence of a specific codepoint inside the basic_string starting backwards at the supplied codepoint index
cp | The codepoint to look for |
start_codepoint | The index of the first codepoint to start looking from (backwards) |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a reverse iterator pointing to the supplied codepoint index
n | The index of the codepoint to get the reverse iterator to |
|
inlinestaticprotectednoexcept |
Rounds the supplied value to a multiple of sizeof(size_type)
|
inlinestaticprotectednoexcept |
|
inlinestaticprotectednoexcept |
Construct the lut mode indicator.
|
inlineprotectednoexcept |
Non-static helper methods.
Set the main buffer size (also disables SSO)
|
inlineprotectednoexcept |
Set the data length (also enables SSO)
|
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)
|
inlinenoexcept |
Get the number of bytes that are used by this basic_string
|
inlinenoexcept |
Determine, if small string optimization is active
|
inlineprotectednoexcept |
Check, if sso is inactive (this operation doesn't require a negation and is faster)
|
inlinenoexcept |
Check, whether this string ends with the supplied character sequence
str | The string to compare the end of this string with |
|
inlinenoexcept |
Check, whether this string ends with the supplied UTF-8 sequence.
str | Pointer to a string literal with possibly embedded zeros, interpreted as UTF-8. The pointer is expected to be valid |
|
inlinenoexcept |
Check, whether this string ends with the supplied character sequence
str | The string to compare the end of this string with |
|
inlinenoexcept |
Check, whether this string ends with the supplied codepoint sequence.
str | Pointer to a string literal with possibly embedded zeros, interpreted as UTF-32. The pointer is expected to be valid |
|
inlinenoexcept |
Check, whether this string ends with the supplied UTF-8 sequence.
str | Null-terminated string literal, interpreted as UTF-8. The pointer is expected to be valid |
|
inlinenoexcept |
Check, whether this string ends with the supplied codepoint sequence.
str | Pointer to a null-terminated string literal, interpreted as UTF-32. The pointer is expected to be valid |
|
inlinenoexcept |
Check, whether this string ends with the supplied codepoint
str | The codepoint to compare the end of this string with |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a portion of the basic_string
first | An iterator pointing to the first codepoint to be included in the substring |
last | An iterator pointing to the codepoint behind the last codepoint in the substring |
|
inlinenoexcept |
Returns a portion of the basic_string
pos | The codepoint index that should mark the start of the substring |
len | The number codepoints to be included within the substring |
|
inlinenoexcept |
Swaps the contents of this basic_string with the supplied one
str | The basic_string to swap contents with |
|
inlinenoexcept |
Receive a (null-terminated) wide string literal from this UTF-8 string
dest | A buffer capable of holding at least 'length()+1' elements of type 'value_type' |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
union { ... } tiny_utf8::basic_string< ValueType, DataType, Allocator > |
Attributes.
NON_SSO tiny_utf8::basic_string< ValueType, DataType, Allocator >::t_non_sso |
SSO tiny_utf8::basic_string< ValueType, DataType, Allocator >::t_sso |