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 579430ad1f.
PrevUpHomeNext
url_view::url_view (3 of 5 overloads)

Constructor.

Synopsis
template<
    class String>
url_view(
    String const& 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.

Exceptions

Type

Thrown On

system_error

The input failed to parse correctly.

Parameters

Name

Description

s

The string to parse.

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

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

/root/project/libs/url/include/boost/url/url_view.hpp


PrevUpHomeNext