aboutsummaryrefslogtreecommitdiff
path: root/src/Filesystem.hpp
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-06-20 16:49:10 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-06-20 16:49:10 +0200
commit93d69841064fd5c3156d989caf7ddec46bfb8685 (patch)
tree71dc8675e27c2ac4608114efbbb3e8b81430587d /src/Filesystem.hpp
parent1967e3465c7e82d84dc8441ba1993a55050766fb (diff)
Inja/Template stuff
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/Filesystem.hpp')
-rw-r--r--src/Filesystem.hpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Filesystem.hpp b/src/Filesystem.hpp
index 139c214..7ebfb84 100644
--- a/src/Filesystem.hpp
+++ b/src/Filesystem.hpp
@@ -1,12 +1,12 @@
#ifndef FILESYSTEM_H
#define FILESYSTEM_H 1
-#include <map>
+#include <inja/inja.hpp>
+#include <unordered_map>
#include <string>
#include <vector>
struct file_data {
- bool inja_renderable;
std::vector<unsigned char> data;
};
@@ -17,9 +17,13 @@ public:
bool AddSingleFile(std::string path, std::string root);
bool Scan(std::string root = "./wwwroot");
+ void AddInjaCallback(std::string functionName, std::size_t numberOfArgs, inja::CallbackFunction function);
+ void AddVoidInjaCallback(std::string functionName, std::size_t numberOfArgs, inja::VoidCallbackFunction function);
private:
- std::map<std::string, struct file_data> files;
+ std::unordered_map<std::string, struct file_data> m_Files;
+ inja::TemplateStorage m_Templates;
+ inja::Environment m_Inja;
};
#endif