diff options
author | Brad King <brad.king@kitware.com> | 2018-11-28 18:30:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-11-28 19:27:22 (GMT) |
commit | 652210e901f5e1e9bf8e25d35423348de8e50c1a (patch) | |
tree | 5d61ed11486a6d4dd15f76601fe1f9dff53128ce /Source/cmSystemTools.h | |
parent | 772edffbf0c08fc0a6fcf74fb98545b7afcfee13 (diff) | |
download | CMake-652210e901f5e1e9bf8e25d35423348de8e50c1a.zip CMake-652210e901f5e1e9bf8e25d35423348de8e50c1a.tar.gz CMake-652210e901f5e1e9bf8e25d35423348de8e50c1a.tar.bz2 |
cmSystemTools: Add EncodeURL helper
Factor a URL encoding implementation out of CTest.
Add an option to not escape slashes.
Suggested-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 98300eb..832c1ca 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -495,6 +495,10 @@ public: static bool StringToLong(const char* str, long* value); static bool StringToULong(const char* str, unsigned long* value); + /** Encode a string as a URL. */ + static std::string EncodeURL(std::string const& in, + bool escapeSlashes = true); + #ifdef _WIN32 struct WindowsFileRetry { |