API calls now get parsed through a grammar using boost::spirit::qi
This commit is contained in:
parent
7d0bd77643
commit
03f8845998
@ -21,6 +21,7 @@ public:
|
|||||||
std::string GetVersionString() const { return std::string("0.1a"); }
|
std::string GetVersionString() const { return std::string("0.1a"); }
|
||||||
|
|
||||||
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
|
void HandleRequest(const RouteParameters & routeParameters, http::Reply& reply) {
|
||||||
|
std::cout << "[hello world]: runnning handler" << std::endl;
|
||||||
reply.status = http::Reply::ok;
|
reply.status = http::Reply::ok;
|
||||||
reply.content.append("<html><head><title>Hello World Demonstration Document</title></head><body><h1>Hello, World!</h1>");
|
reply.content.append("<html><head><title>Hello World Demonstration Document</title></head><body><h1>Hello, World!</h1>");
|
||||||
std::stringstream content;
|
std::stringstream content;
|
||||||
|
@ -42,55 +42,6 @@ struct RouteParameters {
|
|||||||
std::vector<std::string> hints;
|
std::vector<std::string> hints;
|
||||||
std::vector<_Coordinate> coordinates;
|
std::vector<_Coordinate> coordinates;
|
||||||
typedef HashTable<std::string, std::string>::MyIterator OptionsIterator;
|
typedef HashTable<std::string, std::string>::MyIterator OptionsIterator;
|
||||||
|
|
||||||
void setZoomLevel(const short i) {
|
|
||||||
if (18 > i && 0 < i)
|
|
||||||
zoomLevel = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setChecksum(const int c) {
|
|
||||||
checkSum = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setInstructionFlag(const bool b) {
|
|
||||||
printInstructions = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
void printService( const std::string & s) {
|
|
||||||
service = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setOutputFormat(const std::string & s) {
|
|
||||||
outputFormat = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setJSONpParameter(const std::string & s) {
|
|
||||||
jsonpParameter = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void addHint(const std::string & s) {
|
|
||||||
hints.resize(coordinates.size());
|
|
||||||
hints.back() = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setLanguage(const std::string & s) {
|
|
||||||
language = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setGeometryFlag(const bool b) {
|
|
||||||
geometry = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setCompressionFlag(const bool b) {
|
|
||||||
compression = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
void addCoordinate(boost::fusion::vector < double, double > arg_) {
|
|
||||||
int lat = 100000.*boost::fusion::at_c < 0 > (arg_);
|
|
||||||
int lon = 100000.*boost::fusion::at_c < 1 > (arg_);
|
|
||||||
_Coordinate myCoordinate(lat, lon);
|
|
||||||
coordinates.push_back(_Coordinate(lat, lon));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user