[#40FD55D3F05DE254DE5C8D2F68D12252A82F90F4]

Function url_base:: segments

Return the path as a container of segments

Synopsis

            segments_view
segments() const noexcept;
        

Description

This function returns a bidirectional view of strings over the path. The returned view references the same underlying character buffer; ownership is not transferred. Any percent-escapes in strings returned when iterating the view are decoded first.

Example

segments_view sv = url_view( "/path/to/file.txt" ).segments();

Complexity

Constant.

Exception Safety

Throws nothing.

BNF

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

Specification

  • 3.3. Path (rfc3986)