diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-06-21 19:55:06 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-06-21 19:55:06 +0200 |
commit | ec7cfa85530082127703278cf1ae5167990c0f45 (patch) | |
tree | 81799c532da3c213609471cfcfa785bfda3b2ee0 /src/Content.hpp | |
parent | 93d69841064fd5c3156d989caf7ddec46bfb8685 (diff) |
Request/Response handling w/ libevent2
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/Content.hpp')
-rw-r--r-- | src/Content.hpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Content.hpp b/src/Content.hpp index 6a1d422..c379522 100644 --- a/src/Content.hpp +++ b/src/Content.hpp @@ -1,6 +1,8 @@ #ifndef CONTENT_H #define CONTENT_H 1 +#include "RequestResponse.hpp" + #include <inja/inja.hpp> #include <string> #include <tuple> @@ -12,25 +14,24 @@ class Content { public: virtual bool Init() = 0; virtual void Shutdown() = 0; - virtual bool Render(std::string & out) = 0; + virtual bool Render(RequestResponse & rr, std::string & out) = 0; - virtual std::string const & GetBasePath() const = 0; + virtual std::string const & GetBaseUri() const = 0; virtual Redirections const & GetRedirections() const = 0; + virtual void GetRequiredFiles(std::vector<std::string> & requiredFiles) const = 0; }; class TemplatedContent : public Content { public: - explicit TemplatedContent(std::string filesystemPath); + explicit TemplatedContent(std::string mainTemplate); virtual bool Init(); virtual void Shutdown(); - virtual bool Render(std::string & out); - - void SetTemplateData(nlohmann::json & data); + virtual bool Render(RequestResponse & rr, std::string & out); + virtual void GetRequiredFiles(std::vector<std::string> & requiredFiles) const; private: std::string m_FilesystemPath; - nlohmann::json m_TemplateData; }; #endif |