File indexing completed on 2025-01-18 09:53:28
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
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 #ifdef BOOST_URL_DOCS
0050 template<class CharSet>
0051 constexpr
0052 __implementation_defined__
0053 token_rule(
0054 CharSet cs) noexcept;
0055 #else
0056 template<class CharSet>
0057 struct token_rule_t
0058 {
0059 using value_type = core::string_view;
0060
0061 static_assert(
0062 is_charset<CharSet>::value,
0063 "CharSet requirements not met");
0064
0065 auto
0066 parse(
0067 char const*& it,
0068 char const* end
0069 ) const noexcept ->
0070 system::result<value_type>;
0071
0072 private:
0073 template<class CharSet_>
0074 friend
0075 constexpr
0076 auto
0077 token_rule(
0078 CharSet_ const&) noexcept ->
0079 token_rule_t<CharSet_>;
0080
0081 constexpr
0082 token_rule_t(
0083 CharSet const& cs) noexcept
0084 : cs_(cs)
0085 {
0086 }
0087
0088 CharSet const cs_;
0089 };
0090
0091 template<class CharSet>
0092 constexpr
0093 auto
0094 token_rule(
0095 CharSet const& cs) noexcept ->
0096 token_rule_t<CharSet>
0097 {
0098 return {cs};
0099 }
0100 #endif
0101
0102 }
0103 }
0104 }
0105
0106 #include <boost/url/grammar/impl/token_rule.hpp>
0107
0108 #endif