boost::urls::params_view

Non‐owning decoded query parameter view

Synopsis

class params_view
    : public params_base

Base Classes

Name Description

params_base

Decoded query parameter helper base

Types

Name

Description

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

Name

Description

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

Name

Description

max_size

Return the maximum number of characters possible

Friends

Name Description

boost::urls::params_ref

Mutable decoded query parameter proxy

boost::urls::params_encoded_view

Non‐owning encoded query parameter view

boost::urls::url_view_base

Common functionality for containers

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.

Created with MrDocs