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_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( url_view( "http://www.example.com:8080/index.htm" ).encoded_host_and_port() == "www.example.com:8080" );
Complexity

Constant.

Exception Safety

Throws nothing.

BNF
authority   = [ userinfo "@" ] host [ ":" port ]
Specification
See Also

has_port, port, port_number.


PrevUpHomeNext