Branch data Line data Source code
1 : : /*
2 : : * Copyright 2006-2009 Savarese Software Research Corporation
3 : : *
4 : : * Licensed under the Apache License, Version 2.0 (the "License");
5 : : * you may not use this file except in compliance with the License.
6 : : * You may obtain a copy of the License at
7 : : *
8 : : * https://www.savarese.com/software/ApacheLicense-2.0
9 : : *
10 : : * Unless required by applicable law or agreed to in writing, software
11 : : * distributed under the License is distributed on an "AS IS" BASIS,
12 : : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 : : * See the License for the specific language governing permissions and
14 : : * limitations under the License.
15 : : */
16 : :
17 : : /**
18 : : * @file
19 : : * This header defines the HTTPRequest class.
20 : : */
21 : :
22 : : #ifndef __SSRC_WSPR_FCGI_HTTP_REQUEST_H
23 : : #define __SSRC_WSPR_FCGI_HTTP_REQUEST_H
24 : :
25 : : #include <string>
26 : :
27 : : #include <ssrc/wispers-packages.h>
28 : :
29 : : __BEGIN_NS_SSRC_WSPR_FCGI
30 : :
31 : : using std::string;
32 : :
33 : : enum HTTPRequestMethod {
34 : : MethodDelete,
35 : : MethodGet,
36 : : MethodHead,
37 : : MethodOptions,
38 : : MethodPost,
39 : : MethodPut,
40 : : MethodTrace,
41 : : MethodMax = MethodTrace,
42 : : MethodUndefined
43 : : };
44 : :
45 : : const unsigned int MethodNum = MethodMax + 1;
46 : :
47 : : const char * const RequestMethodName[MethodNum] = {
48 : : "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE"
49 : : };
50 : :
51 : : struct HTTPRequest {
52 : :
53 [ # # ]: 0 : virtual ~HTTPRequest() { }
54 : :
55 : : virtual string auth_type() const = 0;
56 : : virtual string content_type() const = 0;
57 : : virtual long content_length() const = 0;
58 : : virtual string document_root() const = 0;
59 : : virtual string gateway_interface() const = 0;
60 : : virtual string path_info() const = 0;
61 : : virtual string path_translated() const = 0;
62 : : virtual string query_string() const = 0;
63 : : virtual string redirect_request() const = 0;
64 : : virtual string redirect_query_string() const = 0;
65 : : virtual string redirect_status() const = 0;
66 : : virtual string redirect_url() const = 0;
67 : : virtual string remote_address() const = 0;
68 : : virtual string remote_host() const = 0;
69 : : virtual string remote_ident() const = 0;
70 : : virtual int remote_port() const = 0;
71 : : virtual string remote_user() const = 0;
72 : : virtual string remote_group() const = 0;
73 : : virtual string request_method() const = 0;
74 : : virtual HTTPRequestMethod http_request_method() const = 0;
75 : : virtual string request_uri() const = 0;
76 : : virtual string script_filename() const = 0;
77 : : virtual string script_name() const = 0;
78 : : virtual string server_address() const = 0;
79 : : virtual string server_admin() const = 0;
80 : : virtual string server_name() const = 0;
81 : : virtual int server_port() const = 0;
82 : : virtual string server_root() const = 0;
83 : : virtual string server_protocol() const = 0;
84 : : virtual string server_software() const = 0;
85 : :
86 : : virtual bool https() const = 0;
87 : : virtual string scheme() const = 0;
88 : :
89 : : virtual string header_value(const string & header) const = 0;
90 : : };
91 : :
92 : : __END_NS_SSRC_WSPR_FCGI
93 : :
94 : : #endif
|