| 117 | } |
| 118 | |
| 119 | vector<string> tokenize(const char* str, const char* delimiters) |
| 120 | { |
| 121 | vector<string> out; |
| 122 | string token; |
| 123 | while (*str != 0) { |
| 124 | while (*str != 0 && strchr(delimiters, *str)) |
| 125 | ++str; |
| 126 | token.clear(); |
| 127 | while (*str != 0 && strchr(delimiters, *str) == nullptr) |
| 128 | token += *(str++); |
| 129 | if (token.length() > 0) |
| 130 | out.push_back(token); |
| 131 | } |
| 132 | if (out.size() == 0) |
| 133 | out.push_back(string()); |
| 134 | return out; |
| 135 | } |
| 136 | |
| 137 | set<int32_t> parse_csv(const string& s) |
| 138 | { |