Set a value
<include/boost/url/params_encoded_ref.hpp>
iterator
set(
iterator pos,
pct_string_view value);
» more...
iterator
set(
pct_string_view key,
pct_string_view value,
ignore_case_param ic = = {});
» more...
This function replaces the value of an element at the specified position.
All iterators that are equal to `pos` or come after are invalidated.
The string passed in must not come from the element being replaced, or else the behavior is undefined.
url u( "?id=42&id=69" );
u.encoded_params().set( u.encoded_params().begin(), "none" );
assert( u.encoded_query() == "id=none&id=69" );
Calls to allocate may throw. Exceptions thrown on invalid input.
Name | Thrown on |
---|---|
[object Object] |
contains an invalid percent-encoding. |
[object Object] |
or `value` contain an invalid percent-encoding. |
An iterator to the element.
Name | Description |
---|---|
pos | An iterator to the element. |
value | The value to assign. The empty string still counts as a value. That is, `has_value` for the element is true. |
key | The key to match. By default, a case-sensitive comparison is used. |
ic | An optional parameter. If the value ignore_case is passed here, the comparison is case-insensitive. |