summaryrefslogtreecommitdiffstats
path: root/SystemTools.hxx.in
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2020-02-25 14:14:22 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-25 14:41:26 (GMT)
commit4e8c4c7ebe539e59e8323d1ac79e51366a0720aa (patch)
tree2a53347e386ad14154da694d9ae6d67e7d6c39db /SystemTools.hxx.in
parent96dd383ceb6568ca4e02c71b271cca394ade6e55 (diff)
downloadCMake-4e8c4c7ebe539e59e8323d1ac79e51366a0720aa.zip
CMake-4e8c4c7ebe539e59e8323d1ac79e51366a0720aa.tar.gz
CMake-4e8c4c7ebe539e59e8323d1ac79e51366a0720aa.tar.bz2
KWSys 2020-02-25 (b14ce28a)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit b14ce28a237ec0b0d2743418e18cf41ca6bf3a78 (master). Upstream Shortlog ----------------- Leon Richardt (1): 44eaaa6e Terminal: Add st-256color to VT100 color support whitelist Mathieu Westphal (1): acee32bd Adding DecodeUrl and GetFilePathFromURI methods
Diffstat (limited to 'SystemTools.hxx.in')
-rw-r--r--SystemTools.hxx.in14
1 files changed, 12 insertions, 2 deletions
diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in
index c4ab9d4..d4a93fa 100644
--- a/SystemTools.hxx.in
+++ b/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:
/**