#ifndef TEMPLATE_H #define TEMPLATE_H #include #include #include "config.h" #include "templatepage.h" #include "utils.h" #include "response.h" #include "searchresult.h" #include "revision.h" #include "cache/mapcache.h" class Template { private: ConfigVariableResolver *configVarResolver; ConfigUrls *configUrls; MapCache *pageCache; std::string templateprefix; std::string templatepath; std::string resolveIncludes(std::string_view content); std::string getPartPath(std::string_view partname); std::string loadPartContent(std::string_view partname); TemplatePage createPage(std::string_view name); public: Template(std::string templateprefix, std::string templatepath, ConfigUrls &configUrls, ConfigVariableResolver &configVarsResolver, MapCache &pageCache); TemplatePage getPage(const std::string &pagename); std::string loadResolvedPart(std::string_view partname); std::string renderSearch(const std::vector &results, std::function callback) const; std::string renderSearch(const std::vector &results) const; std::string renderSearch(const std::vector &results) const; std::string renderRevisionList(const std::vector &revisions, bool withpage = false) const; }; #endif // TEMPLATE_H