1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#ifndef TEMPLATEMANAGER_H #define TEMPLATEMANAGER_H 1 #include "Content.hpp" #include "Filesystem.hpp" #include "RequestResponse.hpp" #include <inja/inja.hpp> class TemplateManager { public: TemplateManager(); ~TemplateManager() { } void ParseTemplates(Filesystem & fs); void AddInjaCallback(std::string functionName, std::size_t numberOfArgs, inja::CallbackFunction function); void AddVoidInjaCallback(std::string functionName, std::size_t numberOfArgs, inja::VoidCallbackFunction function); bool TemplateExists(std::string const & templatePath); bool RenderTemplate(std::string const & templatePath, RenderData const & rd, std::string & out); private: inja::Environment m_Inja; }; #endif