12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef BOOST_URL_GRAMMAR_LITERAL_RULE_HPP
- #define BOOST_URL_GRAMMAR_LITERAL_RULE_HPP
- #include <boost/url/detail/config.hpp>
- #include <boost/url/error_types.hpp>
- #include <boost/core/detail/string_view.hpp>
- #include <cstdlib>
- namespace boost {
- namespace urls {
- namespace grammar {
- #ifdef BOOST_URL_DOCS
- constexpr
- __implementation_defined__
- literal_rule( char const* s );
- #else
- class literal_rule
- {
- char const* s_ = nullptr;
- std::size_t n_ = 0;
- constexpr
- static
- std::size_t
- len(char const* s) noexcept
- {
- return *s
- ? 1 + len(s + 1)
- : 0;
- }
- public:
- using value_type = core::string_view;
- constexpr
- explicit
- literal_rule(
- char const* s) noexcept
- : s_(s)
- , n_(len(s))
- {
- }
- BOOST_URL_DECL
- system::result<value_type>
- parse(
- char const*& it,
- char const* end) const noexcept;
- };
- #endif
- }
- }
- }
- #endif
|