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) (unidiff) | |
tree | 4c19e38c0832b16b4ca98ae5af6542d932373eb1 /include/kingate/cgi_interface.h | |
parent | f9a64a67c89a7566e63ed66c3a69c359abea4dfd (diff) | |
download | kingate-0.0.zip kingate-0.0.tar.gz kingate-0.0.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 @@ | |||
1 | #ifndef __KINGATE_CGI_INTERFACE_H | ||
2 | #define __KINGATE_CGI_INTERFACE_H | ||
3 | |||
4 | #include <iostream> | ||
5 | #include <string> | ||
6 | #include <map> | ||
7 | |||
8 | /** | ||
9 | * @file | ||
10 | * @brief the abstract base for various interfaces to CGI. | ||
11 | */ | ||
12 | |||
13 | namespace kingate { | ||
14 | using namespace std; | ||
15 | |||
16 | /** | ||
17 | * The abstract base class for interface to CGI subsystem. | ||
18 | */ | ||
19 | class cgi_interface { | ||
20 | public: | ||
21 | /** | ||
22 | * The type for map holding 'environment' meta-variables. | ||
23 | */ | ||
24 | typedef map<string,string> metavars_t; | ||
25 | /** | ||
26 | * The environment variables. | ||
27 | */ | ||
28 | metavars_t metavars; | ||
29 | |||
30 | cgi_interface() { } | ||
31 | virtual ~cgi_interface() { } | ||
32 | |||
33 | /** | ||
34 | * Check to see whether there is a particular 'environment' | ||
35 | * meta-variable passed. | ||
36 | * @param n the variable name. | ||
37 | * @return true if yes. | ||
38 | */ | ||
39 | bool has_meta(const string& n) const; | ||
40 | /** | ||
41 | * Retrieve the 'environment' variable. | ||
42 | * @param n the variable name. | ||
43 | * @return the variable contents. | ||
44 | * @see exception_notfound | ||
45 | */ | ||
46 | const string& get_meta(const string& n) const; | ||
47 | |||
48 | /** | ||
49 | * Fetch reference to CGI 'stdout' stream. | ||
50 | * @return reference to the corresponding ostream object. | ||
51 | */ | ||
52 | virtual ostream& out() = 0; | ||
53 | /** | ||
54 | * Fetch reference to CGI 'stdin' stream. | ||
55 | * @return reference to the corresponding istream object. | ||
56 | */ | ||
57 | virtual istream& in() = 0; | ||
58 | /** | ||
59 | * Fetch reference to CGI 'stderr' stream. | ||
60 | * @return reference to the corresponding ostream object. | ||
61 | */ | ||
62 | virtual ostream& err() = 0; | ||
63 | }; | ||
64 | |||
65 | } | ||
66 | |||
67 | #endif /* __KINGATE_CGI_INTERFACE_H */ | ||
68 | /* | ||
69 | * vim:set ft=cpp: | ||
70 | */ | ||