author | Michael Krelin <hacker@klever.net> | 2005-01-29 20:14:37 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2005-01-29 20:14:37 (UTC) |
commit | ff4b919683537625f693eedf53006364d0f8444d (patch) (side-by-side diff) | |
tree | 4c19e38c0832b16b4ca98ae5af6542d932373eb1 /include/kingate/cgi_interface.h | |
parent | f9a64a67c89a7566e63ed66c3a69c359abea4dfd (diff) | |
download | kingate-ff4b919683537625f693eedf53006364d0f8444d.zip kingate-ff4b919683537625f693eedf53006364d0f8444d.tar.gz kingate-ff4b919683537625f693eedf53006364d0f8444d.tar.bz2 |
initial commit into repository0.0
Diffstat (limited to 'include/kingate/cgi_interface.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | include/kingate/cgi_interface.h | 70 |
1 files changed, 70 insertions, 0 deletions
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 <iostream> +#include <string> +#include <map> + +/** + * @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<string,string> 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: + */ |