diff options
Diffstat (limited to 'plugin_interface.h')
-rw-r--r-- | plugin_interface.h | 21 |
1 files changed, 19 insertions, 2 deletions
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 <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; - 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<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 }; |