13 #include <restinio/impl/include_fmtlib.hpp> 15 #include <restinio/string_view.hpp> 16 #include <restinio/exception.hpp> 17 #include <restinio/expected.hpp> 19 #include <restinio/utils/utf8_checker.hpp> 41 (
'0' <= c && c <=
'9' ) ||
42 (
'a' <= c && c <=
'z' ) ||
43 (
'A' <= c && c <=
'Z' ) ||
66 (
'0' <= c && c <=
'9' ) ||
67 (
'a' <= c && c <=
'z' ) ||
68 (
'A' <= c && c <=
'Z' ) ||
101 return nullptr != std::strchr(
103 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 104 "abcdefghijklmnopqrstuvwxyz" 126 static constexpr bool 130 (
'0' <= c && c <=
'9' ) ||
131 (
'a' <= c && c <=
'z' ) ||
132 (
'A' <= c && c <=
'Z' ) ||
166 std::string description )
193 (
'0' <= c && c <=
'9' ) ||
194 (
'a' <= c && c <=
'f' ) ||
195 (
'A' <= c && c <=
'F' );
203 if(
'0' <= c1 && c1 <=
'9' )
208 result = 10 + c1 -
'a';
213 if(
'0' <= c2 && c2 <=
'9' )
218 result += 10 + c2 -
'a';
234 typename Chars_Collector >
257 "next byte from UTF-8 sequence expected at {}",
270 fmt::
format(
"invalid UTF-8 sequence detected at {}",
286 "invalid escape sequence at pos {}",
current_pos() )
306 "invalid non-escaped char with code {:#02X} at pos: {}",
315 fmt::
format(
"unfinished UTF-8 sequence" )
477 constexpr inline bool 522 fmt::
format(
"next byte from UTF-8 sequence expected at {}",
539 fmt::
format(
"invalid UTF-8 sequence detected at {}",
645 [&
dest](
char ch )
noexcept {
static constexpr bool ordinary_char(char c) noexcept
static bool ordinary_char(char c) noexcept
The traits for escaping and unexcaping symbols in JavaScript-compatible mode.
std::string m_description
Description of a failure.
RESTINIO_NODISCARD std::string giveout_description() noexcept
Get out the value of the description of the failure.
The default traits for escaping and unexcaping symbols in a query string.
Traits for escaping and unescaping symbols in a query string in very relaxed mode.
void normalize_to(string_view_t what, char *dest)
Perform normalization of URI value.
char extract_escaped_char(char c1, char c2)
unescape_percent_encoding_failure_t(std::string description)
static constexpr bool ordinary_char(char c) noexcept
RESTINIO_NODISCARD expected_t< unescape_percent_encoding_success_t, unescape_percent_encoding_failure_t > do_unescape_percent_encoding(const string_view_t data, Chars_Collector &&collector)
The actual implementation of unescape-percent-encoding procedure.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists ...
Type that indicates that unescaping of percent-encoded symbols completed successfully.