Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
static_url_base::encoded_host_and_port

(Inherited from url_view_base)

Return the host and port.

Synopsis
pct_string_view
encoded_host_and_port() const;
Description

If an authority is present, this function returns the host and optional port as a string, which may be empty. Otherwise it returns an empty string. The returned string may contain percent escapes.

Example
assert( [link url.ref.boost__urls__url_view_base.url_view `url_view`]( "http://www.example.com:8080/index.htm" ).[link url.ref.boost__urls__static_url_base.encoded_host_and_port `encoded_host_and_port`]() == "www.example.com:8080" );
Complexity

Constant.

Exception Safety

Throws nothing.

BNF
[link url.ref.boost__urls__static_url_base.authority `authority`]   = [ [link url.ref.boost__urls__static_url_base.userinfo `userinfo`] "@" ] [link url.ref.boost__urls__static_url_base.host `host`] [ ":" [link url.ref.boost__urls__static_url_base.port `port`] ]
Specification
See Also

has_port, port, port_number.


PrevUpHomeNext