diff options
author | Brad King <brad.king@kitware.com> | 2020-02-25 14:41:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-02-25 14:41:26 (GMT) |
commit | 71764b88d6c9b36ccfc8add02334e99ddbfdc537 (patch) | |
tree | f985b900dcf85850f45b08c7a8bb2f3802851c80 /Source/kwsys/SystemTools.hxx.in | |
parent | 64198c4f073149341a8ae2ba3d5976c07e2120c2 (diff) | |
parent | 4e8c4c7ebe539e59e8323d1ac79e51366a0720aa (diff) | |
download | CMake-71764b88d6c9b36ccfc8add02334e99ddbfdc537.zip CMake-71764b88d6c9b36ccfc8add02334e99ddbfdc537.tar.gz CMake-71764b88d6c9b36ccfc8add02334e99ddbfdc537.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
KWSys 2020-02-25 (b14ce28a)
Diffstat (limited to 'Source/kwsys/SystemTools.hxx.in')
-rw-r--r-- | Source/kwsys/SystemTools.hxx.in | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index c4ab9d4..d4a93fa 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -935,22 +935,32 @@ public: * Parse a character string : * protocol://dataglom * and fill protocol as appropriate. + * decode the dataglom using DecodeURL if set to true. * Return false if the URL does not have the required form, true otherwise. */ static bool ParseURLProtocol(const std::string& URL, std::string& protocol, - std::string& dataglom); + std::string& dataglom, bool decode = false); /** * Parse a string (a URL without protocol prefix) with the form: * protocol://[[username[':'password]'@']hostname[':'dataport]]'/'[datapath] * and fill protocol, username, password, hostname, dataport, and datapath * when values are found. + * decode all string except the protocol using DecodeUrl if set to true. * Return true if the string matches the format; false otherwise. */ static bool ParseURL(const std::string& URL, std::string& protocol, std::string& username, std::string& password, std::string& hostname, std::string& dataport, - std::string& datapath); + std::string& datapath, bool decode = false); + + /** + * Decode the percent-encoded string from an URL or an URI + * into their correct char values. + * Does not perform any other sort of validation. + * Return the decoded string + */ + static std::string DecodeURL(const std::string& url); private: /** |