From ff4b919683537625f693eedf53006364d0f8444d Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Sat, 29 Jan 2005 20:14:37 +0000 Subject: initial commit into repository --- (limited to 'include/kingate/cgi_interface.h') diff --git a/include/kingate/cgi_interface.h b/include/kingate/cgi_interface.h new file mode 100644 index 0000000..84ea6dd --- a/dev/null +++ b/include/kingate/cgi_interface.h @@ -0,0 +1,70 @@ +#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: + */ -- cgit v0.9.0.2