Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:28

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/url
0008 //
0009 
0010 #ifndef BOOST_URL_RFC_QUERY_RULE_HPP
0011 #define BOOST_URL_RFC_QUERY_RULE_HPP
0012 
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/error_types.hpp>
0015 #include <boost/url/params_encoded_view.hpp>
0016 #include <cstddef>
0017 
0018 namespace boost {
0019 namespace urls {
0020 
0021 /** Rule for query
0022 
0023     @par Value Type
0024     @code
0025     using value_type = params_encoded_view;
0026     @endcode
0027 
0028     @par Example
0029     Rules are used with the function @ref grammar::parse.
0030     @code
0031     system::result< params_encoded_view > rv = grammar::parse( "format=web&id=42&compact", query_rule );
0032     @endcode
0033 
0034     @par BNF
0035     @code
0036     query           = *( pchar / "/" / "?" )
0037 
0038     query-params    = [ query-param ] *( "&" query-param )
0039     query-param     = key [ "=" value ]
0040     key             = *qpchar
0041     value           = *( qpchar / "=" )
0042     qpchar          = unreserved
0043                     / pct-encoded
0044                     / "!" / "$" / "'" / "(" / ")"
0045                     / "*" / "+" / "," / ";"
0046                     / ":" / "@" / "/" / "?"
0047     @endcode
0048 
0049     @par Specification
0050     @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
0051         >3.4. Query (rfc3986)</a>
0052 
0053     @see
0054         @ref grammar::parse,
0055         @ref params_encoded_view.
0056 */
0057 #ifdef BOOST_URL_DOCS
0058 constexpr __implementation_defined__ query_rule;
0059 #else
0060 struct query_rule_t
0061 {
0062     using value_type = params_encoded_view;
0063 
0064     BOOST_URL_DECL
0065     system::result<value_type>
0066     parse(
0067         char const*& it,
0068         char const* end
0069             ) const noexcept;
0070 };
0071 
0072 constexpr query_rule_t query_rule{};
0073 #endif
0074 
0075 } // urls
0076 } // boost
0077 
0078 #endif