aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-06-21 19:55:06 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-06-21 19:55:06 +0200
commitec7cfa85530082127703278cf1ae5167990c0f45 (patch)
tree81799c532da3c213609471cfcfa785bfda3b2ee0 /src/content
parent93d69841064fd5c3156d989caf7ddec46bfb8685 (diff)
Request/Response handling w/ libevent2
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/content')
-rw-r--r--src/content/blog/Blog.cpp14
-rw-r--r--src/content/blog/Blog.hpp10
2 files changed, 14 insertions, 10 deletions
diff --git a/src/content/blog/Blog.cpp b/src/content/blog/Blog.cpp
index 3f1433d..f72ef70 100644
--- a/src/content/blog/Blog.cpp
+++ b/src/content/blog/Blog.cpp
@@ -1,8 +1,8 @@
#include "Blog.hpp"
-Blog::Blog(std::string basePath) : m_BasePath(basePath), m_Redirections()
+Blog::Blog(std::string baseUri, std::string templatePath) : TemplatedContent(templatePath), m_BaseUri(baseUri), m_Redirections()
{
- m_Redirections.push_back(basePath + "-data");
+ m_Redirections.push_back(baseUri + "-data");
}
bool Blog::Init(void)
@@ -14,16 +14,20 @@ void Blog::Shutdown(void)
{
}
-bool Blog::Render(std::string & out)
+bool Blog::Render(RequestResponse & rr, std::string & out)
{
+ (void)rr;
+
+ rr.UseOutputHeader();
+ rr.AddOutputHeader2("bla", "blubb");
out = "blog-bla";
return true;
}
-std::string const & Blog::GetBasePath(void) const
+std::string const & Blog::GetBaseUri(void) const
{
- return m_BasePath;
+ return m_BaseUri;
}
Redirections const &
diff --git a/src/content/blog/Blog.hpp b/src/content/blog/Blog.hpp
index 316ce92..1de6e0f 100644
--- a/src/content/blog/Blog.hpp
+++ b/src/content/blog/Blog.hpp
@@ -3,20 +3,20 @@
#include "../../Content.hpp"
-class Blog : public Content
+class Blog : public TemplatedContent
{
public:
- explicit Blog(std::string basePath);
+ explicit Blog(std::string baseUri, std::string templatePath);
bool Init(void);
void Shutdown(void);
- bool Render(std::string & out);
+ bool Render(RequestResponse & rr, std::string & out);
- std::string const & GetBasePath() const;
+ std::string const & GetBaseUri() const;
Redirections const & GetRedirections() const;
private:
- std::string m_BasePath;
+ std::string m_BaseUri;
Redirections m_Redirections;
};