File indexing completed on 2025-01-18 09:53:27
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 #ifdef BOOST_URL_DOCS
0045 constexpr
0046 __implementation_defined__
0047 literal_rule( char const* s );
0048 #else
0049 class literal_rule
0050 {
0051 char const* s_ = nullptr;
0052 std::size_t n_ = 0;
0053
0054 constexpr
0055 static
0056 std::size_t
0057 len(char const* s) noexcept
0058 {
0059 return *s
0060 ? 1 + len(s + 1)
0061 : 0;
0062 }
0063
0064 public:
0065 using value_type = core::string_view;
0066
0067 constexpr
0068 explicit
0069 literal_rule(
0070 char const* s) noexcept
0071 : s_(s)
0072 , n_(len(s))
0073 {
0074 }
0075
0076 BOOST_URL_DECL
0077 system::result<value_type>
0078 parse(
0079 char const*& it,
0080 char const* end) const noexcept;
0081 };
0082 #endif
0083
0084 }
0085 }
0086 }
0087
0088 #endif