![]() |
Home | Libraries | People | FAQ | More |
Set the path.
url& set_encoded_path( pct_string_view s);
This function sets the path to the string, which may contain percent-escapes and can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result.
The library may adjust the final result to ensure that no other parts of the url is semantically affected.
[link url.ref.boost__urls__url.url `url`] u( "http://www.example.com" ); u.set_encoded_path( "path/to/file.txt" ); assert( u.encoded_path() == "/path/to/file.txt" );
Linear in this->size() + s.size()
.
Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.
Type |
Thrown On |
---|---|
|
|
Name |
Description |
---|---|
|
The string to set. |
[link url.ref.boost__urls__url.path `path`] = [link url.ref.boost__urls__url.path `path`]-abempty ; begins with "/" or is [link url.ref.boost__urls__url.empty `empty`] / [link url.ref.boost__urls__url.path `path`]-absolute ; begins with "/" but not "//" / [link url.ref.boost__urls__url.path `path`]-noscheme ; begins with a non-colon segment / [link url.ref.boost__urls__url.path `path`]-rootless ; begins with a segment / [link url.ref.boost__urls__url.path `path`]-[link url.ref.boost__urls__url.empty `empty`] ; zero characters [link url.ref.boost__urls__url.path `path`]-abempty = *( "/" segment ) [link url.ref.boost__urls__url.path `path`]-absolute = "/" [ segment-nz *( "/" segment ) ] [link url.ref.boost__urls__url.path `path`]-noscheme = segment-nz-nc *( "/" segment ) [link url.ref.boost__urls__url.path `path`]-rootless = segment-nz *( "/" segment ) [link url.ref.boost__urls__url.path `path`]-[link url.ref.boost__urls__url.empty `empty`] = 0<pchar>
encoded_segments
, segments
, set_path
, /root/project/libs/url/include/boost/url/url.hpp