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 e70692e4d8.
PrevUpHomeNext
url_view::encoded_host_name

Return the host name.

Synopsis
pct_string_view
encoded_host_name() const;
Description

If the host type is host_type::name, this function returns the name as a string. Otherwise, if the host type is not an name, it returns an empty string. The returned string may contain percent escapes.

Example
assert( url_view( "https://www%2droot.example.com/" ).encoded_host_name() == "www%2droot.example.com" );
Complexity

Constant.

Exception Safety

Throws nothing.

BNF
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

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

PrevUpHomeNext