[#33BF8ECDEC2CC4284CBDE7114B2B57A930AA2AB6]

Function url_view_base:: encoded_fragment

Return the fragment

Synopsis

            pct_string_view
encoded_fragment() const noexcept;
        

Description

This function returns the fragment as a string with percent-escapes. Ownership is not transferred; the string returned references the underlying character buffer, which must remain valid or else undefined behavior occurs.

Example

assert( url_view( "http://www.example.com/index.htm#a%2D1" ).encoded_fragment() == "a%2D1" );

Complexity

Constant.

Exception Safety

Throws nothing.

BNF

fragment = *( pchar / "/" / "?" ) pchar = unreserved / pct-encoded / sub-delims / ":" / "@"

Specification

  • 3.5. Fragment (rfc3986)