4#include <boost/fusion/adapted/std_pair.hpp>
5#include <boost/spirit/home/x3.hpp>
23template <
typename T = std::
string>
26 namespace x3 = boost::spirit::x3;
27 static const auto s_pair = x3::rule<struct pair_, std::pair<std::string, T>>{
"pair"}
28 = +~x3::char_(
"&=") >> -(
'=' >> *~x3::char_(
"&"));
29 static const auto s_query = x3::rule<struct query_, string_map<T>>{
"query"}
35inline string_map<std::string> parse_http_methods_encoded(std::string_view str)
38 string_map<std::string> methods;
39 boost::spirit::x3::parse(str.cbegin(), str.cend(), query(), methods);
46inline bool url_decode(std::string_view in, std::string& out)
49 out.reserve(in.size());
50 const std::size_t N = in.size();
51 for(std::size_t i = 0; i < N; ++i)
59 std::istringstream is(std::string(in.substr(i + 1, 2)));
60 if(is >> std::hex >>
value)
62 out +=
static_cast<char>(
value);
The value class.
Definition value.hpp:173
bool url_decode(std::string_view in, std::string &out)
url_decode taken from boost
Definition http_query_parser.hpp:46