![]() |
Home | Libraries | People | FAQ | More |
(Inherited from url_base
)
Set the host to a name.
url_base& set_encoded_host_name( pct_string_view s);
The host is set to the specified string, which may contain percent-escapes
and can be empty. Escapes in the string are preserved, and reserved characters
in the string are percent-escaped in the result. The host type is host_type::name
.
assert( [link url.ref.boost__urls__url_base.url `url`]( "http://www.example.com/index.htm" ).[link url.ref.boost__urls__static_url_base.set_encoded_host_name `set_encoded_host_name`]( "localhost" ).[link url.ref.boost__urls__static_url_base.host_address `host_address`]() == "localhost" );
this->[link url.ref.boost__urls__static_url_base.has_authority `has_authority`]() == true && this->[link url.ref.boost__urls__static_url_base.host_ipv6_address `host_ipv6_address`]() == addr && this->[link url.ref.boost__urls__static_url_base.host_type `host_type`]() == [link url.ref.boost__urls__host_type `host_type::name`]
Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.
Type |
Thrown On |
---|---|
|
|
Name |
Description |
---|---|
|
The string to set. |
reg-[link url.ref.boost__urls__host_type `name`] = *( unreserved / pct-encoded / "-" / "." )
set_encoded_host
, set_encoded_host_address
, set_host
,
set_host_address
, set_host_ipv4
, set_host_ipv6
, set_host_ipvfuture
, set_host_name
.