File indexing completed on 2025-09-17 08:52:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_URL_GRAMMAR_LITERAL_RULE_HPP
0011 #define BOOST_URL_GRAMMAR_LITERAL_RULE_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 <cstdlib>
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 class literal_rule
0045 {
0046 char const* s_ = nullptr;
0047 std::size_t n_ = 0;
0048
0049 constexpr
0050 static
0051 std::size_t
0052 len(char const* s) noexcept
0053 {
0054 return *s
0055 ? 1 + len(s + 1)
0056 : 0;
0057 }
0058
0059 public:
0060 using value_type = core::string_view;
0061
0062 constexpr
0063 explicit
0064 literal_rule(
0065 char const* s) noexcept
0066 : s_(s)
0067 , n_(len(s))
0068 {
0069 }
0070
0071 BOOST_URL_DECL
0072 system::result<value_type>
0073 parse(
0074 char const*& it,
0075 char const* end) const noexcept;
0076 };
0077
0078 }
0079 }
0080 }
0081
0082 #endif