![]() |
Home | Libraries | People | FAQ | More |
Set the scheme.
url_base& set_scheme_id( scheme id);
This function sets the scheme to the specified known urls::scheme
id, which may not be scheme::unknown
or else an exception is thrown. If the id is scheme::none
, this function behaves as
if remove_scheme
were called.
assert( [link url.ref.boost__urls__url_base.url `url`]( "http://example.com/echo.cgi" ).[link url.ref.boost__urls__url_base.set_scheme_id `set_scheme_id`]( [link url.ref.boost__urls__scheme `scheme::wss`] ).[link url.ref.boost__urls__url_base.buffer `buffer`]() == "wss://example.com/echo.cgi" );
Linear in this->size()
.
Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.
Type |
Thrown On |
---|---|
|
The scheme is invalid. |
Name |
Description |
---|---|
|
The scheme to set. |