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 064f557086.
PrevUpHomeNext
params_encoded_view::params_encoded_view (3 of 3 overloads)

Constructor.

Synopsis
params_encoded_view(
    core::string_view s);
Description

This function constructs params from a valid query parameter string, which can contain percent escapes. Unlike the parameters in URLs, the string passed here should not start with "?". Upon construction, the view references the character buffer pointed to by s. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced.

Example
params_encoded_view qp( "first=John&last=Doe" );
Effects
return parse_query( s ).value();
Postconditions
this->buffer().data() == s.data()
Complexity

Linear in s.

Exception Safety

Exceptions thrown on invalid input.

Exceptions

Type

Thrown On

system_error

s contains an invalid query parameter string.

Parameters

Name

Description

s

The string to parse.

BNF
query-params    = [ query-param ] *( "&" query-param )

query-param     = key [ "=" value ]
Specification

PrevUpHomeNext