MCPcopy Create free account
hub / github.com/OpenHD/OpenHD / split_string_by_newline

Method split_string_by_newline

OpenHD/ohd_common/src/openhd_util.cpp:200–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200std::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
212std::string OHDUtil::create_string_from_lines(
213 const std::vector<std::string>& lines) {

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected