From afb887126bb16fe1bda5c7b21af4925a52a6ecff Mon Sep 17 00:00:00 2001 From: Dan Lecocq Date: Mon, 12 Sep 2016 10:25:29 -0700 Subject: [PATCH] Expose escape and unescape as static functions. --- include/url.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/url.h b/include/url.h index 4622d67..61f96e4 100644 --- a/include/url.h +++ b/include/url.h @@ -248,24 +248,24 @@ namespace Url */ Url& unpunycode(); - private: - // Private, unimplemented to prevent use. - Url(); - /** - * Remove repeated, leading, and trailing instances of chr from the string. + * Ensure all the provided characters are escaped if necessary */ - void remove_repeats(std::string& str, const char chr); + static void escape(std::string& str, const CharacterClass& safe, bool strict); /** - * Ensure all the provided characters are escaped if necessary + * Unescape entities in the provided string */ - void escape(std::string& str, const CharacterClass& safe, bool strict); + static void unescape(std::string& str); + + private: + // Private, unimplemented to prevent use. + Url(); /** - * Unescape entities in the provided string + * Remove repeated, leading, and trailing instances of chr from the string. */ - void unescape(std::string& str); + void remove_repeats(std::string& str, const char chr); /** * Remove any params that match entries in the blacklist.