| 904 | } |
| 905 | |
| 906 | SmallVector<std::string_view, 2> Split(std::string_view v, char delim = ',') { |
| 907 | SmallVector<std::string_view, 2> parts; |
| 908 | size_t start = 0, end; |
| 909 | while (true) { |
| 910 | end = v.find_first_of(delim, start); |
| 911 | parts.push_back(v.substr(start, end - start)); |
| 912 | if (end == std::string_view::npos) { |
| 913 | break; |
| 914 | } |
| 915 | start = end + 1; |
| 916 | } |
| 917 | return parts; |
| 918 | } |
| 919 | |
| 920 | template <typename IntType = int32_t> |
| 921 | Result<std::vector<IntType>> ParseInts(std::string_view v) { |