#include <text_utils.hpp>
|
| | MultilineStringAccumulator () |
| |
| void | indent () |
| | Increase indentation level.
|
| |
| void | unindent () |
| | Decrease indentation level (no-op if already at 0).
|
| |
| template<typename... Args> |
| void | add (Args &&...args) |
| | Add a line with current indentation applied.
|
| |
| void | add_multiline (const std::string &multiline_str) |
| | Add multiple lines with indentation applied.
|
| |
| void | insert_line (size_t index, const std::string &line) |
| | Insert a line at the given index.
|
| |
| void | insert_lines (size_t index, const MultilineStringAccumulator &other) |
| | Insert all lines from another accumulator.
|
| |
| void | insert_multiline (size_t index, const std::string &multiline_str) |
| | Insert multiple lines from a string.
|
| |
| void | remove_line (size_t index) |
| | Remove a line at the given index.
|
| |
| std::string | str () const |
| | Get the accumulated text as a single string with newlines.
|
| |
| void | clear () |
| | Clear all stored lines.
|
| |
| size_t | line_count () const |
| | Get the number of stored lines.
|
| |
◆ MultilineStringAccumulator()
| text_utils::MultilineStringAccumulator::MultilineStringAccumulator |
( |
| ) |
|
|
inline |
◆ add()
template<typename... Args>
| void text_utils::MultilineStringAccumulator::add |
( |
Args &&... | args | ) |
|
|
inline |
Add a line with current indentation applied.
- Template Parameters
-
| Args | Any streamable types. |
- Parameters
-
| args | Values to append to the line. |
◆ add_multiline()
| void text_utils::MultilineStringAccumulator::add_multiline |
( |
const std::string & | multiline_str | ) |
|
|
inline |
Add multiple lines with indentation applied.
- Parameters
-
| multiline_str | Input string with newlines. |
◆ clear()
| void text_utils::MultilineStringAccumulator::clear |
( |
| ) |
|
|
inline |
◆ indent()
| void text_utils::MultilineStringAccumulator::indent |
( |
| ) |
|
|
inline |
Increase indentation level.
◆ insert_line()
| void text_utils::MultilineStringAccumulator::insert_line |
( |
size_t | index, |
|
|
const std::string & | line ) |
|
inline |
Insert a line at the given index.
- Parameters
-
| index | Position in the list of lines. |
| line | Text to insert. |
- Exceptions
-
| std::out_of_range | if index is invalid. |
◆ insert_lines()
Insert all lines from another accumulator.
- Parameters
-
| index | Position in the list of lines. |
| other | Another accumulator containing lines. |
- Exceptions
-
| std::out_of_range | if index is invalid. |
◆ insert_multiline()
| void text_utils::MultilineStringAccumulator::insert_multiline |
( |
size_t | index, |
|
|
const std::string & | multiline_str ) |
|
inline |
Insert multiple lines from a string.
- Parameters
-
| index | Position in the list of lines. |
| multiline_str | String containing newlines. |
- Exceptions
-
| std::out_of_range | if index is invalid. |
◆ line_count()
| size_t text_utils::MultilineStringAccumulator::line_count |
( |
| ) |
const |
|
inline |
Get the number of stored lines.
◆ remove_line()
| void text_utils::MultilineStringAccumulator::remove_line |
( |
size_t | index | ) |
|
|
inline |
Remove a line at the given index.
- Parameters
-
| index | Position in the list of lines. |
- Exceptions
-
| std::out_of_range | if index is invalid. |
◆ str()
| std::string text_utils::MultilineStringAccumulator::str |
( |
| ) |
const |
|
inline |
Get the accumulated text as a single string with newlines.
◆ unindent()
| void text_utils::MultilineStringAccumulator::unindent |
( |
| ) |
|
|
inline |
Decrease indentation level (no-op if already at 0).
The documentation for this class was generated from the following file: