simstr 1.2.4
Yet another strings library
 
Loading...
Searching...
No Matches
simstr::str_algs< K, StrRef, Impl, Mutable > Class Template Reference

A class with basic constant string algorithms. More...

#include <sstring.h>

Inheritance diagram for simstr::str_algs< K, StrRef, Impl, Mutable >:
simstr::lstring< K, N, forShared, Allocator > simstr::lstring< u8s, N > simstr::lstring< wchar_t, N > simstr::lstring< u16s, N > simstr::lstring< u32s, N > simstr::lstring< u8s, N, true > simstr::lstring< wchar_t, N, true > simstr::lstring< u16s, N, true > simstr::lstring< u32s, N, true > simstr::simple_str< u8s > simstr::simple_str< wchar_t > simstr::simple_str< u16s > simstr::simple_str< u32s > simstr::sstring< K, Allocator > simstr::sstring< u8s > simstr::sstring< wchar_t > simstr::sstring< u16s > simstr::sstring< u32s >

Public Member Functions

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.
 
template<typename = int>
requires is_one_of_std_char_v<K>
std::basic_string_view< K > to_sv () const noexcept
 Convert to std::string_view.
 
template<typename = int>
requires is_one_of_std_char_v<K>
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.
 
constexpr auto operator<=> (const base &other) const noexcept
 String comparison operator.
 
template<typename T, size_t N = const_lit_for<K, T>::Count>
bool operator== (T &&other) const noexcept
 Operator for comparing a string and a string literal for equality.
 
template<typename T, size_t N = const_lit_for<K, T>::Count>
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.
 
template<typename Exc, typename ... Args>
requires std::is_constructible_v<Exc, Args...>
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_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_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.
 
size_t find (K s, size_t offset=0) const noexcept
 Find a character in this 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.
 
template<typename Op>
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_last (K s, size_t offset=-1) const noexcept
 Find the last occurrence of a character 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.
 
template<ToIntNumber T, bool CheckOverflow = true, unsigned Base = 0, bool SkipWs = true, bool AllowSign = true>
as_int () const noexcept
 Convert a string to a number of the given type.
 
template<ToIntNumber T, bool CheckOverflow = true, unsigned Base = 0, bool SkipWs = true, bool AllowSign = true>
convert_result< T > to_int () const noexcept
 Convert a string to a number of the given type.
 
template<bool SkipWS = true, bool AllowPlus = true>
std::optional< double > to_double () const noexcept
 Convert string to double.
 
template<bool SkipWS = true>
requires (sizeof(K) == 1)
std::optional< double > to_double_hex () const noexcept
 Convert string in hex form to double.
 
template<ToIntNumber T>
void as_number (T &t) const
 Convert a string to an integer.
 
void as_number (double &t) const
 Convert string to double.
 
template<typename T, typename Op>
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.
 
template<typename T>
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.
 
template<typename R = my_type>
uppered_only_ascii () const
 Get a copy of the string in uppercase ASCII characters.
 
template<typename R = my_type>
lowered_only_ascii () const
 Get a copy of the string in lowercase ASCII characters.
 
template<typename R = my_type>
uppered () const
 Get a copy of the string in upper case Unicode characters of the first plane (<0xFFFF).
 
template<typename R = my_type>
lowered () const
 Get a copy of the string in lowercase Unicode characters of the first plane (<0xFFFF).
 
template<typename R = my_type>
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.
 
template<typename T, size_t N = const_lit_for<K, T>::Count, typename M, size_t L = const_lit_for<K, M>::Count>
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.
 
template<typename R = str_piece>
trimmed () const
 Get a string with whitespace removed on the left and right.
 
template<typename R = str_piece>
trimmed_left () const
 Get a string with whitespace removed on the left.
 
template<typename R = str_piece>
trimmed_right () const
 Get a string with whitespace removed on the right.
 
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
trimmed (T &&pattern) const
 Get a string with the characters specified by the string literal removed from the left and right.
 
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
trimmed_left (T &&pattern) const
 Get a string with the characters specified by the string literal removed from the left.
 
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
trimmed_right (T &&pattern) const
 Get a string with the characters specified by the string literal removed from the right.
 
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
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.
 
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
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.
 
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
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.
 
template<typename R = str_piece>
trimmed (str_piece pattern) const
 Get a string with characters specified by another string removed, left and right.
 
