Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
url_view::url_view (2 of 4 overloads)

Construct from a string.

Synopsis
url_view(
    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. Upon successful construction, the view refers to the characters in the buffer pointed to by s. Ownership is not transferred; The caller is responsible for ensuring that the lifetime of the buffer extends until the view is destroyed.

BNF
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

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

Type

Thrown On

std::invalid_argument

parse error.

Parameters

Name

Description

s

The string to parse.

Specification

PrevUpHomeNext