simstr 1.2.4
Yet another strings library
 
Loading...
Searching...
No Matches
simstr::lstring< K, N, forShared, Allocator > Class Template Reference

The mutable, owning string class. Contains an internal buffer for text of a given size. More...

#include <sstring.h>

Inheritance diagram for simstr::lstring< K, N, forShared, Allocator >:
simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, true > simstr::str_mutable< K, lstring< K, N, false, allocator_string > > simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string > simstr::from_utf_convertable< K, lstring< K, N, false, allocator_string > >

Public Types

enum  : size_t { LocalCapacity = N | (sizeof(void*) / sizeof(K) - 1) }
 

Public Member Functions

 lstring (const my_type &other)
 Copy from another string of the same type.
 
template<typename... Args>
requires (sizeof...(Args) > 0 && std::is_convertible_v<allocator_t, Args...>)
 lstring (const my_type &other, Args &&... args)
 Copy from another string of the same type, but with a different allocator.
 
template<typename T, size_t I = const_lit_for<K, T>::Count, typename... Args>
requires std::is_constructible_v<allocator_t, Args...>
constexpr lstring (T &&value, Args &&... args)
 String literal constructor.
 
 lstring (my_type &&other) noexcept
 Constructor for moving from a string of the same type.
 
template<typename Op, typename... Args>
requires (std::is_constructible_v<Allocator, Args...> && (std::is_invocable_v<Op, my_type&> || std::is_invocable_v<Op, K*, size_t>))
 lstring (const Op &op, Args &&... args)
 A fill constructor using a functor (see str_mutable::fill).
 
my_typeoperator= (const my_type &other)
 Copy assignment operator from a string of the same type.
 
my_typeoperator= (my_type &&other) noexcept
 Assignment operator by moving from a string of the same type.
 
my_typeoperator= (simple_str< K > other)
 Assignment operator from simple_str.
 
template<typename T, size_t S = const_lit_for<K, T>::Count>
my_typeoperator= (T &&other)
 String literal assignment operator.
 
my_typeoperator= (const StrExprForType< K > auto &expr)
 String expression appending operator.
 
size_t length () const noexcept
 String length.
 
const K * symbols () const noexcept
 Pointer to constant characters.
 
K * str () noexcept
 Pointer to a string buffer.
 
bool is_empty () const noexcept
 Is the string empty?
 
bool empty () const noexcept
 Whether the string is empty, for compatibility with std::string.
 
size_t capacity () const noexcept
 Current row buffer capacity.
 
K * reserve_no_preserve (size_t newSize)
 Allocate a buffer large enough to hold newSize characters plus a terminating null.
 
K * reserve (size_t newSize)
 Allocate a buffer large enough to hold newSize characters plus a terminating null.
 
K * set_size (size_t newSize)
 Sets the size of the current string, allocating space if necessary.
 
bool is_local () const noexcept
 Find out whether a local or external buffer is used for characters.
 
void define_size ()
 Determine the length of the string. Searches for the character 0 in the string buffer to its capacity, and then sets the length of the line to the found 0.
 
void shrink_to_fit ()
 Reduces the size of the external buffer to the smallest possible size to hold the string. If the string fits into the internal buffer, it copies it into it and frees the external buffer.
 
void clear ()
 Makes a string empty without changing the string buffer.
 
void reset ()
 Makes the string empty and frees the external buffer, if there was one.
 
constexpr K * place (K *ptr) const noexcept
 Copy the string to the specified buffer.
 
void copy_to (K *buffer, size_t bufSize)
 Copy the string to the specified buffer.
 
size_t size () const
 The size of the string in characters.
 
constexpr operator str_piece () const noexcept
 Convert itself to a "string chunk" that includes the entire string.
 
str_piece to_str () const noexcept
 Convert itself to a "string chunk" that includes the entire string.
 
std::basic_string_view< K > to_sv () const noexcept
 Convert to std::string_view.
 
std::basic_string< K > to_string () const noexcept
 Convert to std::string.
 
constexpr str_piece operator() (ptrdiff_t from, ptrdiff_t len=0) const noexcept
 Get part of a string as "simple_str".
 
constexpr str_piece mid (size_t from, size_t len=-1) const noexcept
 Get part of a string as "string chunk".
 
constexpr str_piece from_to (size_t from, size_t to) const noexcept
 Get the substring simple_str from position from to position to (not including it).
 
bool operator! () const noexcept
 Check for emptiness.
 
at (ptrdiff_t idx) const
 Get the character at the given position.
 
constexpr int compare (str_piece o) const
 Compare strings character by character.
 
constexpr int strcmp (const K *text) const
 Compare with C-string character by character.
 
constexpr bool equal (str_piece other) const noexcept
 String comparison for equality.
 
constexpr bool operator== (const base &other) const noexcept
 Operator comparing strings for equality.
 
bool operator== (T &&other) const noexcept
 Operator for comparing a string and a string literal for equality.
 
constexpr auto operator<=> (const base &other) const noexcept
 String comparison operator.
 
auto operator<=> (T &&other) const noexcept
 Comparison operator between a string and a string literal.
 
int compare_ia (str_piece text) const noexcept
 Compare strings character by character and not case sensitive ASCII characters.
 
bool equal_ia (str_piece text) const noexcept
 Whether a string is equal to another string, character-by-character-insensitive, of ASCII characters.
 
bool less_ia (str_piece text) const noexcept
 Whether a string is smaller than another string, character-by-character-insensitive, ASCII characters.
 
int compare_iu (str_piece text) const noexcept
 Compare strings character by character without taking into account the case of Unicode characters of the first plane (<0xFFFF).
 
bool equal_iu (str_piece text) const noexcept
 Whether a string is equal to another string, character-by-character-insensitive, of the Unicode characters of the first plane (<0xFFFF).
 
bool less_iu (str_piece text) const noexcept
 Whether a string is smaller than another string, character-by-character-insensitive, of the Unicode characters of the first plane (<0xFFFF).
 
size_t find (str_piece pattern, size_t offset=0) const noexcept
 Find the beginning of the first occurrence of a substring in this string.
 
size_t find (K s, size_t offset=0) const noexcept
 Find a character in this string.
 
size_t find_or_throw (str_piece pattern, size_t offset=0, Args &&... args) const noexcept
 Find the beginning of the first occurrence of a substring in this string or throw an exception.
 
size_t find_end (str_piece pattern, size_t offset=0) const noexcept
 Find the end of the occurrence of a substring in this string.
 
size_t find_or_all (str_piece pattern, size_t offset=0) const noexcept
 Find the beginning of the first occurrence of a substring in this string or the end of the string.
 
size_t find_or_all (K s, size_t offset=0) const noexcept
 Find a character in this string or the end of a string.
 
size_t find_end_or_all (str_piece pattern, size_t offset=0) const noexcept
 Find the end of the first occurrence of a substring in this string, or the end of a string.
 
size_t find_last (str_piece pattern, size_t offset=-1) const noexcept
 Find the beginning of the last occurrence of a substring in this string.
 
size_t find_last (K s, size_t offset=-1) const noexcept
 Find the last occurrence of a character in this string.
 
size_t find_end_of_last (str_piece pattern, size_t offset=-1) const noexcept
 Find the end of the last occurrence of a substring in this string.
 
size_t find_last_or_all (str_piece pattern, size_t offset=-1) const noexcept
 Find the beginning of the last occurrence of a substring in this string or the end of the string.
 
size_t find_end_of_last_or_all (str_piece pattern, size_t offset=-1) const noexcept
 Find the end of the last occurrence of a substring in this string, or the end of a string.
 
bool contains (str_piece pattern, size_t offset=0) const noexcept
 Whether the string contains the specified substring.
 
void for_all_finded (const Op &op, str_piece pattern, size_t offset=0, size_t maxCount=0) const
 Call a functor on all found occurrences of a substring in this string.
 
std::vector< size_t > find_all (str_piece pattern, size_t offset=0, size_t maxCount=0) const
 Find all occurrences of a substring in this string.
 
size_t find_first_of (str_piece pattern, size_t offset=0) const noexcept
 Find the first occurrence of a character from a given character set.
 
std::pair< size_t, size_t > find_first_of_idx (str_piece pattern, size_t offset=0) const noexcept
 Find the first occurrence of a character from a given character set.
 
size_t find_first_not_of (str_piece pattern, size_t offset=0) const noexcept
 Find the first occurrence of a character not from the given character set.
 
size_t find_last_of (str_piece pattern, size_t offset=str::npos) const noexcept
 Find the last occurrence of a character from a given character set.
 
