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

Method split_into_substrings

OpenHD/ohd_common/src/openhd_util.cpp:173–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173std::vector<std::string> OHDUtil::split_into_substrings(
174 const std::string& input, const char separator) {
175 std::vector<std::string> ret;
176 std::string buff;
177 for (int i = 0; i < input.size(); i++) {
178 const auto curr_char = input.at(i);
179 if (curr_char == separator) {
180 if (!buff.empty()) ret.push_back(buff);
181 buff = "";
182 } else {
183 buff += curr_char;
184 }
185 }
186 if (!buff.empty()) ret.push_back(buff);
187 return ret;
188}
189
190bool OHDUtil::file_exists_and_delete(const char* filename) {
191 bool ret = false;

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected