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 41715b1c50.
PrevUpHomeNext
url_view::fragment

Return the fragment.

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

This function calculates the fragment of the url, with percent escapes decoded and without the leading pound sign ('#') whose presence indicates that the url contains a fragment.

This function accepts an optional StringToken parameter which controls the return type and behavior of the function:

Example
assert( url_view( "http://www.example.com/index.htm#a%2D1" ).fragment() == "a-1" );
Complexity

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

Exception Safety

Calls to allocate may throw. String tokens may throw exceptions.

Parameters

Name

Description

token

An optional string token to use. If this parameter is omitted, the function returns a new std::string.

BNF
fragment        = *( pchar / "/" / "?" )

fragment-part   = [ "#" fragment ]
Specification
See Also

encoded_fragment, has_fragment.


PrevUpHomeNext