| 122 | } |
| 123 | |
| 124 | std::string indentString(const std::string& input) noexcept { |
| 125 | std::stringstream ss(input); |
| 126 | std::string to; |
| 127 | std::string out; |
| 128 | bool isFirst = true; |
| 129 | |
| 130 | while (std::getline(ss, to, '\n')) { |
| 131 | if (!isFirst) { |
| 132 | out += "\n"; |
| 133 | } |
| 134 | isFirst = false; |
| 135 | out += " "; |
| 136 | out += to; |
| 137 | } |
| 138 | |
| 139 | return out; |
| 140 | } |
| 141 | |
| 142 | void stringReplace(std::string& input, std::string_view searchPattern, std::string_view replacement) noexcept { |
| 143 | for (;;) { |