parse.ipp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
  3. // Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // Official repository: https://github.com/boostorg/url
  9. //
  10. #ifndef BOOST_URL_IMPL_PARSE_IPP
  11. #define BOOST_URL_IMPL_PARSE_IPP
  12. #include <boost/url/parse.hpp>
  13. #include <boost/url/rfc/absolute_uri_rule.hpp>
  14. #include <boost/url/rfc/relative_ref_rule.hpp>
  15. #include <boost/url/rfc/uri_rule.hpp>
  16. #include <boost/url/rfc/uri_reference_rule.hpp>
  17. #include <boost/url/rfc/origin_form_rule.hpp>
  18. #include <boost/url/grammar/parse.hpp>
  19. namespace boost {
  20. namespace urls {
  21. result<url_view>
  22. parse_absolute_uri(
  23. string_view s)
  24. {
  25. return grammar::parse(
  26. s, absolute_uri_rule);
  27. }
  28. result<url_view>
  29. parse_origin_form(
  30. string_view s)
  31. {
  32. return grammar::parse(
  33. s, origin_form_rule);
  34. }
  35. result<url_view>
  36. parse_relative_ref(
  37. string_view s)
  38. {
  39. return grammar::parse(
  40. s, relative_ref_rule);
  41. }
  42. result<url_view>
  43. parse_uri(
  44. string_view s)
  45. {
  46. return grammar::parse(
  47. s, uri_rule);
  48. }
  49. result<url_view>
  50. parse_uri_reference(
  51. string_view s)
  52. {
  53. return grammar::parse(
  54. s, uri_reference_rule);
  55. }
  56. } // urls
  57. } // boost
  58. #endif