|
C++ Actor Framework 1.0.0
|
A URI according to RFC 3986. More...
#include <uri.hpp>
Classes | |
| struct | authority_type |
| Bundles the authority component of the URI, i.e., userinfo, host, and port. More... | |
| struct | userinfo_type |
| Userinfo subcomponent of the authority component. More... | |
Public Types | |
| using | host_type = std::variant<std::string, ip_address> |
| Host subcomponent of the authority component. | |
| using | path_list = std::vector<std::string_view> |
| Separates the query component into key-value pairs. | |
| using | query_map = unordered_flat_map<std::string, std::string> |
| Separates the query component into key-value pairs. | |
| using | impl_ptr = intrusive_ptr<impl_type> |
| Pointer to implementation. | |
Public Member Functions | |
| uri (uri &&)=default | |
| uri (const uri &)=default | |
| uri & | operator= (uri &&)=default |
| uri & | operator= (const uri &)=default |
| uri (impl_ptr ptr) | |
| bool | empty () const noexcept |
| Returns whether all components of this URI are empty. | |
| bool | valid () const noexcept |
| Returns whether the URI contains valid content. | |
| std::string_view | str () const noexcept |
| Returns the full URI as provided by the user. | |
| std::string_view | scheme () const noexcept |
| Returns the scheme component. | |
| const authority_type & | authority () const noexcept |
| Returns the authority component. | |
| std::string_view | path () const noexcept |
| Returns the path component as provided by the user. | |
| const query_map & | query () const noexcept |
| Returns the query component as key-value map. | |
| std::string_view | fragment () const noexcept |
| Returns the fragment component. | |
| std::string | host_str () const |
| Returns the host sub-component of the authority as string. | |
| std::string | path_query_fragment () const |
| Returns the path, query and fragment components (as they appear in the encoded URI) with a leading '/'. | |
| size_t | hash_code () const noexcept |
| Returns a hash code over all components. | |
Static Public Member Functions | |
| static bool | can_parse (std::string_view str) noexcept |
Returns a new URI with the authority component only. | |
| static void | encode (std::string &str, std::string_view x, bool is_path=false) |
| static void | decode (std::string &str) |
Friends | |
| template<class > | |
| struct | inspector_access |
Related Symbols | |
(Note that these are not member symbols.) | |
| CAF_CORE_EXPORT std::string | to_string (const uri &x) |
| CAF_CORE_EXPORT std::string | to_string (const uri::authority_type &x) |
| CAF_CORE_EXPORT error | parse (std::string_view str, uri &dest) |
| CAF_CORE_EXPORT expected< uri > | make_uri (std::string_view str) |
A URI according to RFC 3986.
| using caf::uri::host_type = std::variant<std::string, ip_address> |
Host subcomponent of the authority component.
Either an IP address or an hostname as string.
|
staticnoexcept |
Returns a new URI with the authority component only.
scheme://authority if the authority exists, otherwise none.` std::optional<uri> authority_only() const;– comparison ----------------------------------------------------------—
auto compare(const uri& other) const noexcept { return str().compare(other.str()); }
auto compare(std::string_view x) const noexcept { return str().compare(x); }
– parsing -------------------------------------------------------------—
/ Returns whether parse would produce a valid URI.