std::pair< size_t, size_t > find_last_of_idx (str_piece pattern, size_t offset=str::npos) const noexcept
 Find the last occurrence of a character from a given character set.
 
size_t find_last_not_of (str_piece pattern, size_t offset=str::npos) const noexcept
 Find the last occurrence of a character not from the given character set.
 
my_type substr (ptrdiff_t from, ptrdiff_t len=0) const
 Get a substring. Works similarly to operator(), only the result is the same type as the method applied to.
 
my_type str_mid (size_t from, size_t len=-1) const
 Get part of a string with an object of the same type to which the method is applied, similar to mid.
 
as_int () const noexcept
 Convert a string to a number of the given type.
 
convert_result< T > to_int () const noexcept
 Convert a string to a number of the given type.
 
std::optional< double > to_double () const noexcept
 Convert string to double.
 
std::optional< double > to_double_hex () const noexcept
 Convert string in hex form to double.
 
void as_number (T &t) const
 Convert a string to an integer.
 
void as_number (double &t) const
 Convert string to double.
 
splitf (str_piece delimeter, const Op &beforeFunc, size_t offset=0) const
 Split a string into parts at a given delimiter, possibly applying a functor to each substring.
 
split (str_piece delimeter, size_t offset=0) const
 Split a string into substrings using a given delimiter.
 
Splitter< K > splitter (str_piece delimeter) const
 Retrieve a Splitter object by the given splitter, which allows sequential get substrings using the next() method while is_done() is false.
 
constexpr bool starts_with (str_piece prefix) const noexcept
 Whether the string begins with the given substring.
 
constexpr bool starts_with_ia (str_piece prefix) const noexcept
 Whether the string begins with the given substring in a case-insensitive ASCII character.
 
bool starts_with_iu (str_piece prefix) const noexcept
 Whether the string starts with the given substring, case-insensitive Unicode characters of the first plane (<0xFFFF).
 
constexpr bool prefix_in (str_piece text) const noexcept
 Whether this string is the beginning of another string.
 
constexpr bool ends_with (str_piece suffix) const noexcept
 Whether the string ends with the specified substring.
 
constexpr bool ends_with_ia (str_piece suffix) const noexcept
 Whether the string ends with the specified substring in a case-insensitive ASCII character.
 
constexpr bool ends_with_iu (str_piece suffix) const noexcept
 Whether the string ends with the specified substring, case-insensitive Unicode characters of the first plane (<0xFFFF).
 
bool is_ascii () const noexcept
 Whether the string contains only ASCII characters.
 
uppered_only_ascii () const
 Get a copy of the string in uppercase ASCII characters.
 
lowered_only_ascii () const
 Get a copy of the string in lowercase ASCII characters.
 
uppered () const
 Get a copy of the string in upper case Unicode characters of the first plane (<0xFFFF).
 
lowered () const
 Get a copy of the string in lowercase Unicode characters of the first plane (<0xFFFF).
 
replaced (str_piece pattern, str_piece repl, size_t offset=0, size_t maxCount=0) const
 Get a copy of the string with occurrences of substrings replaced.
 
expr_replaces< K, N - 1, L - 1 > replace_init (T &&pattern, M &&repl) const
 Get a string expression that produces a string with replaced substrings given by string literals.
 
trimmed () const
 Get a string with whitespace removed on the left and right.
 
trimmed (T &&pattern) const
 Get a string with the characters specified by the string literal removed from the left and right.
 
trimmed (str_piece pattern) const
 Get a string with characters specified by another string removed, left and right.
 
trimmed_left () const
 Get a string with whitespace removed on the left.
 
trimmed_left (T &&pattern) const
 Get a string with the characters specified by the string literal removed from the left.
 
trimmed_left (str_piece pattern) const
 Get a string with characters specified by another string removed from the left.
 
trimmed_right () const
 Get a string with whitespace removed on the right.
 
trimmed_right (T &&pattern) const
 Get a string with the characters specified by the string literal removed from the right.
 
trimmed_right (str_piece pattern) const
 Get a string with characters specified by another string removed to the right.
 
trimmed_with_spaces (T &&pattern) const
 Get a string with the characters specified by the string literal removed, as well as whitespace characters, left and right.
 
trimmed_with_spaces (str_piece pattern) const
 Get a string, removing characters specified by another string, as well as whitespace characters, left and right.
 
trimmed_left_with_spaces (T &&pattern) const
 Get a string with the characters specified by the string literal removed, as well as whitespace characters, left.
 
trimmed_left_with_spaces (str_piece pattern) const
 Get a string, removing characters specified by another string, as well as whitespace characters, left.
 
trimmed_right_with_spaces (T &&pattern) const
 Get a string with the characters specified by the string literal removed, as well as whitespace characters, right.
 
trimmed_right_with_spaces (str_piece pattern) const
 Get a string, removing characters specified by another string, as well as whitespace characters, right.
 
 operator K* () noexcept
 Get a pointer to the string buffer.
 
lstring< K, N, false, allocator_string > & trim ()
 Remove whitespace from the beginning and end of a line.
 
lstring< K, N, false, allocator_string > & trim (T &&pattern)
 Remove characters included in a string literal at the beginning and end of the line.
 
lstring< K, N, false, allocator_string > & trim (str_piece pattern)
 Remove characters included in the passed string at the beginning and end of the line.
 
lstring< K, N, false, allocator_string > & trim_left ()
 Remove whitespace at the beginning of a line.
 
lstring< K, N, false, allocator_string > & trim_left (T &&pattern)
 Remove characters included in a string literal at the beginning of the line.
 
lstring< K, N, false, allocator_string > & trim_left (str_piece pattern)
 Remove characters included in the passed string at the beginning of the line.
 
lstring< K, N, false, allocator_string > & trim_right ()
 Remove whitespace from the end of a line.
 
lstring< K, N, false, allocator_string > & trim_right (T &&pattern)
 Remove characters included in a string literal at the end of the line.
 
lstring< K, N, false, allocator_string > & trim_right (str_piece pattern)
 Remove characters included in the passed string from the end of the string.
 
lstring< K, N, false, allocator_string > & trim_with_spaces (T &&pattern)
 Remove characters included in a string literal, as well as whitespace, at the beginning and end of the string.
 
lstring< K, N, false, allocator_string > & trim_with_spaces (str_piece pattern)
 Remove characters included in the passed string, as well as whitespace characters, at the beginning and end of the string.
 
lstring< K, N, false, allocator_string > & trim_left_with_spaces (T &&pattern)
 Remove characters included in a string literal, as well as whitespace, at the beginning of a line.
 
lstring< K, N, false, allocator_string > & trim_left_with_spaces (str_piece pattern)
 Remove characters included in the passed string, as well as whitespace, at the beginning of the string.
 
lstring< K, N, false, allocator_string > & trim_right_with_wpaces (T &&pattern)
 Remove characters included in a string literal, as well as whitespace, at the end of a string.
 
lstring< K, N, false, allocator_string > & trim_right_with_spaces (str_piece pattern)
 Remove characters included in the passed string, as well as whitespace at the end of the string.
 
lstring< K, N, false, allocator_string > & upper_only_ascii ()
 Convert ASCII characters to uppercase.
 
lstring< K, N, false, allocator_string > & lower_only_ascii ()
 Convert ASCII characters to lowercase.
 
lstring< K, N, false, allocator_string > & upper ()
 Convert first plane characters (<0xFFFF) to uppercase Unicode.
 
lstring< K, N, false, allocator_string > & lower ()
 Convert first plane characters (<0xFFFF) to lowercase Unicode.
 
lstring< K, N, false, allocator_string > & append (str_piece other)
 Add another line to the end of the line.
 
lstring< K, N, false, allocator_string > & append (const A &expr)
 Add a string expression to the end of the line.
 
lstring< K, N, false, allocator_string > & operator+= (str_piece other)
 Add another line to the end of the line.
 
lstring< K, N, false, allocator_string > & operator+= (const A &expr)
 Add a string expression to the end of the line.
 
lstring< K, N, false, allocator_string > & append_in (size_t pos, str_piece other)
 Add another line starting at the given position.
 
lstring< K, N, false, allocator_string > & append_in (size_t pos, const A &expr)
 Add a string expression starting at the given position.
 
lstring< K, N, false, allocator_string > & change (size_t from, size_t len, str_piece other)
 Replace a piece of string with another string.
 
lstring< K, N, false, allocator_string > & change (size_t from, size_t len, const A &expr)
 Replace a piece of string with a string expression.
 
lstring< K, N, false, allocator_string > & insert (size_t to, str_piece other)
 Insert a line at the specified position.
 
