![]() |
Home | Libraries | People | FAQ | More |
Set the user.
static_url& set_encoded_user( pct_string_view s);
This function sets the user part of the userinfo the the string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result.
assert( url().[link url.ref.boost__urls__static_url.set_encoded_user `set_encoded_user`]( "john%20doe" ).[link url.ref.boost__urls__static_url.userinfo `userinfo`]() == "john doe" );
this->[link url.ref.boost__urls__static_url.has_authority `has_authority`]() == true && this->[link url.ref.boost__urls__static_url.has_userinfo `has_userinfo`]() == true
Linear in this->size() + s.size()
.
Strong guarantee. Calls to allocate may throw.
Type |
Thrown On |
---|---|
|
|
Name |
Description |
---|---|
|
The string to set. |
[link url.ref.boost__urls__static_url.userinfo `userinfo`] = [ [ [link url.ref.boost__urls__static_url.user `user`] ] [ ':' [link url.ref.boost__urls__static_url.password `password`] ] ] [link url.ref.boost__urls__static_url.user `user`] = *( unreserved / pct-encoded / sub-delims ) [link url.ref.boost__urls__static_url.password `password`] = *( unreserved / pct-encoded / sub-delims / ":" )
remove_password
, set_encoded_password
, set_password
, /root/project/libs/url/include/boost/url/static_url.hpp