diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-09-30 21:12:57 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-09-30 21:12:57 +0200 |
commit | 6c04dfe2caff1e03ba5c898b591327439452f616 (patch) | |
tree | 11c6f6955de188c48015641c1ae2e63b0d0e50d6 /src/Filesystem.hpp | |
parent | ec7cfa85530082127703278cf1ae5167990c0f45 (diff) |
CMS functionality works just find..minimal-working-example
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/Filesystem.hpp')
-rw-r--r-- | src/Filesystem.hpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/Filesystem.hpp b/src/Filesystem.hpp index 7ebfb84..13733c9 100644 --- a/src/Filesystem.hpp +++ b/src/Filesystem.hpp @@ -2,28 +2,32 @@ #define FILESYSTEM_H 1 #include <inja/inja.hpp> -#include <unordered_map> #include <string> +#include <unordered_map> #include <vector> -struct file_data { - std::vector<unsigned char> data; +struct file_data +{ + std::vector<unsigned char> data; }; -class Filesystem { +class Filesystem +{ public: - Filesystem() {} - ~Filesystem() {} + Filesystem() + { + } + ~Filesystem() + { + } - 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); + bool AddSingleFile(std::string path, std::string root); + bool Scan(std::string root = "./wwwroot"); + bool Scan(std::string root, std::vector<std::string> extensions, bool exclude_extensions = false); + const std::unordered_map<std::string, struct file_data> & GetFiles() const; private: - std::unordered_map<std::string, struct file_data> m_Files; - inja::TemplateStorage m_Templates; - inja::Environment m_Inja; + std::unordered_map<std::string, struct file_data> m_Files; }; #endif |