|
| template<typename K, typename A, StrExprForType< K > E> |
| std::basic_string< K, std::char_traits< K >, A > & | change (std::basic_string< K, std::char_traits< K >, A > &str, size_t from, size_t count, const E &expr) |
| | Replace a portion of a standard string with the given string expression.
|
| |
| template<typename K, typename A, StrExprForType< K > E> |
| std::basic_string< K, std::char_traits< K >, A > & | append (std::basic_string< K, std::char_traits< K >, A > &str, const E &expr) |
| | Append a string expression to a standard string.
|
| |
| template<typename K, typename A, StrExprForType< K > E> |
| std::basic_string< K, std::char_traits< K >, A > & | prepend (std::basic_string< K, std::char_traits< K >, A > &str, const E &expr) |
| | Insert a string expression at the beginning of a standard string.
|
| |
| template<typename K, typename A, StrExprForType< K > E> |
| std::basic_string< K, std::char_traits< K >, A > & | insert (std::basic_string< K, std::char_traits< K >, A > &str, size_t from, const E &expr) |
| | Insert a string expression at the specified position in a standard string.
|
| |
template<typename K, typename A, StrExprForType< K > E, typename T>
requires (std::is_constructible_v<str_src<K>, T>) |
| std::basic_string< K, std::char_traits< K >, A > & | replace (std::basic_string< K, std::char_traits< K >, A > &str, T &&pattern, const E &repl, size_t offset=0, size_t max_count=-1) |
| | A function for searching for substrings in a standard string and replacing the found occurrences with a string expression.
|
| |
| template<typename K, typename A> |
| std::basic_string< K, std::char_traits< K >, A > & | replace (std::basic_string< K, std::char_traits< K >, A > &str, str_src< K > pattern, str_src< K > repl, size_t offset=0, size_t max_count=-1) |
| | Function for searching for substrings in a standard string and replacing found occurrences with another substring.
|
| |
Small namespace for standard string methods.
template<typename K, typename A, StrExprForType< K > E>
| std::basic_string< K, std::char_traits< K >, A > & simstr::str::append |
( |
std::basic_string< K, std::char_traits< K >, A > & | str, |
|
|
const E & | expr ) |
Append a string expression to a standard string.
- Template Parameters
-
| K | - character type. |
| A | - allocator type. |
| E | - string expression type. |
- Parameters
-
| str | - string. |
| expr | - string expression to insert. |
- Returns
- std::basic_string<K, std::char_traits<K>, A>& - reference to the passed string.
The method gets the length of the string expression, increases the size of the string, and materializes the string expression beyond the end of the string, without using intermediate buffers. Before C++23, resize was used; since C++23, resize_and_overwrite was used.
IMPORTANT!!! Parts of a string expression must not reference the string itself, otherwise the result is undefined!!!
template<typename K, typename A, StrExprForType< K > E>
| std::basic_string< K, std::char_traits< K >, A > & simstr::str::change |
( |
std::basic_string< K, std::char_traits< K >, A > & | str, |
|
|
size_t | from, |
|
|
size_t | count, |
|
|
const E & | expr ) |
Replace a portion of a standard string with the given string expression.
- Template Parameters
-
| K | - character type. |
| A | - allocator type. |
| E | - string expression type. |
- Parameters
-
| str | - string. |
| from | - starting position of replacement. |
| count | - number of characters to replace. |
| expr | - string expression to replace. |
- Returns
- std::basic_string<K, std::char_traits<K>, A>& - reference to the passed string.
The method gets the length of the string expression, increases the string size if necessary, and materializes the string expression at the desired location, without using intermediate buffers. When increasing the string size, resize is used before C++23; resize_and_overwrite is used starting with C++23.
IMPORTANT!!! Parts of a string expression must not reference the string itself, otherwise the result is undefined!!!
template<typename K, typename A, StrExprForType< K > E>
| std::basic_string< K, std::char_traits< K >, A > & simstr::str::insert |
( |
std::basic_string< K, std::char_traits< K >, A > & | str, |
|
|
size_t | from, |
|
|
const E & | expr ) |
Insert a string expression at the specified position in a standard string.
- Template Parameters
-
| K | - character type. |
| A | - allocator type. |
| E | - string expression type. |
- Parameters
-
| str | - string. |
| from | - insertion position. |
| expr | - string expression to insert. |
- Returns
- std::basic_string<K, std::char_traits<K>, A>& - a reference to the passed string.
The method gets the length of the string expression, increases the size of the string, shifts its contents and materializes the string expression to the desired location, without using intermediate buffers. Before C++23, resize was used; since C++23, resize_and_overwrite was used.
IMPORTANT!!! Parts of a string expression must not reference the string itself, otherwise the result is undefined!!!
template<typename K, typename A, StrExprForType< K > E>
| std::basic_string< K, std::char_traits< K >, A > & simstr::str::prepend |
( |
std::basic_string< K, std::char_traits< K >, A > & | str, |
|
|
const E & | expr ) |
Insert a string expression at the beginning of a standard string.
- Template Parameters
-
| K | - character type. |
| A | - allocator type. |
| E | - string expression type. |
- Parameters
-
| str | - string. |
| expr | - string expression to insert. |
- Returns
- std::basic_string<K, std::char_traits<K>, A>& - reference to the passed string.
The method gets the length of the string expression, increases the size of the string, shifts its contents and materializes the string expression at the beginning of the string, without using intermediate buffers. Before C++23, resize was used; since C++23, resize_and_overwrite was used.
IMPORTANT!!! Parts of a string expression must not reference the string itself, otherwise the result is undefined!!!