![]() |
|
|||
File indexing completed on 2025-09-17 08:52:42
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 namespace implementation_defined { 0061 struct query_rule_t 0062 { 0063 using value_type = params_encoded_view; 0064 0065 BOOST_URL_DECL 0066 system::result<value_type> 0067 parse( 0068 char const*& it, 0069 char const* end 0070 ) const noexcept; 0071 }; 0072 } // implementation_defined 0073 0074 /** Rule for query 0075 0076 @par Value Type 0077 @code 0078 using value_type = params_encoded_view; 0079 @endcode 0080 0081 @par Example 0082 Rules are used with the function @ref grammar::parse. 0083 @code 0084 system::result< params_encoded_view > rv = grammar::parse( "format=web&id=42&compact", query_rule ); 0085 @endcode 0086 0087 @par BNF 0088 @code 0089 query = *( pchar / "/" / "?" ) 0090 0091 query-params = [ query-param ] *( "&" query-param ) 0092 query-param = key [ "=" value ] 0093 key = *qpchar 0094 value = *( qpchar / "=" ) 0095 qpchar = unreserved 0096 / pct-encoded 0097 / "!" / "$" / "'" / "(" / ")" 0098 / "*" / "+" / "," / ";" 0099 / ":" / "@" / "/" / "?" 0100 @endcode 0101 0102 @par Specification 0103 @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4" 0104 >3.4. Query (rfc3986)</a> 0105 0106 @see 0107 @ref grammar::parse, 0108 @ref params_encoded_view. 0109 */ 0110 constexpr implementation_defined::query_rule_t query_rule{}; 0111 #endif 0112 0113 } // urls 0114 } // boost 0115 0116 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |