#ifndef __KINGATE_CGI_INTERFACE_H #define __KINGATE_CGI_INTERFACE_H #include #include #include /** * @file * @brief the abstract base for various interfaces to CGI. */ namespace kingate { using namespace std; /** * The abstract base class for interface to CGI subsystem. */ class cgi_interface { public: /** * The type for map holding 'environment' meta-variables. */ typedef map metavars_t; /** * The environment variables. */ metavars_t metavars; cgi_interface() { } virtual ~cgi_interface() { } /** * Check to see whether there is a particular 'environment' * meta-variable passed. * @param n the variable name. * @return true if yes. */ bool has_meta(const string& n) const; /** * Retrieve the 'environment' variable. * @param n the variable name. * @return the variable contents. * @see exception_notfound */ const string& get_meta(const string& n) const; /** * Fetch reference to CGI 'stdout' stream. * @return reference to the corresponding ostream object. */ virtual ostream& out() = 0; /** * Fetch reference to CGI 'stdin' stream. * @return reference to the corresponding istream object. */ virtual istream& in() = 0; /** * Fetch reference to CGI 'stderr' stream. * @return reference to the corresponding ostream object. */ virtual ostream& err() = 0; }; } #endif /* __KINGATE_CGI_INTERFACE_H */ /* * vim:set ft=cpp: */