wip
This commit is contained in:
parent
7766a0f42b
commit
3552443896
@ -2,24 +2,24 @@
|
|||||||
#include "engine/polyline_compressor.hpp"
|
#include "engine/polyline_compressor.hpp"
|
||||||
|
|
||||||
#include <boost/fusion/include/adapt_struct.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/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>
|
#include <string>
|
||||||
|
|
||||||
BOOST_FUSION_ADAPT_STRUCT(osrm::server::api::ParsedURL,
|
BOOST_FUSION_ADAPT_STRUCT(osrm::server::api::ParsedURL,
|
||||||
(std::string, service)
|
(std::string, service)(unsigned, version)(std::string,
|
||||||
(unsigned, version)
|
profile)(std::string, query))
|
||||||
(std::string, profile)
|
|
||||||
(std::string, query))
|
|
||||||
|
|
||||||
namespace osrm::server::api
|
namespace osrm::server::api
|
||||||
{
|
{
|
||||||
namespace x3 = boost::spirit::x3;
|
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 Service, std::string> service = "service";
|
||||||
const x3::rule<struct Version, unsigned> version = "version";
|
const x3::rule<struct Version, unsigned> version = "version";
|
||||||
const x3::rule<struct Profile, std::string> profile = "profile";
|
const x3::rule<struct Profile, std::string> profile = "profile";
|
||||||
@ -36,8 +36,8 @@ namespace osrm::server::api
|
|||||||
const auto profile_def = +identifier;
|
const auto profile_def = +identifier;
|
||||||
const auto query_def = +all_chars;
|
const auto query_def = +all_chars;
|
||||||
|
|
||||||
const auto start_def =
|
const auto start_def = x3::lit('/') > service > x3::lit('/') > x3::lit('v') > version
|
||||||
x3::lit('/') > service > x3::lit('/') > x3::lit('v') > version > x3::lit('/') > profile > x3::lit('/') > query;
|
> x3::lit('/') > profile > x3::lit('/') > query;
|
||||||
|
|
||||||
BOOST_SPIRIT_DEFINE(service, version, profile, query, start)
|
BOOST_SPIRIT_DEFINE(service, version, profile, query, start)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user