blob: c0a95b90835e39cc8618c06946142a3f1dc8611c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#pragma once
#include <boost/config.hpp>
#include <string>
#include <functional>
typedef std::string(plugin_interface_getter_type)(const std::string& key);
typedef void(plugin_interface_setter_type)(const std::string& key, const std::string& value);
class BOOST_SYMBOL_VISIBLE webserver_plugin_interface {
public:
static const int interface_version {1};
virtual int version() { return interface_version; }
//
// The Interface to be implemented by plugins
//
//
virtual std::string name() = 0;
// returns result page without headers
virtual std::string generate_page(
std::function<std::string(const std::string& key)>& GetServerParam,
std::function<std::string(const std::string& key)>& GetRequestParam, // request including body (POST...)
std::function<void(const std::string& key, const std::string& value)>& SetResponseHeader // to be added to result string
) = 0;
virtual ~webserver_plugin_interface(){} // optional
};
|