From ea3d03583c4cd2443220eddfedefcea51b7121c5 Mon Sep 17 00:00:00 2001
From: Richard Walters <rwalters@digitalstirling.com>
Date: Wed, 4 Jul 2018 19:21:55 -0700
Subject: 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.
---
 include/Uri/Uri.hpp | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

(limited to 'include')

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
@@ -163,6 +163,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.
@@ -175,6 +185,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.
@@ -266,6 +286,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.
          *
@@ -274,6 +299,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.
          *
-- 
cgit v1.2.3