![]() |
Home | Libraries | People | FAQ | More |
Set the user.
url& set_user( core::string_view s);
This function sets the user part of the userinfo to the string. Any special or reserved characters in the string are automatically percent-encoded.
assert( [link url.ref.boost__urls__url.url `url`]().[link url.ref.boost__urls__url.set_user `set_user`]( "john doe" ).[link url.ref.boost__urls__url.encoded_userinfo `encoded_userinfo`]() == "john%20doe" );
this->[link url.ref.boost__urls__url.has_authority `has_authority`]() == true && this->[link url.ref.boost__urls__url.has_userinfo `has_userinfo`]() == true
Linear in this->size() + s.size()
.
Strong guarantee. Calls to allocate may throw.
Name |
Description |
---|---|
|
The string to set. |
[link url.ref.boost__urls__url.userinfo `userinfo`] = [ [ [link url.ref.boost__urls__url.user `user`] ] [ ':' [link url.ref.boost__urls__url.password `password`] ] ] [link url.ref.boost__urls__url.user `user`] = *( unreserved / pct-encoded / sub-delims ) [link url.ref.boost__urls__url.password `password`] = *( unreserved / pct-encoded / sub-delims / ":" )
remove_password
, set_encoded_password
, set_encoded_user
, /root/project/libs/url/include/boost/url/url.hpp