File indexing completed on 2025-09-15 08:53:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_URL_GRAMMAR_PARSE_HPP
0011 #define BOOST_URL_GRAMMAR_PARSE_HPP
0012
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/error_types.hpp>
0015 #include <boost/core/detail/string_view.hpp>
0016 #include <boost/url/grammar/type_traits.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 template<BOOST_URL_CONSTRAINT(Rule) R>
0038 system::result<typename R::value_type>
0039 parse(
0040 char const*& it,
0041 char const* end,
0042 R const& r);
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 template<BOOST_URL_CONSTRAINT(Rule) R>
0059 system::result<typename R::value_type>
0060 parse(
0061 core::string_view s,
0062 R const& r);
0063
0064
0065
0066 namespace implementation_defined {
0067 template<class Rule>
0068 struct rule_ref
0069 {
0070 Rule const& r_;
0071
0072 using value_type =
0073 typename Rule::value_type;
0074
0075 system::result<value_type>
0076 parse(
0077 char const*& it,
0078 char const* end) const
0079 {
0080 return r_.parse(it, end);
0081 }
0082 };
0083 }
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103 template<BOOST_URL_CONSTRAINT(Rule) R>
0104 constexpr
0105 typename std::enable_if<
0106 is_rule<R>::value &&
0107 ! std::is_same<R,
0108 implementation_defined::rule_ref<R> >::value,
0109 implementation_defined::rule_ref<R> >::type
0110 ref(R const& r) noexcept
0111 {
0112 return implementation_defined::rule_ref<R>{r};
0113 }
0114
0115 #ifndef BOOST_URL_DOCS
0116 #ifndef BOOST_URL_MRDOCS
0117
0118
0119
0120 constexpr
0121 void
0122 ref(...) = delete;
0123 #endif
0124 #endif
0125
0126 }
0127 }
0128 }
0129
0130 #include <boost/url/grammar/impl/parse.hpp>
0131
0132 #endif