template<typename R = str_piece>
trimmed_left (str_piece pattern) const
 Get a string with characters specified by another string removed from the left.
 
template<typename R = str_piece>
trimmed_right (str_piece pattern) const
 Get a string with characters specified by another string removed to the right.
 
template<typename R = str_piece>
trimmed_with_spaces (str_piece pattern) const
 Get a string, removing characters specified by another string, as well as whitespace characters, left and right.
 
template<typename R = str_piece>
trimmed_left_with_spaces (str_piece pattern) const
 Get a string, removing characters specified by another string, as well as whitespace characters, left.
 
template<typename R = str_piece>
trimmed_right_with_spaces (str_piece pattern) const
 Get a string, removing characters specified by another string, as well as whitespace characters, right.
 

Detailed Description

template<typename K, typename StrRef, typename Impl, bool Mutable>
class simstr::str_algs< K, StrRef, Impl, Mutable >

A class with basic constant string algorithms.

Is the base for classes that can perform constant operations on strings. Doesn’t know anything about storing strings, neither itself nor the descendant class, that is, it works only with a pointer to a string and its length. To work, the descendant class must implement the following methods:

  • size_t length() const noexcept - returns the length of the string.
  • const K* symbols() const noexcept - returns a pointer to the beginning of the line.
  • bool is_empty() const noexcept - checks whether the string is empty.
    Template Parameters
    K- character type.
    StrRef- storage type for the string chunk.
    Impl- the final class is the successor.

Member Function Documentation

◆ as_int()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<ToIntNumber T, bool CheckOverflow = true, unsigned Base = 0, bool SkipWs = true, bool AllowSign = true>
T simstr::str_algs< K, StrRef, Impl, Mutable >::as_int ( ) const
inlinenoexcept

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
void simstr::str_algs< K, StrRef, Impl, Mutable >::as_number ( double & t) const
inline

Convert string to double.

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

◆ as_number() [2/2]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<ToIntNumber T>
void simstr::str_algs< K, StrRef, Impl, Mutable >::as_number ( T & t) const
inline

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
K simstr::str_algs< K, StrRef, Impl, Mutable >::at ( ptrdiff_t idx) const
inline

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.

◆ compare()

template<typename K, typename StrRef, typename Impl, bool Mutable>
int simstr::str_algs< K, StrRef, Impl, Mutable >::compare ( str_piece o) const
inlineconstexpr

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
int simstr::str_algs< K, StrRef, Impl, Mutable >::compare_ia ( str_piece text) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
int simstr::str_algs< K, StrRef, Impl, Mutable >::compare_iu ( str_piece text) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::contains ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexcept

Whether the string contains the specified substring.

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

◆ copy_to()

template<typename K, typename StrRef, typename Impl, bool Mutable>
void simstr::str_algs< K, StrRef, Impl, Mutable >::copy_to ( K * buffer,
size_t bufSize )
inline

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::ends_with ( str_piece suffix) const
inlineconstexprnoexcept

Whether the string ends with the specified substring.

Parameters
suffix- substring.

◆ ends_with_ia()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::ends_with_ia ( str_piece suffix) const
inlineconstexprnoexcept

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

Parameters
suffix- substring.

◆ ends_with_iu()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::ends_with_iu ( str_piece suffix) const
inlineconstexprnoexcept

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

Parameters
suffix- substring.

◆ equal()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::equal ( str_piece other) const
inlineconstexprnoexcept

String comparison for equality.

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

◆ equal_ia()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::equal_ia ( str_piece text) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::equal_iu ( str_piece text) const
inlinenoexcept

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.

