#pragma once #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; // 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; // Plugin provides own authentication mechanism? Otherwise, webserver makes HTTP AUTH via status 401 virtual bool has_own_authentication() = 0; virtual ~webserver_plugin_interface(){} // optional };