:relfileprefix: ../../../
[#E88B9FD7F68173C8F5BD93C8759508F88B9492C1]

= Function segments_view::segments_view

pass:v,q[Constructor]


== Synopsis

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

[source,cpp,subs="verbatim,macros,-callouts"]
----
segments_view(string_view s);
----

== Description

pass:v,q[This function constructs segments from] pass:v,q[a valid path string, which can contain]
pass:v,q[percent escapes.]
pass:v,q[Upon construction, the view references]
pass:v,q[the character buffer pointed to by `s`.]
pass:v,q[caller is responsible for ensuring]
pass:v,q[that the lifetime of the buffer]
pass:v,q[extends until the view is destroyed.]

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

=== Effects
[,cpp]
----
return parse_path( s ).value();
----

=== Postconditions
[,cpp]
----
this->buffer().data() == s.data()
----

=== Complexity
pass:v,q[Linear in `s`.]

=== Exception Safety
pass:v,q[Exceptions thrown on invalid input.]

=== BNF
[,cpp]
----
path = [ "/" ] [ segment *( "/" segment ) ]

segment = *pchar
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3.  Path]



== Return Value

* `void` 


== Parameters

|===
| Name | Type 

| *s*
| `string_view`

|===