lstring< K, N, false, allocator_string > & insert (size_t to, const A &expr)
 Insert a string expression at the specified position.
 
lstring< K, N, false, allocator_string > & remove (size_t from, size_t len)
 Remove part of a line.
 
lstring< K, N, false, allocator_string > & prepend (str_piece other)
 Add another line to the beginning of the line.
 
lstring< K, N, false, allocator_string > & prepend (const A &expr)
 Add a string expression to the beginning of a line.
 
lstring< K, N, false, allocator_string > & replace (str_piece pattern, str_piece repl, size_t offset=0, size_t maxCount=0)
 Replace occurrences of a substring with another string.
 
lstring< K, N, false, allocator_string > & replace_from (const From &f, str_piece pattern, str_piece repl, size_t offset=0, size_t maxCount=0)
 Copy the source string, replacing occurrences of substrings with another string.
 
lstring< K, N, false, allocator_string > & fill (size_t from, const Op &fillFunction)
 Fill a string buffer using a functor.
 
lstring< K, N, false, allocator_string > & operator<< (const Op &fillFunction)
 Fills a string with the fill method from position zero.
 
lstring< K, N, false, allocator_string > & operator<< (const Op &fillFunction)
 Calls the passed functor, passing a reference to itself.
 
lstring< K, N, false, allocator_string > & operator<<= (const Op &fillFunction)
 Fills a string with the fill method after the end of the string.
 
lstring< K, N, false, allocator_string > & printf_from (size_t from, const K *format, T &&... args)
 Appends sprintf formatted output starting at the specified position.
 
lstring< K, N, false, allocator_string > & printf (const K *format, T &&... args)
 Formats a string using sprintf.
 
lstring< K, N, false, allocator_string > & append_printf (const K *format, T &&... args)
 Appends sprintf formatted output to the end of the line.
 
lstring< K, N, false, allocator_string > & format_from (size_t from, const FmtString< K, T... > &format, T &&... args)
 Appends std::format-formatted output starting at the specified position.
 
lstring< K, N, false, allocator_string > & vformat_from (size_t from, size_t max_write, str_piece format, T &&... args)
 Appends std::vformat formatted output starting at the specified position.
 
lstring< K, N, false, allocator_string > & format (const FmtString< K, T... > &pattern, T &&... args)
 Formats a string using std::format.
 
lstring< K, N, false, allocator_string > & append_formatted (const FmtString< K, T... > &format, T &&... args)
 Appends std::format-formatted output to the end of the line.
 
lstring< K, N, false, allocator_string > & vformat (str_piece format, T &&... args)
 Formats a string using std::vformat.
 
lstring< K, N, false, allocator_string > & append_vformatted (str_piece format, T &&... args)
 Appends std::vformat-formatted output to the end of the line.
 
lstring< K, N, false, allocator_string > & vformat_n (size_t max_write, str_piece format, T &&... args)
 Formats a string using std::vformat up to the specified size.
 
lstring< K, N, false, allocator_string > & append_vformatted_n (size_t max_write, str_piece format, T &&... args)
 Appends std::vformat-formatted output to the end of the line, writing no more than the specified number of characters.
 
lstring< K, N, false, allocator_string > & with (const Op &fillFunction, Args &&... args)
 Call a functor with a string and passed arguments.
 
 operator const K * () const noexcept
 Conversion operator to a null-terminated C string.
 
s_str_nt to_nts (size_t from=0) const
 Get simple_str_nt starting at the given character.
 
 operator s_str_nt () const
 Convert to simple_str_nt.
 

Static Public Member Functions

static my_type join (const T &strings, s_str delimeter, bool tail=false, bool skip_empty=false, Args &&... args)
 Concatenate strings from the container into one string.
 
static my_type uppered_only_ascii_from (const From &f, Args &&... args)
 Create a string copy of the passed in uppercase ASCII characters.
 
static my_type lowered_only_ascii_from (const From &f, Args &&... args)
 Create a copy of the passed string in lowercase ASCII characters.
 
static my_type uppered_from (const From &f, Args &&... args)
 Create a copy of the passed string in uppercase Unicode characters of the first plane (<0xFFFF).
 
static my_type lowered_from (const From &f, Args &&... args)
 Create a copy of the passed string in lowercase Unicode characters of the first plane (<0xFFFF).
 
static my_type replaced_from (const From &f, s_str pattern, s_str repl, size_t offset=0, size_t maxCount=0, Args &&... args)
 Create a copy of the passed string with substrings replaced.
 

Protected Member Functions

allocator_t & allocator ()
 Get the allocator.
 

Detailed Description

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
class simstr::lstring< K, N, forShared, Allocator >

The mutable, owning string class. Contains an internal buffer for text of a given size.

Template Parameters
K- symbol type.
N- the size of the internal string buffer is at least N.
forShared- allocate an external buffer in a format compatible with sstring.
Allocator- allocator type.

"Local" string. Stores a pointer to characters and the length of the string, followed by either the data itself up to N characters + zero, or if the data is longer than N, then the size of the allocated buffer. At the same time, if you plan to later move the result to sstring, then for a dynamic buffer +n bytes are allocated so as not to copy the data later.

Member Enumeration Documentation

◆ anonymous enum

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
anonymous enum : size_t
Enumerator
LocalCapacity 

Size of internal buffer.

Constructor & Destructor Documentation

