parse_query.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_PARSE_PARAMS_HPP
  11. #define BOOST_URL_PARSE_PARAMS_HPP
  12. #include <boost/url/detail/config.hpp>
  13. #include <boost/url/error_types.hpp>
  14. #include <boost/url/params_encoded_view.hpp>
  15. #include <boost/core/detail/string_view.hpp>
  16. namespace boost {
  17. namespace urls {
  18. /** Parse a string and return an encoded params view
  19. This function parses the string and returns the
  20. corresponding params object if the string is valid,
  21. otherwise returns an error.
  22. @par BNF
  23. @code
  24. query = *( pchar / "/" / "?" )
  25. @endcode
  26. @par Exception Safety
  27. No-throw guarantee.
  28. @return A valid view on success, otherwise an
  29. error code.
  30. @param s The string to parse
  31. @par Specification
  32. @see
  33. @ref params_encoded_view.
  34. */
  35. BOOST_URL_DECL
  36. system::result<params_encoded_view>
  37. parse_query(core::string_view s) noexcept;
  38. } // urls
  39. } // boost
  40. #endif