| 33 | } |
| 34 | |
| 35 | std::vector<std::string> SplitString(const std::string& string, |
| 36 | char delimiter) { |
| 37 | std::vector<std::string> result; |
| 38 | if (string.empty()) |
| 39 | return result; |
| 40 | |
| 41 | size_t start = 0; |
| 42 | while (start != std::string::npos) { |
| 43 | size_t end = string.find_first_of(delimiter, start); |
| 44 | |
| 45 | std::string part; |
| 46 | if (end == std::string::npos) { |
| 47 | part = string.substr(start); |
| 48 | start = std::string::npos; |
| 49 | } else { |
| 50 | part = string.substr(start, end - start); |
| 51 | start = end + 1; |
| 52 | } |
| 53 | |
| 54 | result.push_back(part); |
| 55 | } |
| 56 | return result; |
| 57 | } |
| 58 | |
| 59 | } // namespace crashpad |