Home | Libraries | People | FAQ | More |
Return the host.
template< class StringToken = string_token::return_string> StringToken::result_type host_address( StringToken&& token = {}) const;
The value returned by this function depends on the type of host returned
from the function host_type
.
host_type::ipv4
, then the IPv4 address
string is returned.
host_type::ipv6
, then the IPv6 address
string is returned, without any enclosing brackets.
host_type::ipvfuture
, then the IPvFuture
address string is returned, without any enclosing brackets.
host_type::name
, then the host name string
is returned. Any percent-escapes in the string are decoded first.
host_type::none
, then an empty string
is returned.
assert( url_view( "https://[1::6:c0a8:1]/" ).host_address() == "1::6:c0a8:1" );
Linear in this->host_address().size()
.
Calls to allocate may throw.
host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".")