Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose escape and unescape as static functions. #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions include/url.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down