boost::urls::params_ref

Mutable decoded query parameter proxy

Synopsis

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

Description

This container presents the decoded query parameters of a url_base as a bidirectional range whose modifying operations update the underlying URL in-place. It references (but does not own) the character buffer, so the referenced URL must stay alive while the proxy is used.

Percent escapes in strings returned when dereferencing iterators are automatically decoded. Reserved characters in strings supplied to modifier functions are automatically percent-escaped.

Example

url u( "?first=John&last=Doe" ); params_ref p = u.params();

Iterator Invalidation

Changes to the underlying character buffer can invalidate iterators which reference it. Modifications made through the container invalidate some or all iterators:

Reads vs. writes

Although this is a mutable proxy, all observer helpers inherited from params_base (such as contains, find, and get_or) operate in the same way as they do on params_view: they perform their lookup against the current contents of the referenced URL without modifying 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_ref [constructor]Constructor
operator= Assignment
append Append elements
assign Assign elements
begin Return an iterator to the beginning
buffer Return the referenced character buffer.
clear Clear the contents of the container
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
erase Erase elements
find Find a matching key
find_last Find a matching key
get_or Return the value for a key or a fallback
insert Insert elements
replace Replace elements
set Set a value
size Return the number of params
unset Remove the value on an element
url Return the referenced url
operator params_view Conversion

Static Member Functions

NameDescription
max_size Return the maximum number of characters possible

Friends

|===
Name Description
url_base Common functionality for containers