Parsing hints from request. If no hint is given, then it is initialized
to empty string.
This commit is contained in:
parent
c273351d4a
commit
f7cc34c807
@ -26,7 +26,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
#include "../DataStructures/HashTable.h"
|
#include "../DataStructures/HashTable.h"
|
||||||
|
|
||||||
struct RouteParameters {
|
struct RouteParameters {
|
||||||
std::vector<unsigned> hints;
|
std::vector<std::string> hints;
|
||||||
std::vector<std::string> parameters;
|
std::vector<std::string> parameters;
|
||||||
std::vector<std::string> viaPoints;
|
std::vector<std::string> viaPoints;
|
||||||
HashTable<std::string, std::string> options;
|
HashTable<std::string, std::string> options;
|
||||||
|
@ -85,13 +85,7 @@ public:
|
|||||||
}
|
}
|
||||||
} else if("hint" == p) {
|
} else if("hint" == p) {
|
||||||
routeParameters.hints.resize(routeParameters.viaPoints.size(), 0);
|
routeParameters.hints.resize(routeParameters.viaPoints.size(), 0);
|
||||||
if(routeParameters.hints.size()) {
|
routeParameters.hints.back() = o;
|
||||||
unsigned hint = 0;
|
|
||||||
try {
|
|
||||||
hint = 10*boost::lexical_cast<int>(o);
|
|
||||||
} catch(boost::bad_lexical_cast &) { /* do nothing since hint is initialized to 0 */}
|
|
||||||
routeParameters.hints.back() = hint;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
routeParameters.options.Set(p, o);
|
routeParameters.options.Set(p, o);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user