|
|
my_type & | operator<< (simple_str< K > data) |
| | Adding a piece of data.
|
| |
|
my_type & | operator<< (const StrExprForType< K > auto &expr) |
| | Adding a string expression.
|
| |
template<typename T>
requires std::is_same_v<T, K> |
| my_type & | operator<< (T data) |
| | Adding a symbol.
|
| |
|
constexpr size_t | length () const noexcept |
| | Length of the saved text.
|
| |
|
void | reset () |
| | Resets the contents, but does not delete the first buffer in order to avoid allocation later.
|
| |
| template<typename Op> |
| void | out (const Op &o) const |
| | Applies a functor to each stored buffer.
|
| |
|
bool | is_continuous () const |
| | Checks whether all text is located in one contiguous chunk in memory.
|
| |
|
const K * | begin () const |
| | Get a pointer to the beginning of the first buffer. It makes sense to apply only if is_continuous true.
|
| |
|
void | clear () |
| | Clear the object, freeing all allocated buffers.
|
| |
| portion_store | get_portion () const |
| | Get a portion_store through which data can be sequentially retrieved into an external buffer.
|
| |
| const auto & | data () const |
| | Get internal data buffers.
|
| |
template<typename K>
class simstr::chunked_string_builder< K >
For constructing long dynamic strings by concatenating small pieces.
Selects individual blocks of a given size (or a multiple of it for large inserts) as needed. to avoid relocation of long strings. After construction, you can merge it into one line. As measurements have shown, if you then merge it into one line, it works slower than lstring +=, but more economical in memory. If you don't merge it into one line, and then iterate through buffers, it's faster. Itself is a string expression.