RESTinio
List of all members
restinio::parse_query_traits::relaxed Struct Reference

Traits for parsing a query string in a very relaxed mode. More...

#include <uri_helpers.hpp>

Inheritance diagram for restinio::parse_query_traits::relaxed:
restinio::utils::relaxed_unescape_traits restinio::parse_query_traits::details::ampersand_only_as_separators

Additional Inherited Members

- Static Public Member Functions inherited from restinio::utils::relaxed_unescape_traits
static bool ordinary_char (char c) noexcept
 
- Static Public Member Functions inherited from restinio::parse_query_traits::details::ampersand_only_as_separators
static string_view_t::size_type find_next_separator (string_view_t where, string_view_t::size_type start_from) noexcept
 

Detailed Description

Traits for parsing a query string in a very relaxed mode.

In that mode all characters described in that rule from RCF3986 can be used as unexceped:

query         = *( pchar / "/" / "?" )
pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
reserved      = gen-delims / sub-delims
gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"
sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                 / "*" / "+" / "," / ";" / "="

Additionaly this traits allows to use unexcaped space character.

Note that despite that fact that symbols like #, +, = and & can be used in non-percent-encoded form they play special role and are interpreted special way. So such symbols should be percent-encoded if they are used as part of name or value in query string.

Only ampersand (&) can be used as name=value pairs separator.

Usage example:

auto result = restinio::parse_query<restinio::parse_query_traits::relaxed>("a=(&b=)&c=[&d=]&e=!&f=,&g=;");
Since
v.0.6.5
Examples
sample/try_parse_query_string/main.cpp.

Definition at line 325 of file uri_helpers.hpp.


The documentation for this struct was generated from the following file: