Constructor

Synopsis

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

segments_encoded_view(string_view s);

Description

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

Example

segments_encoded_view ps( "/path/to/file.txt" );

Effects

return parse_path( s ).value();

Postconditions

this->buffer().data() == s.data()

Complexity

Linear in s.

Exception Safety

Exceptions thrown on invalid input.

BNF

path = [ "/" ] [ segment *( "/" segment ) ]

segment = *pchar

Specification

Return Value

  • void

Parameters

Name Type

s

string_view