| 198 | } |
| 199 | |
| 200 | std::vector<std::string> OHDUtil::split_string_by_newline( |
| 201 | const std::string& str, const bool include_newline_character) { |
| 202 | auto result = std::vector<std::string>{}; |
| 203 | auto ss = std::stringstream{str}; |
| 204 | |
| 205 | for (std::string line; std::getline(ss, line, '\n');) { |
| 206 | const auto tmp = line + (include_newline_character ? "\n" : ""); |
| 207 | result.push_back(tmp); |
| 208 | } |
| 209 | return result; |
| 210 | } |
| 211 | |
| 212 | std::string OHDUtil::create_string_from_lines( |
| 213 | const std::vector<std::string>& lines) { |