From 0d157fb407a35f8afe6d6f0f4c2cc5cd5d5a1933 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 9 Apr 2020 18:30:32 +0200 Subject: Prepared generate_page for static-files plugin --- plugin_interface.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'plugin_interface.h') diff --git a/plugin_interface.h b/plugin_interface.h index e67d20a..9fc2085 100644 --- a/plugin_interface.h +++ b/plugin_interface.h @@ -3,13 +3,30 @@ #include #include +#include + +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; - virtual std::string generate_page(std::string path) = 0; - virtual ~webserver_plugin_interface(){} + + // returns result page without headers + virtual std::string generate_page( + std::function& GetServerParam, + std::function& GetRequestParam, // request including body (POST...) + std::function& SetResponseHeader // to be added to result string + ) = 0; + + virtual ~webserver_plugin_interface(){} // optional }; -- cgit v1.2.3