[#boost-urls-segments_ref] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::segments_ref :relfileprefix: ../../ :mrdocs: Mutable decoded path segment proxy == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#Lundefined[boost/url/segments_ref.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class segments_ref : public xref:boost/urls/segments_base.adoc[segments_base] ---- == Description Presents the decoded path segments of a xref:boost/urls/url_base.adoc[`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 [,cpp] ---- 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: * xref:boost/urls/segments_ref/push_back.adoc[`push_back`] : Only `end()`. * xref:boost/urls/segments_ref/assign-0c.adoc[`assign`], xref:boost/urls/segments_ref/clear.adoc[`clear`], xref:boost/urls/segments_ref/operator_assign-0a.adoc[`operator=`] : All elements. * xref:boost/urls/segments_ref/erase-0e.adoc[`erase`] : Erased elements and all elements after (including `end()`). * xref:boost/urls/segments_ref/insert-0a.adoc[`insert`] : All elements at or after the insertion point (including `end()`). * xref:boost/urls/segments_ref/replace-0d.adoc[`replace`] : Modified elements and all elements after (including `end()`). == Base Classes [cols="1,4"] |=== |Name|Description | `xref:boost/urls/segments_base.adoc[segments_base]` | Decoded path segment helper base |=== == Types [cols="1,4"] |=== | Name| Description | xref:boost/urls/segments_ref/iterator.adoc[`iterator`] | A Bidirectional iterator to a path segment | xref:boost/urls/segments_base/const_iterator.adoc[`const_iterator`] | A Bidirectional iterator to a path segment | xref:boost/urls/segments_base/const_reference.adoc[`const_reference`] | The reference type | xref:boost/urls/segments_base/difference_type.adoc[`difference_type`] | A signed integer type used to represent differences. | xref:boost/urls/segments_base/reference.adoc[`reference`] | The reference type | xref:boost/urls/segments_base/size_type.adoc[`size_type`] | An unsigned integer type used to represent size. | xref:boost/urls/segments_base/value_type.adoc[`value_type`] | The value type |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:boost/urls/segments_ref/2constructor-09.adoc[`segments_ref`] [.small]#[constructor]# | Constructor | xref:boost/urls/segments_ref/operator_assign-0a.adoc[`operator=`] | Assignment | xref:boost/urls/segments_ref/assign-0c.adoc[`assign`] | Assign segments | xref:boost/urls/segments_base/back.adoc[`back`] | Return the last segment | xref:boost/urls/segments_base/begin.adoc[`begin`] | Return an iterator to the beginning | xref:boost/urls/segments_base/buffer.adoc[`buffer`] | Return the referenced character buffer. | xref:boost/urls/segments_ref/clear.adoc[`clear`] | Clear the contents of the container | xref:boost/urls/segments_base/empty.adoc[`empty`] | Return true if there are no segments | xref:boost/urls/segments_base/end.adoc[`end`] | Return an iterator to the end | xref:boost/urls/segments_ref/erase-0e.adoc[`erase`] | Erase segments | xref:boost/urls/segments_base/front.adoc[`front`] | Return the first segment | xref:boost/urls/segments_ref/insert-0a.adoc[`insert`] | Insert segments | xref:boost/urls/segments_base/is_absolute.adoc[`is_absolute`] | Returns true if this references an absolute path. | xref:boost/urls/segments_ref/pop_back.adoc[`pop_back`] | Remove the last segment | xref:boost/urls/segments_ref/push_back.adoc[`push_back`] | Append a segment | xref:boost/urls/segments_ref/replace-0d.adoc[`replace`] | Replace segments | xref:boost/urls/segments_base/size.adoc[`size`] | Return the number of segments | xref:boost/urls/segments_ref/url.adoc[`url`] | Return the referenced url | xref:boost/urls/segments_ref/2conversion.adoc[`operator segments_view`] | Conversion |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:boost/urls/segments_base/max_size.adoc[`max_size`] | Return the maximum number of characters possible |=== == Friends [cols="1,4"] |=== |Name|Description | `xref:boost/urls/segments_encoded_ref.adoc[boost::urls::segments_encoded_ref]` | Mutable encoded path segment proxy | `xref:boost/urls/url_base.adoc[boost::urls::url_base]` | Common functionality for containers |=== == See Also xref:boost/urls/segments_encoded_ref.adoc[`segments_encoded_ref`], xref:boost/urls/segments_encoded_view.adoc[`segments_encoded_view`], xref:boost/urls/segments_view.adoc[`segments_view`]. [.small]#Created with https://www.mrdocs.com[MrDocs]#