-rw-r--r-- | include/kingate/cgi_gateway.h | 117 |
1 files changed, 111 insertions, 6 deletions
diff --git a/include/kingate/cgi_gateway.h b/include/kingate/cgi_gateway.h index f683580..a5c4056 100644 --- a/include/kingate/cgi_gateway.h +++ b/include/kingate/cgi_gateway.h | |||
@@ -6,2 +6,10 @@ | |||
6 | 6 | ||
7 | #ifndef __deprecated | ||
8 | #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 | ||
9 | #define __deprecated __attribute__((deprecated)) | ||
10 | #else | ||
11 | #define __deprecated | ||
12 | #endif | ||
13 | #endif | ||
14 | |||
7 | /** | 15 | /** |
@@ -61,3 +69,3 @@ namespace kingate { | |||
61 | */ | 69 | */ |
62 | string get_meta(const string& n) const { return iface.get_meta(n); } | 70 | const string& get_meta(const string& n) const { return iface.get_meta(n); } |
63 | 71 | ||
@@ -100,3 +108,3 @@ namespace kingate { | |||
100 | */ | 108 | */ |
101 | string get_GET(const string& n) const; | 109 | const string& get_GET(const string& n) const; |
102 | /** | 110 | /** |
@@ -113,3 +121,3 @@ namespace kingate { | |||
113 | */ | 121 | */ |
114 | string get_POST(const string& n) const; | 122 | const string& get_POST(const string& n) const; |
115 | /** | 123 | /** |
@@ -128,3 +136,3 @@ namespace kingate { | |||
128 | */ | 136 | */ |
129 | string get_param(const string& n) const; | 137 | const string& get_param(const string& n) const; |
130 | 138 | ||
@@ -135,3 +143,3 @@ namespace kingate { | |||
135 | */ | 143 | */ |
136 | const string& get_content_type() const; | 144 | const string& __deprecated get_content_type() const; |
137 | /** | 145 | /** |
@@ -141,3 +149,3 @@ namespace kingate { | |||
141 | */ | 149 | */ |
142 | unsigned long get_content_length() const; | 150 | unsigned long __deprecated get_content_length() const; |
143 | 151 | ||
@@ -148,2 +156,99 @@ namespace kingate { | |||
148 | bool is_content_parsed() const { return b_parsed_content; } | 156 | bool is_content_parsed() const { return b_parsed_content; } |
157 | |||
158 | /** | ||
159 | * Retrieve the HTTP header value from the HTTP_ meta-variable. | ||
160 | * (see RFC3875) | ||
161 | * @param hn header field name. | ||
162 | * @return the HTTP header value. | ||
163 | */ | ||
164 | const string& http_request_header(const string& hn) const; | ||
165 | |||
166 | /** | ||
167 | * Retrieve the AUTH_TYPE meta-variable (see RFC3875) | ||
168 | * @return authentication type. | ||
169 | */ | ||
170 | const string& auth_type() const; | ||
171 | /** | ||
172 | * Retrieve the CONTENT_LENGTH meta-variable (see RFC3875) | ||
173 | * @return size of the request message body. | ||
174 | */ | ||
175 | unsigned long cgi_gateway::content_length() const; | ||
176 | /** | ||
177 | * Retrieve the CONTENT_TYPE meta-variable (see RFC3875) | ||
178 | * @return media type of the request message body. | ||
179 | */ | ||
180 | const string& content_type() const; | ||
181 | /** | ||
182 | * Retrieve the GATEWAY_INTERFACE meta-variable (see RFC3875) | ||
183 | * @return the gateway interface dialect. | ||
184 | */ | ||
185 | const string& gateway_interface() const; | ||
186 | /** | ||
187 | * Retrieve the PATH_INFO meta-variable (see RFC3875) | ||
188 | * @return path to be interpreted by the script. | ||
189 | */ | ||
190 | const string& path_info() const; | ||
191 | /** | ||
192 | * Retrieve the PATH_TRANSLATED meta-variable (see RFC3875) | ||
193 | * @return the translated path to the document. | ||
194 | */ | ||
195 | const string& path_translated() const; | ||
196 | /** | ||
197 | * Retrieve the QUERY_STRING meta-variable (see RFC3875) | ||
198 | * @return the query string. | ||
199 | */ | ||
200 | const string& query_string() const; | ||
201 | /** | ||
202 | * Retrieve the REMOTE_ADDR meta-variable (see RFC3875) | ||
203 | * @return the network address of the remote host. | ||
204 | */ | ||
205 | const string& remote_addr() const; | ||
206 | /** | ||
207 | * Retrieve the REMOTE_HOST meta-variable (see RFC3875) | ||
208 | * @return the fully qualified domain name of the client if | ||
209 | * available. REMOTE_ADDR otherwise. | ||
210 | * @see remote_addr() | ||
211 | */ | ||
212 | const string& remote_host() const; | ||
213 | /** | ||
214 | * Retrieve the REMOTE_IDENT meta-variable (see RFC3875) | ||
215 | * @return remote user identity (see RFC1413). | ||
216 | */ | ||
217 | const string& remote_ident() const; | ||
218 | /** | ||
219 | * Retrieve the REMOTE_USER meta-variable (see RFC3875) | ||
220 | * @return the authenticated user name. | ||
221 | */ | ||
222 | const string& remote_user() const; | ||
223 | /** | ||
224 | * Retrieve the REQUEST_METHOD meta-variable (see RFC3875) | ||
225 | * @return the http request method. | ||
226 | */ | ||
227 | const string& request_method() const; | ||
228 | /** | ||
229 | * Retrieve the SCRIPT_NAME meta-variable (see RFC3875) | ||
230 | * @return the uri path identifying the script. | ||
231 | */ | ||
232 | const string& script_name() const; | ||
233 | /** | ||
234 | * Retrieve the SERVER_NAME meta-variable (see RFC3875) | ||
235 | * @return the server name of the script. | ||
236 | */ | ||
237 | const string& server_name() const; | ||
238 | /** | ||
239 | * Retrieve the SERVER_PORT meta-variable (see RFC3875) | ||
240 | * @return the port on which request was received. | ||
241 | */ | ||
242 | unsigned int server_port() const; | ||
243 | /** | ||
244 | * Retrieve the SERVER_PROTOCOL meta-variable (see RFC3875) | ||
245 | * @return the protocol used for the request. | ||
246 | */ | ||
247 | const string& server_protocol() const; | ||
248 | /** | ||
249 | * Retrieve the SERVER_SOFTWARE meta-variable (see RFC3875) | ||
250 | * @return the name and version of server software. | ||
251 | */ | ||
252 | const string& server_software() const; | ||
253 | |||
149 | private: | 254 | private: |