Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
static_url::static_url (2 of 4 overloads)

Constructor.

Synopsis
static_url(
    core::string_view s);
Description

This function constructs a url from the string s, which must contain a valid URI or relative-ref or else an exception is thrown. The new url retains ownership by making a copy of the passed string.

Example
static_url< 1024 > u( "https://www.example.com" );
Effects
return [link url.ref.boost__urls__static_url.static_url `static_url`]( [link url.ref.boost__urls__parse_uri_reference `parse_uri_reference`]( s ).value() );
Postconditions
this->[link url.ref.boost__urls__static_url.buffer `buffer`]().data() != s.data()
Complexity

Linear in s.size().

Exception Safety

Exceptions thrown on invalid input.

Exceptions

Type

Thrown On

system_error

The input does not contain a valid url.

Parameters

Name

Description

s

The string to parse.

BNF
URI           = [link url.ref.boost__urls__scheme `scheme`] ":" hier-part [ "?" [link url.ref.boost__urls__static_url.query `query`] ] [ "#" [link url.ref.boost__urls__static_url.fragment `fragment`] ]

relative-[link url.ref.boost__urls__grammar__ref `ref`]  = relative-part [ "?" [link url.ref.boost__urls__static_url.query `query`] ] [ "#" [link url.ref.boost__urls__static_url.fragment `fragment`] ]
Specification

PrevUpHomeNext