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 20a7dc9240.
PrevUpHomeNext
static_url_base::set_scheme_id

(Inherited from url_base)

Set the scheme.

Synopsis
url_base&
set_scheme_id(
    scheme id);
Description

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.

Example
assert( url( "http://example.com/echo.cgi" ).set_scheme_id( scheme::wss ).buffer() == "wss://example.com/echo.cgi" );
Complexity

Linear in this->size().

Exception Safety

Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.

Exceptions

Type

Thrown On

system_error

The scheme is invalid.

Parameters

Name

Description

id

The scheme to set.

Specification

PrevUpHomeNext