A type which can represent a segment as a reference.
using const_reference = decode_view;
Name |
Description |
---|---|
An iterator of constant, decoded characters. |
|
The reference type. |
|
The signed integer type. |
|
An iterator of constant, decoded characters. |
|
The reference type. |
|
The unsigned integer type. |
|
The value type. |
Name |
Description |
---|---|
Append the range with percent-decoded applied to an existing string. |
|
Assign the range with percent-decoded applied to an existing string. |
|
Return the last character. |
|
Return an iterator to the beginning. |
|
Return the result of comparing to another string. |
|
Copy a decoded substring to another character string. |
|
Constructor. |
|
Return true if the string is empty. |
|
Return the encoded string. |
|
Return an iterator to the end. |
|
Return the first character. |
|
Return a std::string with percent-decoding applied. |
|
Return the decoding options. |
|
Return the number of decoded characters. |
|
Return a std::string with percent-decoding applied. |
Name |
Description |
---|---|
Return the result of comparing s0 and s1. |
|
Return the result of comparing s0 and s1. |
|
Return the result of comparing s0 and s1. |
|
Return the result of comparing s0 and s1. |
|
Return the result of comparing s0 and s1. |
|
Return the result of comparing s0 and s1. |
|
Format the string with percent-decoding applied to the output stream. |
These views reference strings in parts of URLs or other components that are percent-encoded. The special characters (those not in the allowed character set) are stored as three character escapes that consist of a percent sign ('%') followed by a two-digit hexadecimal number of the corresponding unescaped character code, which may be part of a UTF-8 code point depending on the context. The view refers to the original character buffer and only decodes escaped sequences when needed. In particular these operations perform percent-decoding automatically without the need to allocate memory:
However, in order to access the string as a as a contiguous character buffer with with percent-decoding applied, the caller must explicitly opt-in to an operation that is potentially allocating. These operations are:
std::string
These objects can only be constructed from strings that have a valid percent-encoding, otherwise construction fails. The caller is responsible for ensuring that the lifetime of the character buffer from which the view is constructed extends unmodified until the view is no longer accessed.
This type does not make a copy of a segment and ownership is retained by the container.