6 #include "mongoose/mongoose.h"
8 #include "../Helpers/String/String.h"
12 class QueryStringParser {
15 QueryStringParser(const mg_request_info *ri) : requestInfo(ri) {}
18 inline T getValue(const std::string key, const T defaultValue = T()) {
19 int length = mg_get_var(requestInfo->query_string, strlen(requestInfo->query_string), key.c_str(), valueBuffer, sizeof(valueBuffer));
20 if (length == -1) return defaultValue;
21 std::string value(valueBuffer);
22 return String::lexicalCast<T>(value);
26 const mg_request_info *requestInfo;
27 char valueBuffer[1024];