| 49 | |
| 50 | namespace cs_system_impl { |
| 51 | std::vector<std::string> split(const std::string &str, const cs::set_t<char> &set) |
| 52 | { |
| 53 | std::vector<std::string> results; |
| 54 | std::string buff; |
| 55 | for (auto ch : str) { |
| 56 | if (set.count(ch) > 0) { |
| 57 | if (!buff.empty()) { |
| 58 | results.emplace_back(buff); |
| 59 | buff.clear(); |
| 60 | } |
| 61 | } |
| 62 | else |
| 63 | buff.push_back(ch); |
| 64 | } |
| 65 | if (!buff.empty()) { |
| 66 | results.emplace_back(buff); |
| 67 | buff.clear(); |
| 68 | } |
| 69 | return std::move(results); |
| 70 | } |
| 71 | |
| 72 | unsigned int parse_mode(const std::string &modeString) |
| 73 | { |