Skip to content

Commit

Permalink
feat: set_params supports encoding_opts
Browse files Browse the repository at this point in the history
fix #856
  • Loading branch information
alandefreitas committed Aug 16, 2024
1 parent a2fe1db commit 5b6b79f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion include/boost/url/url_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,7 @@ class BOOST_URL_DECL
Linear.
@param ps The params to set.
@param opt The options for encoding.
@par BNF
@code
Expand All @@ -2275,7 +2276,9 @@ class BOOST_URL_DECL
@ref set_query.
*/
url_base&
set_params( std::initializer_list<param_view> ps ) noexcept;
set_params(
std::initializer_list<param_view> ps,
encoding_opts opt = {}) noexcept;

/** Set the query params
Expand Down
6 changes: 4 additions & 2 deletions src/url_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1413,9 +1413,11 @@ encoded_params() noexcept

url_base&
url_base::
set_params( std::initializer_list<param_view> ps ) noexcept
set_params(
std::initializer_list<param_view> ps,
encoding_opts opt) noexcept
{
params().assign(ps);
params(opt).assign(ps);
return *this;
}

Expand Down

0 comments on commit 5b6b79f

Please sign in to comment.