C++ Actor Framework 0.18
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | Related Functions | List of all members
caf::uri Class Reference

A URI according to RFC 3986. More...

#include <uri.hpp>

Inheritance diagram for caf::uri:
caf::detail::comparable< uri > caf::detail::comparable< uri, string_view >

Classes

struct  authority_type
 Bundles the authority component of the URI, i.e., userinfo, host, and port. More...
 

Public Types

using host_type = variant< std::string, ip_address >
 Host subcomponent of the authority component.
 
using path_list = std::vector< string_view >
 Separates the query component into key-value pairs.
 
using query_map = detail::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
 
urioperator= (uri &&)=default
 
urioperator= (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.
 
string_view str () const noexcept
 Returns the full URI as provided by the user.
 
string_view scheme () const noexcept
 Returns the scheme component.
 
const authority_typeauthority () const noexcept
 Returns the authority component.
 
string_view path () const noexcept
 Returns the path component as provided by the user.
 
const query_mapquery () const noexcept
 Returns the query component as key-value map.
 
string_view fragment () const noexcept
 Returns the fragment component.
 
size_t hash_code () const noexcept
 Returns a hash code over all components.
 
optional< uriauthority_only () const
 Returns a new URI with the authority component only.
 
auto compare (const uri &other) const noexcept
 
auto compare (string_view x) const noexcept
 

Static Public Member Functions

static bool can_parse (string_view str) noexcept
 Returns whether parse would produce a valid URI.
 

Friends

template<class >
struct inspector_access
 

Related Functions

(Note that these are not member functions.)

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 (string_view str, uri &dest)
 
CAF_CORE_EXPORT expected< urimake_uri (string_view str)
 

Detailed Description

A URI according to RFC 3986.

Member Typedef Documentation

◆ host_type

using caf::uri::host_type = variant<std::string, ip_address>

Host subcomponent of the authority component.

Either an IP address or an hostname as string.

Member Function Documentation

◆ authority_only()

optional< uri > caf::uri::authority_only ( ) const

Returns a new URI with the authority component only.

Returns
A new URI in the form scheme://authority if the authority exists, otherwise none.`

The documentation for this class was generated from the following file: