Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/backends/nntpchan-daemon/libnntpchan/template_engine.cpp
Jeff Becker e67e7a20bd
* more nntpchan-daemon code
* fix keepalive
2017-10-09 11:48:10 -04:00

36 lines
791 B
C++

#include "template_engine.hpp"
#include "sanitize.hpp"
namespace nntpchan
{
struct MustacheTemplateEngine : public TemplateEngine
{
struct Impl
{
bool RenderFile(const std::string & fname, const Args_t & args, const FileHandle_ptr & out)
{
auto file = OpenFile(fname, eRead);
return true;
}
};
virtual bool WriteTemplate(const std::string & fname, const Args_t & args, const FileHandle_ptr & out)
{
auto impl = std::make_unique<Impl>();
return impl->RenderFile(fname, args, out);
}
};
TemplateEngine * CreateTemplateEngine(const std::string & dialect)
{
auto d = ToLower(dialect);
if(d == "mustache")
return new MustacheTemplateEngine;
else
return nullptr;
}
}