![]() |
Home | Libraries | People | FAQ | More |
(Inherited from url_view_base
)
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( [link url.ref.boost__urls__url_view_base.url_view `url_view`]( "https://[1::6:c0a8:1]/" ).[link url.ref.boost__urls__static_url.host_address `host_address`]() == "1::6:c0a8:1" );
Linear in this->host_address().size()
.
Calls to allocate may throw.
[link url.ref.boost__urls__static_url.host `host`] = IP-literal / IPv4address / reg-[link url.ref.boost__urls__host_type `name`] IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-[link url.ref.boost__urls__host_type `name`] = *( unreserved / pct-encoded / "-" / "." )