absolute_uri_rule.hpp 1.7 KB

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