diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2018-07-04 19:05:06 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2018-07-04 19:05:06 -0700 |
commit | d95bcc094d5102cbc1b625b69bf6378e3fb730a8 (patch) | |
tree | 62c2ac08f3a8749d64fd9948db75467efb86bd3b /include/Uri/Uri.hpp | |
parent | 872905197e3dbcdf0041930fda67cbd371c240ac (diff) |
Add capability of setting other elements
* userinfo
* port (hasPort)
* path
* fragment
Also include these element when generating string from URI.
Diffstat (limited to 'include/Uri/Uri.hpp')
-rw-r--r-- | include/Uri/Uri.hpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/Uri/Uri.hpp b/include/Uri/Uri.hpp index 0b4a22c..7074990 100644 --- a/include/Uri/Uri.hpp +++ b/include/Uri/Uri.hpp @@ -221,6 +221,14 @@ namespace Uri { void SetScheme(const std::string& scheme); /** + * This method sets the userinfo element of the URI. + * + * @param[in] userinfo + * This is the userinfo to set for the URI. + */ + void SetUserInfo(const std::string& userinfo); + + /** * This method sets the host element of the URI. * * @param[in] host @@ -229,6 +237,36 @@ namespace Uri { void SetHost(const std::string& host); /** + * This method sets the port element of the URI. + * + * @param[in] port + * This is the port to set for the URI. + */ + void SetPort(uint16_t port); + + /** + * This method removes the port element from the URI. + */ + void ClearPort(); + + /** + * This method sets the path element of the URI. + * + * @param[in] path + * This is the sequence of segments to use to form the path + * to set for the URI. + * + * An empty string segment can be used at the front to + * indicate an absolute path (as opposed to a relative one). + * + * An empty string segment can be used at the back to + * make sure the path ends in a delimiter (forward slash) + * when printed out or when combined with another URI + * via the Resolve() method. + */ + void SetPath(const std::vector< std::string >& path); + + /** * This method sets the query element of the URI. * * @param[in] query @@ -237,6 +275,14 @@ namespace Uri { void SetQuery(const std::string& query); /** + * This method sets the fragment element of the URI. + * + * @param[in] fragment + * This is the fragment to set for the URI. + */ + void SetFragment(const std::string& fragment); + + /** * This method constructs and returns the string * rendering of the URI, according to the rules * in RFC 3986 (https://tools.ietf.org/html/rfc3986). |