...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
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" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" );
this->has_port() == true && this->port_number() == n && this->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. |
port = *DIGIT
remove_port
, /root/project/libs/url/include/boost/url/static_url.hpp