| 64 | } |
| 65 | |
| 66 | inline static std::vector<std::string> Split(const char* c_str, char delimiter) { |
| 67 | std::vector<std::string> ret; |
| 68 | std::string str(c_str); |
| 69 | size_t i = 0; |
| 70 | size_t pos = 0; |
| 71 | while (pos < str.length()) { |
| 72 | if (str[pos] == delimiter) { |
| 73 | if (i < pos) { |
| 74 | ret.push_back(str.substr(i, pos - i)); |
| 75 | } |
| 76 | ++pos; |
| 77 | i = pos; |
| 78 | } else { |
| 79 | ++pos; |
| 80 | } |
| 81 | } |
| 82 | if (i < pos) { |
| 83 | ret.push_back(str.substr(i)); |
| 84 | } |
| 85 | return ret; |
| 86 | } |
| 87 | |
| 88 | inline static std::vector<std::string> SplitLines(const char* c_str) { |
| 89 | std::vector<std::string> ret; |
no test coverage detected