| Index: third_party/crashpad/crashpad/util/string/split_string.cc
|
| diff --git a/third_party/crashpad/crashpad/util/string/split_string.cc b/third_party/crashpad/crashpad/util/string/split_string.cc
|
| index 25048b5636d7fe9d4be2a1b76f6a80f9bd40f15a..9d0d675aa99cb45656bc97d0b7af540df6304aa1 100644
|
| --- a/third_party/crashpad/crashpad/util/string/split_string.cc
|
| +++ b/third_party/crashpad/crashpad/util/string/split_string.cc
|
| @@ -18,10 +18,10 @@
|
|
|
| namespace crashpad {
|
|
|
| -bool SplitString(const std::string& string,
|
| - char delimiter,
|
| - std::string* left,
|
| - std::string* right) {
|
| +bool SplitStringFirst(const std::string& string,
|
| + char delimiter,
|
| + std::string* left,
|
| + std::string* right) {
|
| size_t delimiter_pos = string.find(delimiter);
|
| if (delimiter_pos == 0 || delimiter_pos == std::string::npos) {
|
| return false;
|
| @@ -32,4 +32,27 @@ bool SplitString(const std::string& string,
|
| return true;
|
| }
|
|
|
| +std::vector<std::string> SplitString(const std::string& str, char delimiter) {
|
| + std::vector<std::string> result;
|
| + if (str.empty())
|
| + return result;
|
| +
|
| + size_t start = 0;
|
| + while (start != std::string::npos) {
|
| + size_t end = str.find_first_of(delimiter, start);
|
| +
|
| + std::string part;
|
| + if (end == std::string::npos) {
|
| + part = str.substr(start);
|
| + start = std::string::npos;
|
| + } else {
|
| + part = str.substr(start, end - start);
|
| + start = end + 1;
|
| + }
|
| +
|
| + result.push_back(part);
|
| + }
|
| + return result;
|
| +}
|
| +
|
| } // namespace crashpad
|
|
|