origin_form_rule.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_ORIGIN_FORM_RULE_HPP
  10. #define BOOST_URL_RFC_ORIGIN_FORM_RULE_HPP
  11. #include <boost/url/detail/config.hpp>
  12. #include <boost/url/url_view.hpp>
  13. namespace boost {
  14. namespace urls {
  15. /** Rule for origin-form
  16. This appears in the HTTP/1 request-line grammar.
  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( "/index.htm?layout=mobile", origin_form_rule );
  25. @endcode
  26. @par BNF
  27. @code
  28. origin-form = absolute-path [ "?" query ]
  29. absolute-path = 1*( "/" segment )
  30. @endcode
  31. @par Specification
  32. @li <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1"
  33. >5.3.1. origin-form (rfc7230)</a>
  34. @see
  35. @ref grammar::parse,
  36. @ref parse_origin_form,
  37. @ref url_view.
  38. */
  39. #ifdef BOOST_URL_DOCS
  40. constexpr __implementation_defined__ origin_form_rule;
  41. #else
  42. struct origin_form_rule_t
  43. {
  44. using value_type =
  45. url_view;
  46. BOOST_URL_DECL
  47. system::result<value_type>
  48. parse(
  49. char const*& it,
  50. char const* end
  51. ) const noexcept;
  52. };
  53. constexpr origin_form_rule_t origin_form_rule{};
  54. #endif
  55. } // urls
  56. } // boost
  57. #endif