From 18f4a58237b853a67a7894587e1dfc2a4ca68fa3 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Thu, 10 Nov 2022 13:45:16 +0400 Subject: [PATCH] Conception of kiwix::Suggestions --- src/server/internalServer.cpp | 2 +- src/tools/otherTools.cpp | 5 +++++ src/tools/otherTools.h | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/server/internalServer.cpp b/src/server/internalServer.cpp index ceb5dc41b..3eca3f3b9 100644 --- a/src/server/internalServer.cpp +++ b/src/server/internalServer.cpp @@ -700,7 +700,7 @@ std::unique_ptr InternalServer::handle_suggest(const RequestContext& r printf("Searching suggestions for: \"%s\"\n", queryString.c_str()); } - MustacheData results{MustacheData::type::list}; + Suggestions results; bool first = true; diff --git a/src/tools/otherTools.cpp b/src/tools/otherTools.cpp index 13b2172e8..99458349d 100644 --- a/src/tools/otherTools.cpp +++ b/src/tools/otherTools.cpp @@ -326,3 +326,8 @@ std::string kiwix::render_template(const std::string& template_str, kainjow::mus tmpl.render(data, [&ss](const std::string& str) { ss << str; }); return ss.str(); } + +kiwix::Suggestions::Suggestions() + : kainjow::mustache::data(kainjow::mustache::data::type::list) +{ +} diff --git a/src/tools/otherTools.h b/src/tools/otherTools.h index e00a35858..f16f2ab6a 100644 --- a/src/tools/otherTools.h +++ b/src/tools/otherTools.h @@ -67,6 +67,12 @@ namespace kiwix return defaultValue; } + + class Suggestions : public kainjow::mustache::data + { + public: + Suggestions(); + }; } #endif