ipvfuture_rule.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_IPVFUTURE_RULE_HPP
  10. #define BOOST_URL_RFC_DETAIL_IPVFUTURE_RULE_HPP
  11. #include <boost/url/error_types.hpp>
  12. #include <boost/core/detail/string_view.hpp>
  13. namespace boost {
  14. namespace urls {
  15. namespace detail {
  16. /** Rule for IPvFuture
  17. @par BNF
  18. @code
  19. IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
  20. @endcode
  21. @par Specification
  22. @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
  23. >3.2.2. Host (rfc3986)</a>
  24. */
  25. struct ipvfuture_rule_t
  26. {
  27. struct value_type
  28. {
  29. core::string_view str;
  30. core::string_view major;
  31. core::string_view minor;
  32. };
  33. auto
  34. parse(
  35. char const*& it,
  36. char const* const end
  37. ) const noexcept ->
  38. system::result<value_type>;
  39. };
  40. constexpr ipvfuture_rule_t ipvfuture_rule{};
  41. } // detail
  42. } // urls
  43. } // boost
  44. #endif