Home | Libraries | People | FAQ | More |
Set the path.
url_base& set_path( string_view s);
This function sets the path to the string, which may be empty. 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 will be semantically affected.
url u( "http://www.example.com" ); u.set_path( "path/to/file.txt" ); assert( u.path() == "/path/to/file.txt" );
Linear in this->size() + s.size()
.
Strong guarantee. Calls to allocate may throw.
Name |
Description |
---|---|
|
The string to set. |
path = path-abempty ; begins with "/" or is empty / path-absolute ; begins with "/" but not "//" / path-noscheme ; begins with a non-colon segment / path-rootless ; begins with a segment / path-empty ; zero characters path-abempty = *( "/" segment ) path-absolute = "/" [ segment-nz *( "/" segment ) ] path-noscheme = segment-nz-nc *( "/" segment ) path-rootless = segment-nz *( "/" segment ) path-empty = 0<pchar>
encoded_segments
, segments
, set_encoded_path
, set_path_absolute
.