Sequoia
Loading...
Searching...
No Matches
Functions
Indent.cpp File Reference

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)
 

Detailed Description

Definitions for Indent.hpp.

Function Documentation

◆ append_indented()

std::string & sequoia::append_indented ( std::string &  s1,
std::string_view  s2,
indentation  ind 
)
Parameters
s1The target for appending
s2The text to append
indentationThe 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.