Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
url::url (2 of 5 overloads)

Constructor.

Synopsis
url(
    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 allocating a copy of the passed string.

Example
url u( "https://www.example.com" );
Postconditions
this->buffer().data() != s.data()
Complexity

Linear in s.size().

Exception Safety

Calls to allocate may throw. 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           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
Specification

PrevUpHomeNext