Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
url::remove_port

Remove the port.

Synopsis
url&
remove_port();
Description

If a port exists, it is removed. The rest of the authority is unchanged.

Example
assert( [link url.ref.boost__urls__url.url `url`]( "http://www.example.com:80" ).[link url.ref.boost__urls__url.remove_port `remove_port`]().[link url.ref.boost__urls__url.authority `authority`]().[link url.ref.boost__urls__url.buffer `buffer`]() == "www.example.com" );
Postconditions
this->[link url.ref.boost__urls__url.has_port `has_port`]() == false && this->[link url.ref.boost__urls__url.port_number `port_number`]() == 0 && this->[link url.ref.boost__urls__url.port `port`]() == ""
Complexity

Linear in this->size().

Exception Safety

Throws nothing.

BNF
[link url.ref.boost__urls__url.authority `authority`]     = [ [link url.ref.boost__urls__url.userinfo `userinfo`] "@" ] [link url.ref.boost__urls__url.host `host`] [ ":" [link url.ref.boost__urls__url.port `port`] ]

[link url.ref.boost__urls__url.port `port`]          = *DIGIT
Specification
See Also

/root/project/libs/url/include/boost/url/url.hpp


PrevUpHomeNext