Rose::StringUtility::prefixLines
Insert a prefix string before every line.
Synopsis
Declared in <src/Rose/StringUtility/Convert.h>
[[visibility]]
std::string
prefixLines(
std::string const& lines,
std::string const& prefix,
bool prefixAtFront = true,
bool prefixAtBack = false);
Description
This function breaks the lines string into individual lines, inserts the prefix string at the beginning of each line, then concatenates the lines together into a return value. If prefixAtFront is true (the default) then the prefix is added to the first line of lines, otherwise the first line is unchanged. An empty lines string is considered to be a single line. If prefixAtBack is false (the default) then the prefix is not appended to the lines string if lines ends with a linefeed.
Return Value
Prefixed string.
Parameters
Name |
Description |
lines |
Input text. |
prefix |
Prefix to insert. |
prefixAtFront |
Whether to prefix the first line. |
prefixAtBack |
Whether to prefix a trailing empty line. |
Created with MrDocs