boost::urls::params_view

Non-owning decoded query parameter view

Synopsis

Declared in <boost/url/params_view.hpp>
class params_view
    : public params_base

Description

This read-only range interprets the query string of a URL as bidirectional key/value pairs with percent-decoding applied on access. It merely references the original character buffer; callers must keep that buffer alive while the view is used.

Example

url_view u( "?first=John&last=Doe" ); params_view p = u.params();

Strings retrieved from the iterators are automatically percent-decoded.

Iterator Invalidation

Changes to the underlying character buffer can invalidate iterators which reference it.

Base Classes

Name Description
params_baseDecoded query parameter helper base

Types

NameDescription
iterator A Bidirectional iterator to a query parameter
const_iterator A Bidirectional iterator to a query parameter
const_reference The reference type
difference_type A signed integer type used to represent differences.
reference The reference type
size_type An unsigned integer type to represent sizes.
value_type The value type

Member Functions

NameDescription
params_view [constructor]Constructor
operator= Assignment
begin Return an iterator to the beginning
buffer Return the referenced character buffer.
contains Return true if a matching key exists
count Return the number of matching keys
empty Return true if there are no params
end Return an iterator to the end
find Find a matching key
find_last Find a matching key
get_or Return the value for a key or a fallback
size Return the number of params

Static Member Functions

NameDescription
max_size Return the maximum number of characters possible

Friends

|===
Name Description
params_ref Mutable decoded query parameter proxy
params_encoded_view Non-owning encoded query parameter view
url_view_base Common functionality for containers