boost::urls::params_encoded_ref
Mutable encoded query parameter proxy
Synopsis
class params_encoded_ref
: public params_encoded_base
Types
Name |
Description |
A Bidirectional iterator to a query parameter |
|
A Bidirectional iterator to a query parameter |
|
The reference type |
|
A signed integer type used to represent differences. |
|
The reference type |
|
An unsigned integer type to represent sizes. |
|
The value type |
Member Functions
Name |
Description |
|
Constructor |
Assignment |
|
Append params |
|
Assign params |
|
Return an iterator to the beginning |
|
Return the query corresponding to these params |
|
Clear the contents of the container |
|
Return true if a matching key exists |
|
Return the number of matching keys |
|
Return true if there are no params |
|
Return an iterator to the end |
|
Erase params |
|
Find a matching key |
|
Find a matching key |
|
Return the value for a key or a fallback |
|
Insert params |
|
Replace params |
|
Set a value |
|
Return the number of params |
|
Remove the value on an element |
|
Return the referenced url |
|
Conversion |
Description
This container exposes the percent‐encoded query parameters of a url_base as a bidirectional range while allowing mutation of the underlying URL. It references the URL’s buffer directly, so the url must stay alive for the lifetime of the proxy.
Example
url u( "?first=John&last=Doe" );
params_encoded_ref p = u.encoded_params();
Strings produced when elements are returned have type param_pct_view and represent encoded strings. Strings passed to member functions may contain percent escapes, and throw exceptions on invalid inputs.
Iterator Invalidation
Changes to the underlying character buffer can invalidate iterators which reference it. Modifications made through the container invalidate some iterators to the underlying character buffer:
-
append: Only `end()`. -
assign,clear, `operator=` : All params. -
erase: Erased params and all params after (including `end()`). -
insert: All params at or after the insertion point (including `end()`). -
replace,set: Modified params and all params after (including `end()`).
Reads vs. writes
Even though this type can be used to mutate the referenced URL, this is still a proxy and every observer function inherited from params_encoded_base (for example contains, find, and get_or) behaves like the corresponding function on params_encoded_view: it inspects the current encoded query and does not perform any modifications.
Created with MrDocs