aboutsummaryrefslogtreecommitdiff
path: root/src/ContentManager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ContentManager.hpp')
-rw-r--r--src/ContentManager.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ContentManager.hpp b/src/ContentManager.hpp
new file mode 100644
index 0000000..83f4bc9
--- /dev/null
+++ b/src/ContentManager.hpp
@@ -0,0 +1,38 @@
+#ifndef CONTENTMANAGER_H
+#define CONTENTMANAGER_H 1
+
+#include "Content.hpp"
+#include "Filesystem.hpp"
+#include "TemplateManager.hpp"
+
+#include <memory>
+#include <unordered_map>
+
+using ContentModules = std::unordered_map<std::string, std::shared_ptr<Content> >;
+
+class ContentManager
+{
+public:
+ ContentManager()
+ {
+ }
+ ~ContentManager()
+ {
+ ShutdownAll();
+ }
+
+ void SetStaticFilesystem(std::shared_ptr<Filesystem> & static_fs);
+ void SetTemplateSystem(std::shared_ptr<TemplateManager> & tmgr);
+ bool RegisterModule(std::shared_ptr<Content> ctnt);
+ bool InitAll(void);
+ void ShutdownAll(void);
+ bool Render(char const * basePath, RequestResponse & rr, std::string & out);
+ ContentModules const & GetAllModules() const;
+
+private:
+ std::shared_ptr<Filesystem> m_StaticFilesystem;
+ std::shared_ptr<TemplateManager> m_TemplateManager;
+ ContentModules m_ContentModules;
+};
+
+#endif