Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
url_view_base::path

Return the path.

Synopsis
template<
    class StringToken = string_token::return_string>
StringToken::result_type
path(
    StringToken&& token = {}) const;
Description

This function returns the path as a string. The path may be empty. Any percent-escapes in the string are decoded first.

Example
assert( [link url.ref.boost__urls__url_view_base.url_view `url_view`]( "file:///Program%20Files/Games/config.ini" ).[link url.ref.boost__urls__url_view_base.path `path`]() == "/Program Files/Games/config.ini" );
Complexity

Linear in this->path().size().

Exception Safety

Calls to allocate may throw.

BNF
[link url.ref.boost__urls__url_view_base.path `path`]          = [link url.ref.boost__urls__url_view_base.path `path`]-abempty    ; begins with "/" or is [link url.ref.boost__urls__url_view_base.empty `empty`]
              / [link url.ref.boost__urls__url_view_base.path `path`]-absolute   ; begins with "/" but not "//"
              / [link url.ref.boost__urls__url_view_base.path `path`]-noscheme   ; begins with a non-colon segment
              / [link url.ref.boost__urls__url_view_base.path `path`]-rootless   ; begins with a segment
              / [link url.ref.boost__urls__url_view_base.path `path`]-[link url.ref.boost__urls__url_view_base.empty `empty`]      ; zero characters

[link url.ref.boost__urls__url_view_base.path `path`]-abempty  = *( "/" segment )
[link url.ref.boost__urls__url_view_base.path `path`]-absolute = "/" [ segment-nz *( "/" segment ) ]
[link url.ref.boost__urls__url_view_base.path `path`]-noscheme = segment-nz-nc *( "/" segment )
[link url.ref.boost__urls__url_view_base.path `path`]-rootless = segment-nz *( "/" segment )
[link url.ref.boost__urls__url_view_base.path `path`]-[link url.ref.boost__urls__url_view_base.empty `empty`]    = 0<pchar>
Specification
See Also

is_path_absolute, encoded_path, encoded_segments. segments.


PrevUpHomeNext