◆ find() [1/2]

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find ( K s,
size_t offset = 0 ) const
inlinenoexcept

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
std::vector< size_t > simstr::str_algs< K, StrRef, Impl, Mutable >::find_all ( str_piece pattern,
size_t offset = 0,
size_t maxCount = 0 ) const
inline

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_end ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_end_of_last ( str_piece pattern,
size_t offset = -1 ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_end_of_last_or_all ( str_piece pattern,
size_t offset = -1 ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_end_or_all ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_first_not_of ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_first_of ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
std::pair< size_t, size_t > simstr::str_algs< K, StrRef, Impl, Mutable >::find_first_of_idx ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexcept

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_last ( K s,
size_t offset = -1 ) const
inlinenoexcept

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_last ( str_piece pattern,
size_t offset = -1 ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_last_not_of ( str_piece pattern,
size_t offset = str::npos ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_last_of ( str_piece pattern,
size_t offset = str::npos ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
std::pair< size_t, size_t > simstr::str_algs< K, StrRef, Impl, Mutable >::find_last_of_idx ( str_piece pattern,
size_t offset = str::npos ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_last_or_all ( str_piece pattern,
size_t offset = -1 ) const
inlinenoexcept

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_or_all ( K s,
size_t offset = 0 ) const
inlinenoexcept

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_or_all ( str_piece pattern,
size_t offset = 0 ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename Exc, typename ... Args>
requires std::is_constructible_v<Exc, Args...>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::find_or_throw ( str_piece pattern,
size_t offset = 0,
Args &&... args ) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename Op>
void simstr::str_algs< K, StrRef, Impl, Mutable >::for_all_finded ( const Op & op,
str_piece pattern,
size_t offset = 0,
size_t maxCount = 0 ) const
inline

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.

◆ from_to()

template<typename K, typename StrRef, typename Impl, bool Mutable>
str_piece simstr::str_algs< K, StrRef, Impl, Mutable >::from_to ( size_t from,
size_t to ) const
inlineconstexprnoexcept

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.

◆ less_ia()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::less_ia ( str_piece text) const
inlinenoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::less_iu ( str_piece text) const
inlinenoexcept

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.

◆ lowered()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = my_type>
R simstr::str_algs< K, StrRef, Impl, Mutable >::lowered ( ) const
inline

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_only_ascii()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = my_type>
R simstr::str_algs< K, StrRef, Impl, Mutable >::lowered_only_ascii ( ) const
inline

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.

◆ mid()

template<typename K, typename StrRef, typename Impl, bool Mutable>
str_piece simstr::str_algs< K, StrRef, Impl, Mutable >::mid ( size_t from,
size_t len = -1 ) const
inlineconstexprnoexcept

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 str_piece()

template<typename K, typename StrRef, typename Impl, bool Mutable>
simstr::str_algs< K, StrRef, Impl, Mutable >::operator str_piece ( ) const
inlineconstexprnoexcept

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

Returns
str_piece.

◆ operator()()

template<typename K, typename StrRef, typename Impl, bool Mutable>
str_piece simstr::str_algs< K, StrRef, Impl, Mutable >::operator() ( ptrdiff_t from,
ptrdiff_t len = 0 ) const
inlineconstexprnoexcept

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
auto simstr::str_algs< K, StrRef, Impl, Mutable >::operator<=> ( const base & other) const
inlineconstexprnoexcept

String comparison operator.

Parameters
other- another line.

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

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename T, size_t N = const_lit_for<K, T>::Count>
auto simstr::str_algs< K, StrRef, Impl, Mutable >::operator<=> ( T && other) const
inlinenoexcept

Comparison operator between a string and a string literal.

Parameters
otheris a string literal.

◆ operator==() [1/2]

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::operator== ( const base & other) const
inlineconstexprnoexcept

Operator comparing strings for equality.

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

◆ operator==() [2/2]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename T, size_t N = const_lit_for<K, T>::Count>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::operator== ( T && other) const
inlinenoexcept

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

Parameters
other- string literal.

◆ place()

template<typename K, typename StrRef, typename Impl, bool Mutable>
K * simstr::str_algs< K, StrRef, Impl, Mutable >::place ( K * ptr) const
inlineconstexprnoexcept

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::prefix_in ( str_piece text) const
inlineconstexprnoexcept

Whether this string is the beginning of another string.

Parameters
text- another string.

◆ replace_init()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename T, size_t N = const_lit_for<K, T>::Count, typename M, size_t L = const_lit_for<K, M>::Count>
expr_replaces< K, N - 1, L - 1 > simstr::str_algs< K, StrRef, Impl, Mutable >::replace_init ( T && pattern,
M && repl ) const
inline

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = my_type>
R simstr::str_algs< K, StrRef, Impl, Mutable >::replaced ( str_piece pattern,
str_piece repl,
size_t offset = 0,
size_t maxCount = 0 ) const
inline

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.

◆ size()

template<typename K, typename StrRef, typename Impl, bool Mutable>
size_t simstr::str_algs< K, StrRef, Impl, Mutable >::size ( ) const
inline

The size of the string in characters.

Returns
size_t

◆ split()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename T>
T simstr::str_algs< K, StrRef, Impl, Mutable >::split ( str_piece delimeter,
size_t offset = 0 ) const
inline

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename T, typename Op>
T simstr::str_algs< K, StrRef, Impl, Mutable >::splitf ( str_piece delimeter,
const Op & beforeFunc,
size_t offset = 0 ) const
inline

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
Splitter< K > simstr::str_algs< K, StrRef, Impl, Mutable >::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.

Parameters
delimeter- delimiter.
Returns
Splitter<K>.

◆ starts_with()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::starts_with ( str_piece prefix) const
inlineconstexprnoexcept

Whether the string begins with the given substring.

Parameters
prefix- substring.

◆ starts_with_ia()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::starts_with_ia ( str_piece prefix) const
inlineconstexprnoexcept

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

Parameters
prefix- substring.

◆ starts_with_iu()

template<typename K, typename StrRef, typename Impl, bool Mutable>
bool simstr::str_algs< K, StrRef, Impl, Mutable >::starts_with_iu ( str_piece prefix) const
inlinenoexcept

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

Parameters
prefix- substring.

◆ str_mid()

template<typename K, typename StrRef, typename Impl, bool Mutable>
my_type simstr::str_algs< K, StrRef, Impl, Mutable >::str_mid ( size_t from,
size_t len = -1 ) const
inline

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
int simstr::str_algs< K, StrRef, Impl, Mutable >::strcmp ( const K * text) const
inlineconstexpr

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
my_type simstr::str_algs< K, StrRef, Impl, Mutable >::substr ( ptrdiff_t from,
ptrdiff_t len = 0 ) const
inline

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()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<bool SkipWS = true, bool AllowPlus = true>
std::optional< double > simstr::str_algs< K, StrRef, Impl, Mutable >::to_double ( ) const
inlinenoexcept

Convert string to double.

Returns
std::optional<double>.

◆ to_double_hex()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<bool SkipWS = true>
requires (sizeof(K) == 1)
std::optional< double > simstr::str_algs< K, StrRef, Impl, Mutable >::to_double_hex ( ) const
inlinenoexcept

Convert string in hex form to double.

Returns
std::optional<double>.

◆ to_int()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<ToIntNumber T, bool CheckOverflow = true, unsigned Base = 0, bool SkipWs = true, bool AllowSign = true>
convert_result< T > simstr::str_algs< K, StrRef, Impl, Mutable >::to_int ( ) const
inlinenoexcept

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_str()

template<typename K, typename StrRef, typename Impl, bool Mutable>
str_piece simstr::str_algs< K, StrRef, Impl, Mutable >::to_str ( ) const
inlinenoexcept

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

Returns
str_piece.

◆ to_string()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename = int>
requires is_one_of_std_char_v<K>
std::basic_string< K > simstr::str_algs< K, StrRef, Impl, Mutable >::to_string ( ) const
inlinenoexcept

Convert to std::string.

Returns
std::basic_string<K>.

◆ to_sv()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename = int>
requires is_one_of_std_char_v<K>
std::basic_string_view< K > simstr::str_algs< K, StrRef, Impl, Mutable >::to_sv ( ) const
inlinenoexcept

Convert to std::string_view.

Returns
std::basic_string_view<K>.

◆ trimmed() [1/3]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed ( ) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed ( str_piece pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed ( T && pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_left ( ) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_left ( str_piece pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_left ( T && pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_left_with_spaces ( str_piece pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_left_with_spaces ( T && pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_right ( ) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_right ( str_piece pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_right ( T && pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_right_with_spaces ( str_piece pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_right_with_spaces ( T && pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_with_spaces ( str_piece pattern) const
inline

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]

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
requires is_const_pattern<N>
R simstr::str_algs< K, StrRef, Impl, Mutable >::trimmed_with_spaces ( T && pattern) const
inline

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.

◆ uppered()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = my_type>
R simstr::str_algs< K, StrRef, Impl, Mutable >::uppered ( ) const
inline

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_only_ascii()

template<typename K, typename StrRef, typename Impl, bool Mutable>
template<typename R = my_type>
R simstr::str_algs< K, StrRef, Impl, Mutable >::uppered_only_ascii ( ) const
inline

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.

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