File indexing completed on 2025-01-18 09:53:27
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
0038
0039
0040 template<class Rule>
0041 system::result<typename Rule::value_type>
0042 parse(
0043 char const*& it,
0044 char const* end,
0045 Rule const& r);
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064 template<class Rule>
0065 system::result<typename Rule::value_type>
0066 parse(
0067 core::string_view s,
0068 Rule const& r);
0069
0070
0071
0072 #ifndef BOOST_URL_DOCS
0073 namespace detail {
0074
0075 template<class Rule>
0076 struct rule_ref
0077 {
0078 Rule const& r_;
0079
0080 using value_type =
0081 typename Rule::value_type;
0082
0083 system::result<value_type>
0084 parse(
0085 char const*& it,
0086 char const* end) const
0087 {
0088 return r_.parse(it, end);
0089 }
0090 };
0091
0092 }
0093 #endif
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112 template<class Rule>
0113 constexpr
0114 #ifdef BOOST_URL_DOCS
0115 __implementation_defined__
0116 #else
0117 typename std::enable_if<
0118 is_rule<Rule>::value &&
0119 ! std::is_same<Rule,
0120 detail::rule_ref<Rule> >::value,
0121 detail::rule_ref<Rule> >::type
0122 #endif
0123 ref(Rule const& r) noexcept
0124 {
0125 return detail::rule_ref<
0126 Rule>{r};
0127 }
0128
0129 #ifndef BOOST_URL_DOCS
0130
0131
0132
0133 constexpr
0134 void
0135 ref(...) = delete;
0136 #endif
0137
0138 }
0139 }
0140 }
0141
0142 #include <boost/url/grammar/impl/parse.hpp>
0143
0144 #endif