OmniNet 0.7.7: Add typed queryInt/queryDouble accessors
API improvement based on feedback from ApolloCore integration
(prompt.txt 2026-06-27, Bug 4).
New methods on QueryParams (HttpRequest.h/cpp):
std::optional<int> queryInt(std::string_view key) const;
int queryInt(std::string_view key, int defaultValue) const;
std::optional<double> queryDouble(std::string_view key) const;
double queryDouble(std::string_view key, double defaultValue) const;
Before:
auto v = req.query().get("limit");
if (v) int n = std::stoi(std::string(*v)); // awkward
After:
int n = req.query().queryInt("limit", 100); // with default
auto m = req.query().queryDouble("ratio"); // optional
Trailing non-digit chars are rejected (e.g., "10x" -> nullopt,
not 10). Parse errors caught via std::stoi/std::stod try/catch
and return nullopt.
Other bugs from the same prompt.txt triage:
#1 SQLiteDB::step - in ApolloCore repo, NOT OmniNet.
#2 delete_() - not a bug (C++ keyword constraint).
#3 setBody - already fixed (string_view overload exists).
#5 setStatus - already fixed (int overload exists).
#6 shutdown - not a bug (Server::stop() exists).
#7-#8 - vague / out of scope.
#9-#13 - llama.cpp / ApolloCore, NOT OmniNet.
Commit: ba9b2cf
Build verified clean. All 110 tests pass (no regressions).