boost::urls::segments_encoded_ref
Mutable encoded path segment proxy
Synopsis
class segments_encoded_ref
: public segments_encoded_base
Types
Name |
Description |
A Bidirectional iterator to a path segment |
|
A Bidirectional iterator to a path segment |
|
The reference type |
|
A signed integer type used to represent differences. |
|
The reference type |
|
An unsigned integer type used to represent size. |
|
The value type |
Member Functions
Name |
Description |
|
Constructor |
Assignment |
|
Assign segments |
|
Return the last segment |
|
Return an iterator to the beginning |
|
Return the referenced character buffer. |
|
Clear the contents of the container |
|
Return true if there are no segments |
|
Return an iterator to the end |
|
Erase segments |
|
Return the first segment |
|
Insert segments |
|
Returns true if this references an absolute path. |
|
Remove the last segment |
|
Append a segment |
|
Replace segments |
|
Return the number of segments |
|
Return the referenced url |
|
Conversion |
Description
Exposes the percent‐encoded segments of a url_base as a bidirectional range that can modify the underlying URL. The proxy uses the URL’s storage directly, so the url must outlive any references.
Example
url u( "/path/to/file.txt" );
segments_encoded_ref ps = u.encoded_segments();
The strings returned when iterators are dereferenced have type pct_string_view and may contain percent‐escapes.
Reserved characters in inputs are automatically escaped. Escapes in inputs are preserved.
Exceptions are thrown on invalid inputs.
Iterator Invalidation
Changes to the underlying character buffer can invalidate iterators which reference it. Modifications made through the container invalidate some or all iterators:
-
push_back: Only `end()`. -
assign,clear,operator=: All elements. -
erase: Erased elements and all elements after (including `end()`). -
insert: All elements at or after the insertion point (including `end()`). -
replace: Modified elements and all elements after (including `end()`).
See Also
Created with MrDocs