Class decode_view
A reference to a valid, percent-encoded string
Synopsis
class decode_view;
Declared in file <include/boost/url/decode_view.hpp> on line 27
Declared in file <include/boost/url/pct_string_view.hpp> on line 31
Defined in file <include/boost/url/decode_view.hpp> on line 87
Types
Name |
Description |
The value type |
|
The reference type |
|
The reference type |
|
The unsigned integer type |
|
The signed integer type |
|
Member Functions
Name |
Description |
Constructor |
|
Constructor |
|
Return true if the string is empty |
|
Return the number of decoded characters |
|
Return an iterator to the beginning |
|
Return an iterator to the end |
|
Return the first character |
|
Return the last character |
|
Checks if the string begins with the given prefix |
|
Checks if the string ends with the given prefix |
|
Checks if the string begins with the given prefix |
|
Checks if the string ends with the given prefix |
|
Finds the first occurrence of character in this view |
|
Finds the first occurrence of character in this view |
|
Remove the first characters |
|
Remove the last characters |
|
Return the decoding options |
|
Return the result of comparing to another string |
|
Return the result of comparing to another string |
Description
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:
-
Iteration of the string
-
Accessing the encoded character buffer
-
Comparison to encoded or plain strings 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.
Operators
The following operators are supported between
decode_view
and any object that is convertible
to core::string_view
bool operator==( decode_view, decode_view ) noexcept;
bool operator!=( decode_view, decode_view ) noexcept;
bool operator<=( decode_view, decode_view ) noexcept;
bool operator< ( decode_view, decode_view ) noexcept;
bool operator> ( decode_view, decode_view ) noexcept;
bool operator>=( decode_view, decode_view ) noexcept;