diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2018-07-04 19:21:55 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2018-07-04 19:21:55 -0700 |
commit | ea3d03583c4cd2443220eddfedefcea51b7121c5 (patch) | |
tree | d0cc4120a80501c05f06b8682cbb8169d6c9cab2 /include/Uri | |
parent | d95bcc094d5102cbc1b625b69bf6378e3fb730a8 (diff) |
Fix requirements
Query and fragment may be empty but present in a URI.
Handle this in the same way that port is handled: include
a flag for each of query and fragment, to allow an
empty but present query/fragment.
Diffstat (limited to 'include/Uri')
-rw-r--r-- | include/Uri/Uri.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/Uri/Uri.hpp b/include/Uri/Uri.hpp index 7074990..f531d09 100644 --- a/include/Uri/Uri.hpp +++ b/include/Uri/Uri.hpp @@ -164,6 +164,16 @@ namespace Uri { bool ContainsRelativePath() const; /** + * This method returns an indication of whether or not the + * URI includes a query. + * + * @return + * An indication of whether or not the + * URI includes a query is returned. + */ + bool HasQuery() const; + + /** * This method returns the "query" element of the URI, * if it has one. * @@ -176,6 +186,16 @@ namespace Uri { std::string GetQuery() const; /** + * This method returns an indication of whether or not the + * URI includes a fragment. + * + * @return + * An indication of whether or not the + * URI includes a fragment is returned. + */ + bool HasFragment() const; + + /** * This method returns the "fragment" element of the URI, * if it has one. * @@ -267,6 +287,11 @@ namespace Uri { void SetPath(const std::vector< std::string >& path); /** + * This method removes the query element from the URI. + */ + void ClearQuery(); + + /** * This method sets the query element of the URI. * * @param[in] query @@ -275,6 +300,11 @@ namespace Uri { void SetQuery(const std::string& query); /** + * This method removes the fragment element from the URI. + */ + void ClearFragment(); + + /** * This method sets the fragment element of the URI. * * @param[in] fragment |