drogon
C++14/17-based HTTP application framework
Loading...
Searching...
No Matches
DrTemplateBase.h
Go to the documentation of this file.
1
14
15#pragma once
16
17#include <drogon/exports.h>
18#include <drogon/DrObject.h>
19#include <drogon/HttpViewData.h>
20#include <memory>
21#include <string>
22
23namespace drogon
24{
25using DrTemplateData = HttpViewData;
26
28
33class DROGON_EXPORT DrTemplateBase : public virtual DrObjectBase
34{
35 public:
37
43 static std::shared_ptr<DrTemplateBase> newTemplate(
44 const std::string &templateName);
45
47
51 virtual std::string genText(
52 const DrTemplateData &data = DrTemplateData()) = 0;
53
54 virtual ~DrTemplateBase(){};
56};
57
58} // namespace drogon
The base class for all drogon reflection classes.
Definition DrObject.h:34
The templating engine class.
Definition DrTemplateBase.h:34
virtual std::string genText(const DrTemplateData &data=DrTemplateData())=0
Generate the text string.
static std::shared_ptr< DrTemplateBase > newTemplate(const std::string &templateName)
Create an object of the implementation class.
This class represents the data set displayed in views.
Definition HttpViewData.h:33
Drogon Test is a minimal effort test framework developed because the major C++ test frameworks doesn'...
Definition Attribute.h:23