123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #ifndef BOOST_URL_GRAMMAR_TOKEN_RULE_HPP
- #define BOOST_URL_GRAMMAR_TOKEN_RULE_HPP
- #include <boost/url/detail/config.hpp>
- #include <boost/url/grammar/charset.hpp>
- #include <boost/url/error_types.hpp>
- #include <boost/core/detail/string_view.hpp>
- namespace boost {
- namespace urls {
- namespace grammar {
- #ifdef BOOST_URL_DOCS
- template<class CharSet>
- constexpr
- __implementation_defined__
- token_rule(
- CharSet cs) noexcept;
- #else
- template<class CharSet>
- struct token_rule_t
- {
- using value_type = core::string_view;
- static_assert(
- is_charset<CharSet>::value,
- "CharSet requirements not met");
- auto
- parse(
- char const*& it,
- char const* end
- ) const noexcept ->
- system::result<value_type>;
- private:
- template<class CharSet_>
- friend
- constexpr
- auto
- token_rule(
- CharSet_ const&) noexcept ->
- token_rule_t<CharSet_>;
- constexpr
- token_rule_t(
- CharSet const& cs) noexcept
- : cs_(cs)
- {
- }
- CharSet const cs_;
- };
- template<class CharSet>
- constexpr
- auto
- token_rule(
- CharSet const& cs) noexcept ->
- token_rule_t<CharSet>
- {
- return {cs};
- }
- #endif
- }
- }
- }
- #include <boost/url/grammar/impl/token_rule.hpp>
- #endif
|