diff options
Diffstat (limited to 'src/TemplateManager.hpp')
-rw-r--r-- | src/TemplateManager.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/TemplateManager.hpp b/src/TemplateManager.hpp new file mode 100644 index 0000000..7b89d71 --- /dev/null +++ b/src/TemplateManager.hpp @@ -0,0 +1,28 @@ +#ifndef TEMPLATEMANAGER_H +#define TEMPLATEMANAGER_H 1 + +#include "Content.hpp" +#include "Filesystem.hpp" + +#include <inja/inja.hpp> + +class TemplateManager +{ +public: + TemplateManager(); + ~TemplateManager() + { + } + + void ParseTemplates(Filesystem const & 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::TemplateStorage m_Templates; + inja::Environment m_Inja; +}; + +#endif |