scheme_rule.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/url
  8. //
  9. #ifndef BOOST_URL_RFC_DETAIL_SCHEME_RULE_HPP
  10. #define BOOST_URL_RFC_DETAIL_SCHEME_RULE_HPP
  11. #include <boost/url/detail/config.hpp>
  12. #include <boost/url/error_types.hpp>
  13. #include <boost/url/scheme.hpp>
  14. #include <boost/core/detail/string_view.hpp>
  15. namespace boost {
  16. namespace urls {
  17. namespace detail {
  18. /** Rule for scheme
  19. @par BNF
  20. @code
  21. scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
  22. @endcode
  23. @par Specification
  24. @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.1"
  25. >3.1. Scheme (rfc3986)</a>
  26. @see
  27. @ref scheme.
  28. */
  29. struct scheme_rule
  30. {
  31. struct value_type
  32. {
  33. core::string_view scheme;
  34. urls::scheme scheme_id =
  35. urls::scheme::unknown;
  36. };
  37. system::result<value_type>
  38. parse(
  39. char const*& it,
  40. char const* end) const noexcept;
  41. };
  42. } // detail
  43. } // urls
  44. } // boost
  45. #endif