relative_ref_rule.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_RELATIVE_REF_RULE_HPP
  10. #define BOOST_URL_RFC_RELATIVE_REF_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 relative_ref_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 relative-ref
  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( "images/dot.gif?v=hide#a", relative_ref_rule );
  38. @endcode
  39. @par BNF
  40. @code
  41. relative-ref = relative-part [ "?" query ] [ "#" fragment ]
  42. @endcode
  43. @par Specification
  44. @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.2"
  45. >4.2. Relative Reference (rfc3986)</a>
  46. @see
  47. @ref grammar::parse,
  48. @ref parse_relative_ref,
  49. @ref url_view.
  50. */
  51. constexpr implementation_defined::relative_ref_rule_t relative_ref_rule{};
  52. } // urls
  53. } // boost
  54. #endif