From 8c752fdcf71f1d8f3980c8066e2bedf782d9739c Mon Sep 17 00:00:00 2001
From: Richard Walters <rwalters@digitalstirling.com>
Date: Sat, 30 Jun 2018 22:30:19 -0700
Subject: Add more element parsing of URIs

* Add IsRelativeReference.
* Add IsRelativePath.
* Add Query.
* Add Fragment.
* Add UserInfo.
* Fix parsing of URIs that have no scheme.
---
 include/Uri/Uri.hpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

(limited to 'include/Uri')

diff --git a/include/Uri/Uri.hpp b/include/Uri/Uri.hpp
index 4907aaf..8be3dd0 100644
--- a/include/Uri/Uri.hpp
+++ b/include/Uri/Uri.hpp
@@ -60,6 +60,17 @@ namespace Uri {
          */
         std::string GetScheme() const;
 
+        /**
+         * This method returns the "UserInfo" element of the URI.
+         *
+         * @return
+         *     The "UserInfo" element of the URI is returned.
+         *
+         * @retval ""
+         *     This is returned if there is no "UserInfo" element in the URI.
+         */
+        std::string GetUserInfo() const;
+
         /**
         * This method returns the "host" element of the URI.
         *
@@ -108,6 +119,50 @@ namespace Uri {
          */
         uint16_t GetPort() const;
 
+        /**
+         * This method returns an indication of whether or not
+         * the URI is a relative reference.
+         *
+         * @return
+         *     An indication of whether or not the URI is a
+         *     relative reference is returned.
+         */
+        bool IsRelativeReference() const;
+
+        /**
+         * This method returns an indication of whether or not
+         * the URI contains a relative path.
+         *
+         * @return
+         *     An indication of whether or not the URI contains a
+         *     relative path is returned.
+         */
+        bool ContainsRelativePath() const;
+
+        /**
+         * This method returns the "query" element of the URI,
+         * if it has one.
+         *
+         * @return
+         *     The "query" element of the URI is returned.
+         *
+         * @retval ""
+         *     This is returned if there is no "query" element in the URI.
+         */
+        std::string GetQuery() const;
+
+        /**
+         * This method returns the "fragment" element of the URI,
+         * if it has one.
+         *
+         * @return
+         *     The "fragment" element of the URI is returned.
+         *
+         * @retval ""
+         *     This is returned if there is no "fragment" element in the URI.
+         */
+        std::string GetFragment() const;
+
         // Private properties
     private:
         /**
-- 
cgit v1.2.3