[#255B09B5774049DF6917247ABA3D257B26A9371D]

Function url_view:: url_view

Constructor

Synopsis

            url_view(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. 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 it is no longer referenced.

Example

url_view u( "http://www.example.com/index.htm" );

Effects

return parse_uri_reference( s ).value();

Complexity

Linear in `s.size()`.

Exception Safety

Exceptions thrown on invalid input.

BNF

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

Specification

  • 4.1. URI Reference