Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 511ae0d3cd.
PrevUpHomeNext
segments_view::segments_view (3 of 3 overloads)

Constructor.

Synopsis
segments_view(
    core::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_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.

Exceptions

Type

Thrown On

system_error

s contains an invalid path.

Parameters

Name

Description

s

The string to parse.

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

segment = *pchar
Specification

PrevUpHomeNext