...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Set the user.
url_base& 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().set_encoded_user("john%20doe").userinfo() == "john doe" );
this->has_authority() == true && this->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. |
userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" )
remove_password
, set_encoded_password
, set_password
, set_user
.