boost::urls::segments_view::segments_view

Constructor

Synopsis

segments_view(core::string_view s);
cpp

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.

segments_view ps( "/path/to/file.txt" );
cpp
return parse_path( s ).value();
cpp
this->buffer().data() == s.data()
cpp

Complexity

Linear in s.

Exception Safety

Exceptions thrown on invalid input.

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

segment = *pchar
cpp

Exceptions

Name Thrown on

system_error

s contains an invalid path.

Parameters

Name Description

s

The string to parse.

Created with MrDocs