This commit is contained in:
Siarhei Fedartsou 2024-05-22 18:07:59 +02:00
parent 7766a0f42b
commit 3552443896

View File

@ -2,24 +2,24 @@
#include "engine/polyline_compressor.hpp"
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/spirit/home/x3.hpp>
#include <boost/spirit/home/x3/support/utility/annotate_on_success.hpp>
#include <boost/spirit/home/x3/support/ast/position_tagged.hpp>
#include <boost/optional.hpp>
#include <boost/spirit/home/x3.hpp>
#include <boost/spirit/home/x3/support/ast/position_tagged.hpp>
#include <boost/spirit/home/x3/support/utility/annotate_on_success.hpp>
#include <string>
BOOST_FUSION_ADAPT_STRUCT(osrm::server::api::ParsedURL,
(std::string, service)
(unsigned, version)
(std::string, profile)
(std::string, query))
(std::string, service)(unsigned, version)(std::string,
profile)(std::string, query))
namespace osrm::server::api
{
namespace x3 = boost::spirit::x3;
struct ParsedURLClass : x3::annotate_on_success {};
struct ParsedURLClass : x3::annotate_on_success
{
};
const x3::rule<struct Service, std::string> service = "service";
const x3::rule<struct Version, unsigned> version = "version";
const x3::rule<struct Profile, std::string> profile = "profile";
@ -36,8 +36,8 @@ namespace osrm::server::api
const auto profile_def = +identifier;
const auto query_def = +all_chars;
const auto start_def =
x3::lit('/') > service > x3::lit('/') > x3::lit('v') > version > x3::lit('/') > profile > x3::lit('/') > query;
const auto start_def = x3::lit('/') > service > x3::lit('/') > x3::lit('v') > version
> x3::lit('/') > profile > x3::lit('/') > query;
BOOST_SPIRIT_DEFINE(service, version, profile, query, start)