boost::urls::segments_ref
Mutable decoded path segment proxy
Synopsis
Declared in <boost/url/segments_ref.hpp>
class segments_ref
: public segments_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
Presents the decoded path segments of a url_base as a bidirectional range whose modifiers update the underlying URL. The proxy references the URL’s storage directly, so the owning URL must remain alive while the proxy is used.
Example
url u( "/path/to/file.txt" );
segments_ref ps = u.segments();
Percent escapes in strings returned when dereferencing iterators are automatically decoded. Reserved characters in strings supplied to modifier functions are automatically percent‐escaped.
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
segments_encoded_ref, segments_encoded_view, segments_view.
Created with MrDocs