![]() |
Home | Libraries | People | FAQ | More |
Set the port.
static_url& set_port( core::string_view s);
This port is set to the string, which must contain only digits or be empty. An empty port string is distinct from having no port.
assert( url( "http://www.example.com" ).[link url.ref.boost__urls__static_url.set_port `set_port`]( "8080" ).[link url.ref.boost__urls__static_url.authority `authority`]().[link url.ref.boost__urls__static_url.buffer `buffer`]() == "www.example.com:8080" );
this->[link url.ref.boost__urls__static_url.has_port `has_port`]() == true && this->[link url.ref.boost__urls__static_url.port_number `port_number`]() == n && this->[link url.ref.boost__urls__static_url.port `port`]() == std::to_string(n)
Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.
Type |
Thrown On |
---|---|
|
|
Name |
Description |
---|---|
|
The port string to set. |
[link url.ref.boost__urls__static_url.port `port`] = *DIGIT
remove_port
, /root/project/libs/url/include/boost/url/static_url.hpp