diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-08-22 15:14:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-22 15:14:59 -0700 |
| commit | 651ab5cef2c9742869185a181e1db529dc937d21 (patch) | |
| tree | d9b2239e97a6351c1a6a28cf7c8cf0cadf8c54e2 /toolsrc/src/vcpkg_Parse.cpp | |
| parent | 6035c3228bcef651d342b3a31827157ad2ed6a85 (diff) | |
| parent | 92dd1b77ed043da376c86874aacc1233270fedae (diff) | |
| download | vcpkg-651ab5cef2c9742869185a181e1db529dc937d21.tar.gz vcpkg-651ab5cef2c9742869185a181e1db529dc937d21.zip | |
Merge pull request #1566 from Microsoft/feature_package_end_to_end
end to end hdf5 feature packages
Diffstat (limited to 'toolsrc/src/vcpkg_Parse.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg_Parse.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg_Parse.cpp b/toolsrc/src/vcpkg_Parse.cpp index 659af2939..118cde900 100644 --- a/toolsrc/src/vcpkg_Parse.cpp +++ b/toolsrc/src/vcpkg_Parse.cpp @@ -44,4 +44,37 @@ namespace vcpkg::Parse } return nullptr; } + + std::vector<std::string> parse_comma_list(const std::string& str) + { + if (str.empty()) + { + return {}; + } + + std::vector<std::string> out; + + size_t cur = 0; + do + { + auto pos = str.find(',', cur); + if (pos == std::string::npos) + { + out.push_back(str.substr(cur)); + break; + } + out.push_back(str.substr(cur, pos - cur)); + + // skip comma and space + ++pos; + if (str[pos] == ' ') + { + ++pos; + } + + cur = pos; + } while (cur != std::string::npos); + + return out; + } } |
