diff options
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 |
