absolute_uri_rule.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_ABSOLUTE_URI_RULE_HPP
  10. #define BOOST_URL_RFC_ABSOLUTE_URI_RULE_HPP
  11. #include <boost/url/detail/config.hpp>
  12. #include <boost/url/error_types.hpp>
  13. #include <boost/url/url_view.hpp>
  14. namespace boost {
  15. namespace urls {
  16. namespace implementation_defined {
  17. struct absolute_uri_rule_t
  18. {
  19. using value_type = url_view;
  20. BOOST_URL_DECL
  21. auto
  22. parse(
  23. char const*& it,
  24. char const* end
  25. ) const noexcept ->
  26. system::result<value_type>;
  27. };
  28. } // implementation_defined
  29. /** Rule for absolute-URI
  30. @par Value Type
  31. @code
  32. using value_type = url_view;
  33. @endcode
  34. @par Example
  35. Rules are used with the function @ref grammar::parse.
  36. @code
  37. system::result< url_view > rv = grammar::parse( "http://example.com/index.htm?id=1", absolute_uri_rule );
  38. @endcode
  39. @par BNF
  40. @code
  41. absolute-URI = scheme ":" hier-part [ "?" query ]
  42. hier-part = "//" authority path-abempty
  43. / path-absolute
  44. / path-rootless
  45. / path-empty
  46. @endcode
  47. @par Specification
  48. @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.3"
  49. >4.3. Absolute URI (rfc3986)</a>
  50. @see
  51. @ref grammar::parse,
  52. @ref parse_absolute_uri,
  53. @ref url_view.
  54. */
  55. BOOST_INLINE_CONSTEXPR implementation_defined::absolute_uri_rule_t absolute_uri_rule{};
  56. } // urls
  57. } // boost
  58. #endif