params_view.ipp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/CPPAlliance/url
  9. //
  10. #ifndef BOOST_URL_IMPL_PARAMS_VIEW_IPP
  11. #define BOOST_URL_IMPL_PARAMS_VIEW_IPP
  12. #include <boost/url/params_view.hpp>
  13. #include <boost/url/parse_query.hpp>
  14. namespace boost {
  15. namespace urls {
  16. params_view::
  17. params_view(
  18. detail::query_ref const& ref,
  19. encoding_opts opt) noexcept
  20. : params_base(ref, opt)
  21. {
  22. }
  23. //------------------------------------------------
  24. params_view::
  25. params_view(
  26. params_view const& other,
  27. encoding_opts opt) noexcept
  28. : params_base(other.ref_, opt)
  29. {
  30. }
  31. params_view::
  32. params_view(
  33. string_view s)
  34. : params_view(
  35. parse_query(s).value(
  36. BOOST_URL_POS),
  37. {true, false, false})
  38. {
  39. }
  40. params_view::
  41. params_view(
  42. string_view s,
  43. encoding_opts opt)
  44. : params_view(
  45. parse_query(s).value(
  46. BOOST_URL_POS),
  47. opt)
  48. {
  49. }
  50. } // urls
  51. } // boost
  52. #endif