:relfileprefix: ../../
[#12F697DD298D4C0B5A8B629FE8A99ADDF5244E44]

= Class segments_encoded_view

pass:v,q[A view representing path segments in a URL]


== Synopsis

Declared in header `</boost/url/segments_encoded_view.hpp#L61[boost/url/segments_encoded_view.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
class segments_encoded_view
    : public xref:boost/urls/segments_encoded_base.adoc[segments_encoded_base];
----

==  Types
[,cols=2]
|===
|Name |Description
|xref:boost/urls/segments_encoded_base/const_iterator.adoc[`pass:v[const_iterator]`] |
xref:boost/urls/segments_encoded_base/iterator.adoc[iterator]

|xref:boost/urls/segments_encoded_base/const_reference.adoc[`pass:v[const_reference]`] |
pass:v,q[The reference type]

|xref:boost/urls/segments_encoded_base/difference_type.adoc[`pass:v[difference_type]`] |
pass:v,q[A signed integer type used to represent differences.]

|xref:boost/urls/segments_encoded_base/iterator.adoc[`pass:v[iterator]`] |

|xref:boost/urls/segments_encoded_base/reference.adoc[`pass:v[reference]`] |
pass:v,q[The reference type]

|xref:boost/urls/segments_encoded_base/size_type.adoc[`pass:v[size_type]`] |
pass:v,q[An unsigned integer type used to represent size.]

|xref:boost/urls/segments_encoded_base/value_type.adoc[`pass:v[value_type]`] |
pass:v,q[The value type]

|===
==  Member Functions
[,cols=2]
|===
|Name |Description
|xref:boost/urls/segments_encoded_base/back.adoc[`pass:v[back]`] |
pass:v,q[Return the last segment]

|xref:boost/urls/segments_encoded_base/begin.adoc[`pass:v[begin]`] |
pass:v,q[Return an iterator to the beginning]

|xref:boost/urls/segments_encoded_base/buffer.adoc[`pass:v[buffer]`] |
pass:v,q[Return the referenced character buffer.]

|xref:boost/urls/segments_encoded_base/empty.adoc[`pass:v[empty]`] |
pass:v,q[Return true if there are no segments]

|xref:boost/urls/segments_encoded_base/end.adoc[`pass:v[end]`] |
pass:v,q[Return an iterator to the end]

|xref:boost/urls/segments_encoded_base/front.adoc[`pass:v[front]`] |
pass:v,q[Return the first segment]

|xref:boost/urls/segments_encoded_base/is_absolute.adoc[`pass:v[is_absolute]`] |
pass:v,q[Returns true if this references an absolute path.]

|xref:boost/urls/segments_encoded_view/2conversion.adoc[`pass:v[operator segments_view]`] |
pass:v,q[Conversion]

|xref:boost/urls/segments_encoded_view/operator_assign.adoc[`pass:v[operator=]`] |
pass:v,q[Assignment]

|xref:boost/urls/segments_encoded_view/2constructor.adoc[`pass:v[segments_encoded_view]`] |
pass:v,q[Constructor]

|xref:boost/urls/segments_encoded_base/size.adoc[`pass:v[size]`] |
pass:v,q[Return the number of segments]

|===
==  Static Member Functions
[,cols=2]
|===
|Name |Description
|xref:boost/urls/segments_encoded_base/max_size.adoc[`pass:v[max_size]`] |
pass:v,q[Return the maximum number of characters possible]

|===
==  Friends
[,cols=2]
|===
|Name |Description
|xref:boost/urls/segments_encoded_view/8friend.adoc[`pass:v[parse_path]`] |

|===

== Description

pass:v,q[Objects of this type are used to interpret] pass:v,q[the path as a bidirectional view of segment]
pass:v,q[strings.]
pass:v,q[The view does not retain ownership of the]
pass:v,q[elements and instead references the original]
pass:v,q[character buffer. The caller is responsible]
pass:v,q[for ensuring that the lifetime of the buffer]
pass:v,q[extends until it is no longer referenced.]

=== Example
[,cpp]
----
url_view u( "/path/to/file.txt" );

segments_encoded_view ps = u.encoded_segments();

assert( ps.buffer().data() == u.buffer().data() );
----
pass:v,q[Strings produced when elements are returned]
pass:v,q[have type]
xref:boost/urls/param_pct_view.adoc[param_pct_view]
pass:v,q[and represent]
pass:v,q[encoded strings. Strings passed to member]
pass:v,q[functions may contain percent escapes, and]
pass:v,q[throw exceptions on invalid inputs.]

=== Iterator Invalidation
pass:v,q[Changes to the underlying character buffer]
pass:v,q[can invalidate iterators which reference it.]