◆ lstring() [1/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
simstr::lstring< K, N, forShared, Allocator >::lstring ( const my_type & other)
inline

Copy from another string of the same type.

Parameters
other- another string.

◆ lstring() [2/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
template<typename... Args>
requires (sizeof...(Args) > 0 && std::is_convertible_v<allocator_t, Args...>)
simstr::lstring< K, N, forShared, Allocator >::lstring ( const my_type & other,
Args &&... args )
inline

Copy from another string of the same type, but with a different allocator.

Parameters
other- another string.
...args- parameters for initializing the allocator.

◆ lstring() [3/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
template<typename T, size_t I = const_lit_for<K, T>::Count, typename... Args>
requires std::is_constructible_v<allocator_t, Args...>
simstr::lstring< K, N, forShared, Allocator >::lstring ( T && value,
Args &&... args )
inlineconstexpr

String literal constructor.

Parameters
value- string literal.
...args- parameter for initialization allocator.

◆ lstring() [4/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
simstr::lstring< K, N, forShared, Allocator >::lstring ( my_type && other)
inlinenoexcept

Constructor for moving from a string of the same type.

Parameters
other- another string.

◆ lstring() [5/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
template<typename Op, typename... Args>
requires (std::is_constructible_v<Allocator, Args...> && (std::is_invocable_v<Op, my_type&> || std::is_invocable_v<Op, K*, size_t>))
simstr::lstring< K, N, forShared, Allocator >::lstring ( const Op & op,
Args &&... args )
inline

A fill constructor using a functor (see str_mutable::fill).

Parameters
op- filling functions.
...args- parameters for initializing the allocator.

Member Function Documentation

◆ append() [1/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::append ( const A & expr)
inlineinherited

Add a string expression to the end of the line.

Parameters
expr- string expression.
Returns
Impl& - a reference to yourself.

◆ append() [2/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::append ( str_piece other)
inlineinherited

Add another line to the end of the line.

Parameters
other- another string.
Returns
Impl& - a reference to yourself.

◆ append_formatted()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::append_formatted ( const FmtString< K, T... > & format,
T &&... args )
inlineinherited

Appends std::format-formatted output to the end of the line.

Parameters
format- format string, constant.
...args- arguments for std::format.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ append_in() [1/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::append_in ( size_t pos,
const A & expr )
inlineinherited

Add a string expression starting at the given position.

Parameters
pos- the position from which to add. First, the string is shortened to the specified value size, and then a string expression is added.
expr- string expression.
Returns
Impl& - a reference to yourself.

If the string is longer than pos, then it is shortened to this size, and then expr is added.

◆ append_in() [2/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::append_in ( size_t pos,
str_piece other )
inlineinherited

Add another line starting at the given position.

Parameters
pos- the position from which to add. First, the string is shortened to the specified value size, and then another line is added.
other- another string.
Returns
Impl& - a reference to yourself.

If the string is longer than pos, then it is shortened to this size, and then other is added.

◆ append_printf()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::append_printf ( const K * format,
T &&... args )
inlineinherited

Appends sprintf formatted output to the end of the line.

Parameters
format- format string.
...args- arguments for sprintf.
Returns
Impl& - a reference to yourself.

Automatically increases the row buffer size if necessary.

◆ append_vformatted()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::append_vformatted ( str_piece format,
T &&... args )
inlineinherited

Appends std::vformat-formatted output to the end of the line.

Parameters
format- format string.
...- arguments for std::vformat.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ append_vformatted_n()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::append_vformatted_n ( size_t max_write,
str_piece format,
T &&... args )
inlineinherited

Appends std::vformat-formatted output to the end of the line, writing no more than the specified number of characters.

Parameters
max_write- the maximum number of characters to write.
format- format string.
...args- arguments for std::vformat.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ as_int()

T simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::as_int ( ) const
inlinenoexceptinherited

Convert a string to a number of the given type.

Template Parameters
T- the desired number type.
CheckOverflow- check for overflow.
Base- the base of the number, from -1 to 36, except 1.
  • If 0: then tries to determine the base by the prefix 0[xX] as 16, 0 as 8, otherwise 10.
  • If -1: then tries to determine the base by prefixes:
    • 0 or 0[oO]: 8
    • 0[bB]: 2
    • 0[xX]: 16
  • in other cases 10.
SkipWs- skip whitespace characters at the beginning of the line.
AllowSign- whether the '+' sign is allowed before a number.
Returns
T - a number, the result of the transformation, how much it turned out, or 0 if it overflows.

◆ as_number() [1/2]

void simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::as_number ( double & t) const
inlineinherited

Convert string to double.

Parameters
t- the variable into which the result is written.

◆ as_number() [2/2]

void simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::as_number ( T & t) const
inlineinherited

Convert a string to an integer.

Template Parameters
T- number type, inferred from the argument.
Parameters
t- the variable into which the result is written.

◆ at()

K simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::at ( ptrdiff_t idx) const
inlineinherited

Get the character at the given position.

Parameters
idx- symbol index. For negative values, it is counted from the end of the line.
Returns
K - character.

Does not check for line boundaries.

◆ change() [1/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::change ( size_t from,
size_t len,
const A & expr )
inlineinherited

Replace a piece of string with a string expression.

Parameters
from- starting position for replacement.
len- length of the part to be replaced.
expr- string expression.
Returns
Impl& - a reference to yourself.

◆ change() [2/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::change ( size_t from,
size_t len,
str_piece other )
inlineinherited

Replace a piece of string with another string.

Parameters
from- starting position for replacement.
len- length of the part to be replaced.
other- the string this part is changed to.
Returns
Impl& - a reference to yourself.

◆ compare()

int simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::compare ( str_piece o) const
inlineconstexprinherited

Compare strings character by character.

Parameters
o- another line.
Returns
<0 this string is less, ==0 - strings are equal, >0 - this string is greater.

◆ compare_ia()

int simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::compare_ia ( str_piece text) const
inlinenoexceptinherited

Compare strings character by character and not case sensitive ASCII characters.

Parameters
text- another line.
Returns
<0 this string is less, ==0 - strings are equal, >0 - this string is greater.

◆ compare_iu()

int simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::compare_iu ( str_piece text) const
inlinenoexceptinherited

Compare strings character by character without taking into account the case of Unicode characters of the first plane (<0xFFFF).

Parameters
text- another line.
Returns
<0 this string is less, ==0 - strings are equal, >0 - this string is greater.

◆ contains()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::contains ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexceptinherited

Whether the string contains the specified substring.

Parameters
pattern- the search string.
offset- from which position to start the search.
Returns
bool.

◆ copy_to()

void simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::copy_to ( K * buffer,
size_t bufSize )
inlineinherited

Copy the string to the specified buffer.

The method adds \0 after the copied characters. Does not exceed buffer boundaries.

Parameters
buffer- pointer to buffer
bufSize- buffer size in characters.

◆ ends_with()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::ends_with ( str_piece suffix) const
inlineconstexprnoexceptinherited

Whether the string ends with the specified substring.

Parameters
suffix- substring.

◆ ends_with_ia()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::ends_with_ia ( str_piece suffix) const
inlineconstexprnoexceptinherited

Whether the string ends with the specified substring in a case-insensitive ASCII character.

Parameters
suffix- substring.

◆ ends_with_iu()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::ends_with_iu ( str_piece suffix) const
inlineconstexprnoexceptinherited

Whether the string ends with the specified substring, case-insensitive Unicode characters of the first plane (<0xFFFF).

Parameters
suffix- substring.

◆ equal()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::equal ( str_piece other) const
inlineconstexprnoexceptinherited

String comparison for equality.

Parameters
other- another line.
Returns
whether the strings are equal.

◆ equal_ia()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::equal_ia ( str_piece text) const
inlinenoexceptinherited

Whether a string is equal to another string, character-by-character-insensitive, of ASCII characters.

Parameters
text- another line.
Returns
whether the strings are equal.

◆ equal_iu()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::equal_iu ( str_piece text) const
inlinenoexceptinherited

Whether a string is equal to another string, character-by-character-insensitive, of the Unicode characters of the first plane (<0xFFFF).

Parameters
text- another line.
Returns
whether the strings are equal.

◆ fill()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::fill ( size_t from,
const Op & fillFunction )
inlineinherited

Fill a string buffer using a functor.

Parameters
from- starting position to fill.
fillFunction- size_t(K*, size_t) functor that receives the address of the string buffer and its capacity, returning the required string size.
Returns
Impl& - a reference to yourself.

The function calls the functor, passing it the address of the string buffer and its capacity. The functor can modify the buffer within the allocated capacity, and must return the size of the resulting string. As long as the returned size is larger than capacity (i.e. the string cannot fit into the buffer), memory of at least the returned size is allocated and the functor is called again. Until the returned size fits into the string buffer. This size becomes the length of the line.

◆ find() [1/2]

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find ( K s,
size_t offset = 0 ) const
inlinenoexceptinherited

Find a character in this string.

Parameters
sis an optional character.
offset- from which position to start the search.
Returns
size_t - position of the found character, or -1 if not found.

◆ find() [2/2]

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexceptinherited

Find the beginning of the first occurrence of a substring in this string.

Parameters
pattern- the search string.
offset- from which position to start the search.
Returns
size_t - the position of the beginning of the occurrence of the substring, or -1 if not found.

◆ find_all()

std::vector< size_t > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_all ( str_piece pattern,
size_t offset = 0,
size_t maxCount = 0 ) const
inlineinherited

Find all occurrences of a substring in this string.

Parameters
pattern- the substring to search for.
offset- search start position.
maxCount- the maximum number of occurrences to be processed, 0 - no restrictions.
Returns
std::vector<size_t> - a vector with the positions of the beginnings of the found occurrences.

◆ find_end()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_end ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexceptinherited

Find the end of the occurrence of a substring in this string.

Parameters
pattern- the search string.
offset- from which position to start the search.
Returns
size_t - the position immediately after the occurrence of the substring, or -1 if not found.

◆ find_end_of_last()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_end_of_last ( str_piece pattern,
size_t offset = -1 ) const
inlinenoexceptinherited

Find the end of the last occurrence of a substring in this string.

Parameters
pattern- the search string.
offset- from which position to search in the opposite direction, -1 - from the very end.
Returns
size_t - the position immediately after the last occurrence of the substring, or -1 if not found.

◆ find_end_of_last_or_all()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_end_of_last_or_all ( str_piece pattern,
size_t offset = -1 ) const
inlinenoexceptinherited

Find the end of the last occurrence of a substring in this string, or the end of a string.

Parameters
pattern- the search string.
offset- from which position to search in the opposite direction, -1 - from the very end.
Returns
size_t - the position immediately after the last occurrence of the substring, or the length of the string if not found.

◆ find_end_or_all()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_end_or_all ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexceptinherited

Find the end of the first occurrence of a substring in this string, or the end of a string.

Parameters
pattern- the search string.
offset- from which position to start the search.
Returns
size_t - the position immediately after the occurrence of the substring, or the length of the string if not found.

◆ find_first_not_of()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_first_not_of ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexceptinherited

Find the first occurrence of a character not from the given character set.

Parameters
pattern- a string specifying the character set.
offset- search start position.
Returns
size_t - position of the found occurrence, or -1 if not found.

◆ find_first_of()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_first_of ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexceptinherited

Find the first occurrence of a character from a given character set.

Parameters
pattern- a string specifying the set of characters to search for.
offset- search start position.
Returns
size_t - position of the found occurrence, or -1 if not found.

◆ find_first_of_idx()

std::pair< size_t, size_t > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_first_of_idx ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexceptinherited

Find the first occurrence of a character from a given character set.

Parameters
pattern- a string specifying the set of characters to search for.
offset- search start position.
Returns
std::pair<size_t, size_t> - a pair from the position of the found occurrence and the number of the found character in the set, or -1 if not found.

◆ find_last() [1/2]

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_last ( K s,
size_t offset = -1 ) const
inlinenoexceptinherited

Find the last occurrence of a character in this string.

Parameters
sis an optional character.
offset- from which position to search in the opposite direction, -1 - from the very end.
Returns
size_t - position of the found character, or -1 if not found.

◆ find_last() [2/2]

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_last ( str_piece pattern,
size_t offset = -1 ) const
inlinenoexceptinherited

Find the beginning of the last occurrence of a substring in this string.

Parameters
pattern- the search string.
offset- from which position to search in the opposite direction, -1 - from the very end.
Returns
size_t - the position of the beginning of the occurrence of the substring, or -1 if not found.

◆ find_last_not_of()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_last_not_of ( str_piece pattern,
size_t offset = str::npos ) const
inlinenoexceptinherited

Find the last occurrence of a character not from the given character set.

Parameters
pattern- a string specifying the character set.
offset- search start position.
Returns
size_t - position of the found occurrence, or -1 if not found.

◆ find_last_of()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_last_of ( str_piece pattern,
size_t offset = str::npos ) const
inlinenoexceptinherited

Find the last occurrence of a character from a given character set.

Parameters
pattern- a string specifying the set of characters to search for.
offset- search start position.
Returns
size_t - position of the found occurrence, or -1 if not found.

◆ find_last_of_idx()

std::pair< size_t, size_t > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_last_of_idx ( str_piece pattern,
size_t offset = str::npos ) const
inlinenoexceptinherited

Find the last occurrence of a character from a given character set.

Parameters
pattern- a string specifying the set of characters to search for.
offset- search start position.
Returns
std::pair<size_t, size_t> - a pair from the position of the found occurrence and the number of the found character in the set, or -1 if not found.

◆ find_last_or_all()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_last_or_all ( str_piece pattern,
size_t offset = -1 ) const
inlinenoexceptinherited

Find the beginning of the last occurrence of a substring in this string or the end of the string.

Parameters
pattern- the search string.
offset- from which position to search in the opposite direction, -1 - from the very end.
Returns
size_t - the position at which the substring begins, or the length of the string if not found.

◆ find_or_all() [1/2]

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_or_all ( K s,
size_t offset = 0 ) const
inlinenoexceptinherited

Find a character in this string or the end of a string.

Parameters
sis an optional character.
offset- from which position to start the search.
Returns
size_t - position of the found character, or string length if not found.

◆ find_or_all() [2/2]

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_or_all ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexceptinherited

Find the beginning of the first occurrence of a substring in this string or the end of the string.

Parameters
pattern- the search string.
offset- from which position to start the search.
Returns
size_t - the position at which the substring begins, or the length of the string if not found.

◆ find_or_throw()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::find_or_throw ( str_piece pattern,
size_t offset = 0,
Args &&... args ) const
inlinenoexceptinherited

Find the beginning of the first occurrence of a substring in this string or throw an exception.

Template Parameters
Exc- exception type.
Args...- types of parameters for constructing an exception, inferred from the arguments.
Parameters
pattern- the search string.
offset- from which position to start the search.
args- arguments for the exception constructor.
Returns
size_t - the position of the beginning of the substring occurrence, or throws an Exc exception if not found.

◆ for_all_finded()

void simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::for_all_finded ( const Op & op,
str_piece pattern,
size_t offset = 0,
size_t maxCount = 0 ) const
inlineinherited

Call a functor on all found occurrences of a substring in this string.

Parameters
opis a functor that takes a string.
pattern- the substring to search for.
offset- search start position.
maxCount- the maximum number of occurrences to be processed, 0 - no restrictions.

◆ format()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::format ( const FmtString< K, T... > & pattern,
T &&... args )
inlineinherited

Formats a string using std::format.

Parameters
pattern- format string, constant.
...args- arguments for std::format.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ format_from()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::format_from ( size_t from,
const FmtString< K, T... > & format,
T &&... args )
inlineinherited

Appends std::format-formatted output starting at the specified position.

Parameters
from- starting position of adding.
format- format string, constant.
...args- arguments for std::format.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ from_to()

str_piece simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::from_to ( size_t from,
size_t to ) const
inlineconstexprnoexceptinherited

Get the substring simple_str from position from to position to (not including it).

For performance reasons, the method does not check for line boundaries in any way, use in scenarios when you know for sure that these are positions inside the line and to >= from.

Parameters
from- starting position.
to- final position (not included in the result).
Returns
Substring, simple_str.

◆ insert() [1/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::insert ( size_t to,
const A & expr )
inlineinherited

Insert a string expression at the specified position.

Parameters
to- insertion position.
expr- string expression.
Returns
Impl& - a reference to yourself.

◆ insert() [2/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::insert ( size_t to,
str_piece other )
inlineinherited

Insert a line at the specified position.

Parameters
to- insertion position.
other- the string to be inserted.
Returns
Impl& - a reference to yourself.

◆ join()

static my_type simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string >::join ( const T & strings,
s_str delimeter,
bool tail = false,
bool skip_empty = false,
Args &&... args )
inlinestaticinherited

Concatenate strings from the container into one string.

Parameters
strings- container with strings.
delimeter- delimiter added between lines.
tail- add a separator after the last line.
skip_empty- skip empty lines without adding a separator.
...args- parameters for initializing the allocator.

The function is used to merge a container of strings into one delimited string.

std::vector<ssa> strings = get_strings();
ssa delim = get_current_delimeter();
auto line = lstringa<200>::join(strings, delimeter);
static my_type join(const T &strings, s_str delimeter, bool tail=false, bool skip_empty=false, Args &&... args)
Definition sstring.h:3180

It is worth noting that if the separator is known in advance, it is better to use the string expression e_join.

std::vector<ssa> strings = get_strings();
lstringa<200> line{e_join(strings, "/")};
constexpr auto e_join(const T &s, L &&d)
Get a string expression concatenating the strings in the container into a single string with the give...
Definition sstring.h:5867

In this case, the compiler can better optimize the string merging code.

◆ less_ia()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::less_ia ( str_piece text) const
inlinenoexceptinherited

Whether a string is smaller than another string, character-by-character-insensitive, ASCII characters.

Parameters
text- another line.
Returns
whether the string is smaller.

◆ less_iu()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::less_iu ( str_piece text) const
inlinenoexceptinherited

Whether a string is smaller than another string, character-by-character-insensitive, of the Unicode characters of the first plane (<0xFFFF).

Parameters
text- another line.
Returns
whether the string is smaller.

◆ lower()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::lower ( )
inlineinherited

Convert first plane characters (<0xFFFF) to lowercase Unicode.

Case is changed by simplified tables, where one code_point is always changed to one code_point (but for UTF-8 it is possible that the length in code units will change).

Returns
Impl& - a reference to yourself.

◆ lower_only_ascii()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::lower_only_ascii ( )
inlineinherited

Convert ASCII characters to lowercase.

Returns
Impl& - a reference to yourself.

◆ lowered()

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::lowered ( ) const
inlineinherited

Get a copy of the string in lowercase Unicode characters of the first plane (<0xFFFF).

Template Parameters
R- the desired string type, by default the same whose method was called.
Returns
R - lowercase copy of the string.

◆ lowered_from()

static my_type simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string >::lowered_from ( const From & f,
Args &&... args )
inlinestaticinherited

Create a copy of the passed string in lowercase Unicode characters of the first plane (<0xFFFF).

Parameters
f- source string.
...args- parameters for initializing the allocator.

Case is changed by simplified tables, where one code_point is always changed to one code_point (but for UTF-8 it is possible that the length in code units will change).

◆ lowered_only_ascii()

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::lowered_only_ascii ( ) const
inlineinherited

Get a copy of the string in lowercase ASCII characters.

Template Parameters
R- the desired string type, by default the same whose method was called.
Returns
R - lowercase copy of the string.

◆ lowered_only_ascii_from()

static my_type simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string >::lowered_only_ascii_from ( const From & f,
Args &&... args )
inlinestaticinherited

Create a copy of the passed string in lowercase ASCII characters.

Parameters
f- source string.
...args- parameters for initializing the allocator.

◆ mid()

str_piece simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::mid ( size_t from,
size_t len = -1 ) const
inlineconstexprnoexceptinherited

Get part of a string as "string chunk".

Parameters
from- number of characters from the beginning of the line. If the string size is exceeded, it will return an empty string.
len- the number of characters in the resulting "chunk". When going beyond the line, it will return everything up to the end of the line.
Returns
Substring, simple_str.

◆ operator const K *()

simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string >::operator const K * ( ) const
inlinenoexceptinherited

Conversion operator to a null-terminated C string.

Returns
const K* - pointer to the beginning of the line.

◆ operator K*()

simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::operator K* ( )
inlineexplicitnoexceptinherited

Get a pointer to the string buffer.

Returns
K* - pointer to the string buffer.

◆ operator s_str_nt()

simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string >::operator s_str_nt ( ) const
inlineinherited

Convert to simple_str_nt.

Returns
simple_str_nt.

◆ operator str_piece()

simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::operator str_piece ( ) const
inlineconstexprnoexceptinherited

Convert itself to a "string chunk" that includes the entire string.

Returns
str_piece.

◆ operator()()

str_piece simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::operator() ( ptrdiff_t from,
ptrdiff_t len = 0 ) const
inlineconstexprnoexceptinherited

Get part of a string as "simple_str".

Parameters
from- number of characters from the beginning of the line.
len- the number of characters in the resulting "chunk".
Returns
Substring, simple_str.

If from is less than zero, then -from characters are counted from the end of the line towards the beginning. If len is less than or equal to zero, then count -len characters from the end of the line

"0123456789"_ss(5, 2) == "56";
"0123456789"_ss(5) == "56789";
"0123456789"_ss(5, -1) == "5678";
"0123456789"_ss(-3) == "789";
"0123456789"_ss(-3, 2) == "78";
"0123456789"_ss(-4, -1) == "678";

◆ operator+=() [1/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::operator+= ( const A & expr)
inlineinherited

Add a string expression to the end of the line.

Parameters
expr- string expression.
Returns
Impl& - a reference to yourself.

◆ operator+=() [2/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::operator+= ( str_piece other)
inlineinherited

Add another line to the end of the line.

Parameters
other- another line.
Returns
Impl& - a reference to yourself.

◆ operator<<() [1/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::operator<< ( const Op & fillFunction)
inlineinherited

Fills a string with the fill method from position zero.

Parameters
fillFunction- string filling functor, size_t(K*, size_t).
Returns
Impl& - a reference to yourself.

◆ operator<<() [2/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::operator<< ( const Op & fillFunction)
inlineinherited

Calls the passed functor, passing a reference to itself.

Parameters
fillFunction- фуктор void(my_type&).
Returns
Impl& - a reference to yourself.

◆ operator<<=()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::operator<<= ( const Op & fillFunction)
inlineinherited

Fills a string with the fill method after the end of the string.

Parameters
fillFunction- string filling functor, size_t(K*, size_t).
Returns
Impl& - a reference to yourself.

◆ operator<=>() [1/2]

auto simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::operator<=> ( const base & other) const
inlineconstexprnoexceptinherited

String comparison operator.

Parameters
other- another line.

◆ operator<=>() [2/2]

auto simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::operator<=> ( T && other) const
inlinenoexceptinherited

Comparison operator between a string and a string literal.

Parameters
otheris a string literal.

◆ operator=() [1/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
my_type & simstr::lstring< K, N, forShared, Allocator >::operator= ( const my_type & other)
inline

Copy assignment operator from a string of the same type.

Parameters
other- another string.
Returns
my_type& - a reference to yourself.

◆ operator=() [2/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
my_type & simstr::lstring< K, N, forShared, Allocator >::operator= ( const StrExprForType< K > auto & expr)
inline

String expression appending operator.

Parameters
expr- a string expression materialized into the string buffer.
Returns
my_type& - a reference to yourself.

If anything in a string expression refers to parts of the same string, then the result is undefined.

◆ operator=() [3/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
my_type & simstr::lstring< K, N, forShared, Allocator >::operator= ( my_type && other)
inlinenoexcept

Assignment operator by moving from a string of the same type.

Parameters
other- another string.
Returns
my_type& - a reference to yourself.

◆ operator=() [4/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
my_type & simstr::lstring< K, N, forShared, Allocator >::operator= ( simple_str< K > other)
inline

Assignment operator from simple_str.

Parameters
other- another string.
Returns
my_type& - a reference to yourself.

◆ operator=() [5/5]

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
template<typename T, size_t S = const_lit_for<K, T>::Count>
my_type & simstr::lstring< K, N, forShared, Allocator >::operator= ( T && other)
inline

String literal assignment operator.

Parameters
other- string literal, copied to the string buffer.
Returns
my_type& - a reference to yourself.

◆ operator==() [1/2]

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::operator== ( const base & other) const
inlineconstexprnoexceptinherited

Operator comparing strings for equality.

Parameters
other- another line.
Returns
whether the strings are equal.

◆ operator==() [2/2]

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::operator== ( T && other) const
inlinenoexceptinherited

Operator for comparing a string and a string literal for equality.

Parameters
other- string literal.

◆ place()

K * simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::place ( K * ptr) const
inlineconstexprnoexceptinherited

Copy the string to the specified buffer.

The method assumes that the size of the allocated buffer is sufficient for the entire line, i.e. length() was previously requested. Does not add \0.

Parameters
ptr- pointer to the buffer.
Returns
pointer to the character after the end of the symbols placed in the buffer.

◆ prefix_in()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::prefix_in ( str_piece text) const
inlineconstexprnoexceptinherited

Whether this string is the beginning of another string.

Parameters
text- another string.

◆ prepend() [1/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::prepend ( const A & expr)
inlineinherited

Add a string expression to the beginning of a line.

Parameters
expr- string expression.
Returns
Impl& - a reference to yourself.

◆ prepend() [2/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::prepend ( str_piece other)
inlineinherited

Add another line to the beginning of the line.

Parameters
other- another string.
Returns
Impl& - a reference to yourself.

◆ printf()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::printf ( const K * format,
T &&... args )
inlineinherited

Formats a string using sprintf.

Parameters
format- format string.
...args- arguments for sprintf.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ printf_from()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::printf_from ( size_t from,
const K * format,
T &&... args )
inlineinherited

Appends sprintf formatted output starting at the specified position.

Parameters
from- starting position of adding.
format- format string.
...args- arguments for sprintf.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ remove()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::remove ( size_t from,
size_t len )
inlineinherited

Remove part of a line.

Parameters
from- the position from which to delete.
len- length of the part to be deleted.
Returns
Impl& - a reference to yourself.

◆ replace()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::replace ( str_piece pattern,
str_piece repl,
size_t offset = 0,
size_t maxCount = 0 )
inlineinherited

Replace occurrences of a substring with another string.

Parameters
pattern- the substring to search for.
repl- replacement string.
offset- the starting position for the search.
maxCount- maximum number of replacements, 0 - no restrictions.
Returns
Impl& - a reference to yourself.

◆ replace_from()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::replace_from ( const From & f,
str_piece pattern,
str_piece repl,
size_t offset = 0,
size_t maxCount = 0 )
inlineinherited

Copy the source string, replacing occurrences of substrings with another string.

Parameters
f- source string.
pattern- the substring to search for.
repl- replacement string.
offset- the starting position for the search.
maxCount- maximum number of replacements, 0 - no restrictions.
Returns
Impl& - a reference to yourself.

◆ replace_init()

expr_replaces< K, N - 1, L - 1 > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::replace_init ( T && pattern,
M && repl ) const
inlineinherited

Get a string expression that produces a string with replaced substrings given by string literals.

Parameters
pattern- string literal, substring to be changed.
repl- string literal, substring to change to.
Returns
a string expression that replaces substrings.

◆ replaced()

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::replaced ( str_piece pattern,
str_piece repl,
size_t offset = 0,
size_t maxCount = 0 ) const
inlineinherited

Get a copy of the string with occurrences of substrings replaced.

Template Parameters
R- the desired string type, by default the same whose method was called.
Parameters
pattern- the substring to search for.
repl- the string to replace with.
offset- starting position of the search.
maxCount- maximum number of replacements, 0 - no restrictions.
Returns
R a string of the given type, by default the same whose method was called.

◆ replaced_from()

static my_type simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string >::replaced_from ( const From & f,
s_str pattern,
s_str repl,
size_t offset = 0,
size_t maxCount = 0,
Args &&... args )
inlinestaticinherited

Create a copy of the passed string with substrings replaced.

Parameters
f- source string.
pattern- substring to be replaced.
repl- the string to be replaced with.
offset- starting position for searching substrings.
maxCount- maximum number of replacements, 0 - no restrictions.
...args- parameters for initializing the allocator.

◆ reserve()

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
K * simstr::lstring< K, N, forShared, Allocator >::reserve ( size_t newSize)
inline

Allocate a buffer large enough to hold newSize characters plus a terminating null.

Parameters
newSize- new string size.
Returns
K* - pointer to the buffer.

The contents of the string are preserved. When increasing the buffer, the size allocated is no larger than the requested one. The string size is set to newSize.

◆ reserve_no_preserve()

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
K * simstr::lstring< K, N, forShared, Allocator >::reserve_no_preserve ( size_t newSize)
inline

Allocate a buffer large enough to hold newSize characters plus a terminating null.

Parameters
newSize- new string size.
Returns
K* - pointer to the buffer.

The contents of the buffer are undefined and the old contents are not guaranteed to be retained. The string size is set to newSize.

◆ set_size()

template<typename K, size_t N, bool forShared = false, Allocatorable Allocator = allocator_string>
K * simstr::lstring< K, N, forShared, Allocator >::set_size ( size_t newSize)
inline

Sets the size of the current string, allocating space if necessary.

Parameters
newSize- new string size.
Returns
K* - pointer to the buffer.

The contents of the string are preserved. When increasing the buffer size, at least 2 times the old buffer size are allocated. The string size is set to newSize.

◆ size()

size_t simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::size ( ) const
inlineinherited

The size of the string in characters.

Returns
size_t

◆ split()

T simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::split ( str_piece delimeter,
size_t offset = 0 ) const
inlineinherited

Split a string into substrings using a given delimiter.

Template Parameters
T- container type for the result.
Parameters
delimeter- delimiter.
offset- the position to start searching for the separator.
Returns
T - container with the result.

◆ splitf()

T simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::splitf ( str_piece delimeter,
const Op & beforeFunc,
size_t offset = 0 ) const
inlineinherited

Split a string into parts at a given delimiter, possibly applying a functor to each substring.

Template Parameters
T- type of container for folding substrings.
Parameters
delimeter- substring delimiter.
beforeFunc- a functor to apply to the found substrings, before placing them in the result.
offset- the position to start searching for the separator.
Returns
T - result.

For each substring found, if the functor can accept it, the functor is called, and the substring is assigned to the result of the functor. Next, the substring tries to be added to the result, calling one of its methods - emplace_back, push_back, operator[]. If none of this method no, nothing is done, just calling the functor. operator[] tries to apply if the result can have a size via std::size and we do not exceed this size. At the same time, if the found substring turns out to match the entire string, the result is attempted place not a substring, but the entire string object, which allows, for example, to effectively copy sstring.

◆ splitter()

Splitter< K > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::splitter ( str_piece delimeter) const
inherited

Retrieve a Splitter object by the given splitter, which allows sequential get substrings using the next() method while is_done() is false.

Parameters
delimeter- delimiter.
Returns
Splitter<K>.

◆ starts_with()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::starts_with ( str_piece prefix) const
inlineconstexprnoexceptinherited

Whether the string begins with the given substring.

Parameters
prefix- substring.

◆ starts_with_ia()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::starts_with_ia ( str_piece prefix) const
inlineconstexprnoexceptinherited

Whether the string begins with the given substring in a case-insensitive ASCII character.

Parameters
prefix- substring.

◆ starts_with_iu()

bool simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::starts_with_iu ( str_piece prefix) const
inlinenoexceptinherited

Whether the string starts with the given substring, case-insensitive Unicode characters of the first plane (<0xFFFF).

Parameters
prefix- substring.

◆ str_mid()

my_type simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::str_mid ( size_t from,
size_t len = -1 ) const
inlineinherited

Get part of a string with an object of the same type to which the method is applied, similar to mid.

Parameters
from- number of characters from the beginning of the line. If the string size is exceeded, it will return an empty string.
len- the number of characters in the resulting "chunk". When going beyond the line, it will return everything up to the end of the line.
Returns
A string of the same type to which the method is applied.

◆ strcmp()

int simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::strcmp ( const K * text) const
inlineconstexprinherited

Compare with C-string character by character.

Parameters
text- another line.
Returns
<0 this string is less, ==0 - strings are equal, >0 - this string is greater.

◆ substr()

my_type simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::substr ( ptrdiff_t from,
ptrdiff_t len = 0 ) const
inlineinherited

Get a substring. Works similarly to operator(), only the result is the same type as the method applied to.

Parameters
from- number of characters from the beginning of the line. If less than zero, it is counted from the end of the line towards the beginning.
len- the number of characters in the resulting "chunk". If less than or equal to zero, then count len ​​characters from the end of the line.
Returns
my_type - a substring, an object of the same type to which the method is applied.

◆ to_double()

std::optional< double > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::to_double ( ) const
inlinenoexceptinherited

Convert string to double.

Returns
std::optional<double>.

◆ to_double_hex()

std::optional< double > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::to_double_hex ( ) const
inlinenoexceptinherited

Convert string in hex form to double.

Returns
std::optional<double>.

◆ to_int()

convert_result< T > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::to_int ( ) const
inlinenoexceptinherited

Convert a string to a number of the given type.

Template Parameters
T- the desired number type.
CheckOverflow- check for overflow.
Base- the base of the number, from -1 to 36, except 1.
  • If 0: then tries to determine the base by the prefix 0[xX] as 16, 0 as 8, otherwise 10
  • If -1: then tries to determine the base by prefixes:
    • 0 or 0[oO]: 8
    • 0[bB]: 2
    • 0[xX]: 16
  • in other cases 10.
SkipWs- skip whitespace characters at the beginning of the line. All characters with ASCII codes <= 32 are skipped.
AllowSign- whether the '+' sign is allowed before a number.
Returns
convert_result<T> - a tuple of the received number, the success of the conversion and the number of characters processed.

◆ to_nts()

s_str_nt simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string >::to_nts ( size_t from = 0) const
inlineinherited

Get simple_str_nt starting at the given character.

Parameters
from- position of the starting character, default 0.
Returns
simple_str_nt,

◆ to_str()

str_piece simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::to_str ( ) const
inlinenoexceptinherited

Convert itself to a "string chunk" that includes the entire string.

Returns
str_piece.

◆ to_string()

std::basic_string< K > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::to_string ( ) const
inlinenoexceptinherited

Convert to std::string.

Returns
std::basic_string<K>.

◆ to_sv()

std::basic_string_view< K > simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::to_sv ( ) const
inlinenoexceptinherited

Convert to std::string_view.

Returns
std::basic_string_view<K>.

◆ trim() [1/3]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim ( )
inlineinherited

Remove whitespace from the beginning and end of a line.

Returns
Impl& - a reference to yourself.

◆ trim() [2/3]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim ( str_piece pattern)
inlineinherited

Remove characters included in the passed string at the beginning and end of the line.

Parameters
pattern- a string containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim() [3/3]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim ( T && pattern)
inlineinherited

Remove characters included in a string literal at the beginning and end of the line.

Parameters
patternis a string literal containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim_left() [1/3]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_left ( )
inlineinherited

Remove whitespace at the beginning of a line.

Returns
Impl& - a reference to yourself.

◆ trim_left() [2/3]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_left ( str_piece pattern)
inlineinherited

Remove characters included in the passed string at the beginning of the line.

Parameters
pattern- a string containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim_left() [3/3]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_left ( T && pattern)
inlineinherited

Remove characters included in a string literal at the beginning of the line.

Parameters
patternis a string literal containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim_left_with_spaces() [1/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_left_with_spaces ( str_piece pattern)
inlineinherited

Remove characters included in the passed string, as well as whitespace, at the beginning of the string.

Parameters
pattern- a string containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim_left_with_spaces() [2/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_left_with_spaces ( T && pattern)
inlineinherited

Remove characters included in a string literal, as well as whitespace, at the beginning of a line.

Parameters
patternis a string literal containing the characters to be removed.
  • Returns
    Impl& - a reference to yourself.

◆ trim_right() [1/3]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_right ( )
inlineinherited

Remove whitespace from the end of a line.

Returns
Impl& - a reference to yourself.

◆ trim_right() [2/3]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_right ( str_piece pattern)
inlineinherited

Remove characters included in the passed string from the end of the string.

Parameters
pattern- a string containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim_right() [3/3]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_right ( T && pattern)
inlineinherited

Remove characters included in a string literal at the end of the line.

Parameters
patternis a string literal containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim_right_with_spaces()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_right_with_spaces ( str_piece pattern)
inlineinherited

Remove characters included in the passed string, as well as whitespace at the end of the string.

Parameters
pattern- a string containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim_right_with_wpaces()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_right_with_wpaces ( T && pattern)
inlineinherited

Remove characters included in a string literal, as well as whitespace, at the end of a string.

Parameters
patternis a string literal containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim_with_spaces() [1/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_with_spaces ( str_piece pattern)
inlineinherited

Remove characters included in the passed string, as well as whitespace characters, at the beginning and end of the string.

Parameters
pattern- a string containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trim_with_spaces() [2/2]

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::trim_with_spaces ( T && pattern)
inlineinherited

Remove characters included in a string literal, as well as whitespace, at the beginning and end of the string.

Parameters
patternis a string literal containing the characters to be removed.
Returns
Impl& - a reference to yourself.

◆ trimmed() [1/3]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed ( ) const
inlineinherited

Get a string with whitespace removed on the left and right.

Template Parameters
R- desired string type, default simple_str.
Returns
R - a string with whitespace characters removed at the beginning and end.

◆ trimmed() [2/3]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed ( str_piece pattern) const
inlineinherited

Get a string with characters specified by another string removed, left and right.

Template Parameters
R- desired string type, default simple_str.
Parameters
pattern- a string specifying the characters that will be trimmed.
Returns
R - a string with the characters contained in the pattern removed at the beginning and at the end.

◆ trimmed() [3/3]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed ( T && pattern) const
inlineinherited

Get a string with the characters specified by the string literal removed from the left and right.

Template Parameters
R- desired string type, default simple_str.
Parameters
patternis a string literal specifying the characters that will be trimmed.
Returns
R - a string with the characters contained in the literal removed at the beginning and at the end.

◆ trimmed_left() [1/3]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_left ( ) const
inlineinherited

Get a string with whitespace removed on the left.

Template Parameters
R- desired string type, default simple_str.
Returns
R - a string with leading whitespace characters removed.

◆ trimmed_left() [2/3]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_left ( str_piece pattern) const
inlineinherited

Get a string with characters specified by another string removed from the left.

Template Parameters
R- desired string type, default simple_str.
Parameters
pattern- a string specifying the characters that will be trimmed.
Returns
R - a string with the characters contained in the pattern removed at the beginning.

◆ trimmed_left() [3/3]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_left ( T && pattern) const
inlineinherited

Get a string with the characters specified by the string literal removed from the left.

Template Parameters
R- desired string type, default simple_str.
Parameters
patternis a string literal specifying the characters that will be trimmed.
Returns
R - a string with the characters contained in the literal removed at the beginning.

◆ trimmed_left_with_spaces() [1/2]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_left_with_spaces ( str_piece pattern) const
inlineinherited

Get a string, removing characters specified by another string, as well as whitespace characters, left.

Template Parameters
R- desired string type, default simple_str.
Parameters
pattern- a string specifying the characters that will be trimmed.
Returns
R - a string with the characters contained in the pattern removed at the beginning and whitespace characters.

◆ trimmed_left_with_spaces() [2/2]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_left_with_spaces ( T && pattern) const
inlineinherited

Get a string with the characters specified by the string literal removed, as well as whitespace characters, left.

Template Parameters
R- desired string type, default simple_str.
Parameters
patternis a string literal specifying the characters that will be trimmed.
Returns
R - a string with the characters contained in the literal removed at the beginning and whitespace characters.

◆ trimmed_right() [1/3]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_right ( ) const
inlineinherited

Get a string with whitespace removed on the right.

Template Parameters
R- desired string type, default simple_str.
Returns
R - a string with whitespace characters removed at the end.

◆ trimmed_right() [2/3]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_right ( str_piece pattern) const
inlineinherited

Get a string with characters specified by another string removed to the right.

Template Parameters
R- desired string type, default simple_str.
Parameters
pattern- a string specifying the characters that will be trimmed.
Returns
R - a string with characters contained in the pattern removed at the end.

◆ trimmed_right() [3/3]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_right ( T && pattern) const
inlineinherited

Get a string with the characters specified by the string literal removed from the right.

Template Parameters
R- desired string type, default simple_str.
Parameters
patternis a string literal specifying the characters that will be trimmed.
Returns
R - a string with characters contained in the literal removed at the end.

◆ trimmed_right_with_spaces() [1/2]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_right_with_spaces ( str_piece pattern) const
inlineinherited

Get a string, removing characters specified by another string, as well as whitespace characters, right.

Template Parameters
R- desired string type, default simple_str.
Parameters
pattern- a string specifying the characters that will be trimmed.
Returns
R - a string with characters contained in the template removed at the end and whitespace characters.

◆ trimmed_right_with_spaces() [2/2]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_right_with_spaces ( T && pattern) const
inlineinherited

Get a string with the characters specified by the string literal removed, as well as whitespace characters, right.

Template Parameters
R- desired string type, default simple_str.
Parameters
patternis a string literal specifying the characters that will be trimmed.
Returns
R - a string with characters contained in the literal removed at the end and whitespace characters.

◆ trimmed_with_spaces() [1/2]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_with_spaces ( str_piece pattern) const
inlineinherited

Get a string, removing characters specified by another string, as well as whitespace characters, left and right.

Template Parameters
R- desired string type, default simple_str.
Parameters
pattern- a string specifying the characters that will be trimmed.
Returns
R - a string with the characters contained in the pattern removed at the beginning and at the end and whitespace characters.

◆ trimmed_with_spaces() [2/2]

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::trimmed_with_spaces ( T && pattern) const
inlineinherited

Get a string with the characters specified by the string literal removed, as well as whitespace characters, left and right.

Template Parameters
R- desired string type, default simple_str.
Parameters
patternis a string literal specifying the characters that will be trimmed.
Returns
R - a string with the characters contained in the literal removed at the beginning and at the end and whitespace characters.

◆ upper()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::upper ( )
inlineinherited

Convert first plane characters (<0xFFFF) to uppercase Unicode.

Case is changed by simplified tables, where one code_point is always changed to one code_point (but for UTF-8 it is possible that the length in code units will change).

Returns
Impl& - a reference to yourself.

◆ upper_only_ascii()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::upper_only_ascii ( )
inlineinherited

Convert ASCII characters to uppercase.

Returns
Impl& - a reference to yourself.

◆ uppered()

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::uppered ( ) const
inlineinherited

Get a copy of the string in upper case Unicode characters of the first plane (<0xFFFF).

Template Parameters
R- the desired string type, by default the same whose method was called.
Returns
R - uppercase copy of the string.

◆ uppered_from()

static my_type simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string >::uppered_from ( const From & f,
Args &&... args )
inlinestaticinherited

Create a copy of the passed string in uppercase Unicode characters of the first plane (<0xFFFF).

Parameters
f- source string.
...args- parameters for initializing the allocator.

Case is changed by simplified tables, where one code_point is always changed to one code_point (but for UTF-8 it is possible that the length in code units will change).

◆ uppered_only_ascii()

R simstr::str_algs< K, simple_str< K >, lstring< K, N, false, allocator_string >, Mutable >::uppered_only_ascii ( ) const
inlineinherited

Get a copy of the string in uppercase ASCII characters.

Template Parameters
R- the desired string type, by default the same whose method was called.
Returns
R - uppercase copy of the string.

◆ uppered_only_ascii_from()

static my_type simstr::str_storable< K, lstring< K, N, false, allocator_string >, allocator_string >::uppered_only_ascii_from ( const From & f,
Args &&... args )
inlinestaticinherited

Create a string copy of the passed in uppercase ASCII characters.

Parameters
f- source string.
...args- parameters for initializing the allocator.

◆ vformat()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::vformat ( str_piece format,
T &&... args )
inlineinherited

Formats a string using std::vformat.

Parameters
format- format string.
...args- arguments for std::vformat.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ vformat_from()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::vformat_from ( size_t from,
size_t max_write,
str_piece format,
T &&... args )
inlineinherited

Appends std::vformat formatted output starting at the specified position.

Parameters
from- starting position of adding.
max_write- the maximum number of characters to write.
format- format string.
...args- arguments for std::vformat.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ vformat_n()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::vformat_n ( size_t max_write,
str_piece format,
T &&... args )
inlineinherited

Formats a string using std::vformat up to the specified size.

Parameters
max_write- the maximum number of characters to write.
format- format string.
...args- arguments for std::vformat.
Returns
Impl& - a reference to yourself.

Automatically increases the string buffer size if necessary.

◆ with()

lstring< K, N, false, allocator_string > & simstr::str_mutable< K, lstring< K, N, false, allocator_string > >::with ( const Op & fillFunction,
Args &&... args )
inlineinherited

Call a functor with a string and passed arguments.

Parameters
fillFunction- a functor that takes a string reference as its first parameter.
...args- arguments passed to the functor.
Returns
Impl& - a reference to yourself.

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