Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 9fc5439165.
PrevUpHomeNext
static_url_base::set_host_name

(Inherited from url_base)

Set the host to a name.

Synopsis
url_base&
set_host_name(
    string_view s);
Description

The host is set to the specified string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type will be host_type::name.

Example
assert( url( "http://www.example.com/index.htm").set_host_name( "localhost" ).host_address() == "localhost" );
Postconditions
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
Exception Safety

Strong guarantee. Calls to allocate may throw.

Parameters

Name

Description

s

The string to set.

BNF
reg-name    = *( unreserved / pct-encoded / "-" / ".")
Specification
See Also

set_encoded_host, set_encoded_host_address, set_encoded_host_name, set_host, set_host_address, set_host_ipvfuture.


PrevUpHomeNext