| 171 | } |
| 172 | |
| 173 | std::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 | |
| 190 | bool OHDUtil::file_exists_and_delete(const char* filename) { |
| 191 | bool ret = false; |