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 41715b1c50.
PrevUpHomeNext
static_url::set_scheme

(Inherited from url_base)

Set the scheme.

Synopsis
url_base&
set_scheme(
    string_view s);
Description

The scheme is set to the specified string, which must contain a valid scheme without any trailing colon (':'). Note that schemes are case-insensitive, and the canonical form is lowercased.

Example
assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https );
Complexity

Linear in this->size() + s.size().

Exception Safety

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

Exceptions

Type

Thrown On

system_error

s contains an invalid scheme.

Parameters

Name

Description

s

The scheme to set.

BNF
scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
Specification
See Also

remove_scheme.


PrevUpHomeNext