Sequoia
|
Definitions for Indent.hpp. More...
#include "sequoia/TextProcessing/Indent.hpp"
Functions | |
std::string | sequoia::indent (std::string_view sv, indentation ind) |
For a non-empty string_view prepends with an indentation; otherwise returns an empty string. | |
std::string & | sequoia::append_indented (std::string &s1, std::string_view s2, indentation ind) |
std::string | sequoia::append_indented (std::string_view sv1, std::string_view sv2, indentation ind) |
std::string & | sequoia::tabs_to_spacing (std::string &text, std::string_view spacing) |
Definitions for Indent.hpp.
std::string & sequoia::append_indented | ( | std::string & | s1, |
std::string_view | s2, | ||
indentation | ind | ||
) |
s1 | The target for appending |
s2 | The text to append |
indentation | The absolute (not relative) indentation of s2 |
If s1 and s2 are both non-empty, a new line is appended to s1, followed by the indentation and then s2.
If s1 is empty, then s1 is set equal to s2, with no indentation.
If s2 is empty, no action is taken.