diff options
| author | Andrew Bell <andrew.bell.ia@gmail.com> | 2019-05-15 10:47:03 -0400 |
|---|---|---|
| committer | Andrew Bell <andrew.bell.ia@gmail.com> | 2019-05-15 10:47:03 -0400 |
| commit | 8f268409d37cea329d263e177b83e42f8384d3c7 (patch) | |
| tree | c4d0f3dd19456600f718a6e0c8573577f433549b /src/iso19111/internal.cpp | |
| parent | 886ced02f0aaab5d66d16459435f7447cf976650 (diff) | |
| parent | d67203a6f76a74f5ac029ff052dbcc72e3b59624 (diff) | |
| download | PROJ-8f268409d37cea329d263e177b83e42f8384d3c7.tar.gz PROJ-8f268409d37cea329d263e177b83e42f8384d3c7.zip | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/iso19111/internal.cpp')
| -rw-r--r-- | src/iso19111/internal.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/iso19111/internal.cpp b/src/iso19111/internal.cpp index 0c330d30..4810202d 100644 --- a/src/iso19111/internal.cpp +++ b/src/iso19111/internal.cpp @@ -1,7 +1,7 @@ /****************************************************************************** * * Project: PROJ - * Purpose: ISO19111:2018 implementation + * Purpose: ISO19111:2019 implementation * Author: Even Rouault <even dot rouault at spatialys dot com> * ****************************************************************************** @@ -298,6 +298,21 @@ std::vector<std::string> split(const std::string &str, char separator) { // --------------------------------------------------------------------------- +std::vector<std::string> split(const std::string &str, + const std::string &separator) { + std::vector<std::string> res; + size_t lastPos = 0; + size_t newPos = 0; + while ((newPos = str.find(separator, lastPos)) != std::string::npos) { + res.push_back(str.substr(lastPos, newPos - lastPos)); + lastPos = newPos + separator.size(); + } + res.push_back(str.substr(lastPos)); + return res; +} + +// --------------------------------------------------------------------------- + #ifdef _WIN32 // For some reason, sqlite3_snprintf() in the sqlite3 builds used on AppVeyor |
