File indexing completed on 2025-09-16 08:51:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_URL_GRAMMAR_TOKEN_RULE_HPP
0011 #define BOOST_URL_GRAMMAR_TOKEN_RULE_HPP
0012
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/grammar/charset.hpp>
0015 #include <boost/url/error_types.hpp>
0016 #include <boost/core/detail/string_view.hpp>
0017
0018 namespace boost {
0019 namespace urls {
0020 namespace grammar {
0021
0022 namespace implementation_defined {
0023 template<class CharSet>
0024 struct token_rule_t
0025 {
0026 using value_type = core::string_view;
0027
0028 static_assert(
0029 is_charset<CharSet>::value,
0030 "CharSet requirements not met");
0031
0032 auto
0033 parse(
0034 char const*& it,
0035 char const* end
0036 ) const noexcept ->
0037 system::result<value_type>;
0038
0039 constexpr
0040 token_rule_t(
0041 CharSet const& cs) noexcept
0042 : cs_(cs)
0043 {
0044 }
0045
0046 private:
0047 CharSet const cs_;
0048 };
0049 }
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079 template<BOOST_URL_CONSTRAINT(CharSet) CS>
0080 constexpr
0081 auto
0082 token_rule(
0083 CS const& cs) noexcept ->
0084 implementation_defined::token_rule_t<CS>
0085 {
0086 return {cs};
0087 }
0088
0089 }
0090 }
0091 }
0092
0093 #include <boost/url/grammar/impl/token_rule.hpp>
0094
0095 #endif