summaryrefslogtreecommitdiffabout
path: root/include/kingate/cgi_gateway.h
Unidiff
Diffstat (limited to 'include/kingate/cgi_gateway.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/kingate/cgi_gateway.h57
1 files changed, 54 insertions, 3 deletions
diff --git a/include/kingate/cgi_gateway.h b/include/kingate/cgi_gateway.h
index f20d72b..a26b0ae 100644
--- a/include/kingate/cgi_gateway.h
+++ b/include/kingate/cgi_gateway.h
@@ -45,2 +45,33 @@ namespace kingate {
45 /** 45 /**
46 * Abstract base class for retrieving posted files.
47 */
48 class basic_file_t {
49 public:
50 /**
51 * Retrieve file name.
52 * @return filename
53 */
54 virtual const string& filename() const = 0;
55 /**
56 * Retrieve file content type.
57 * @return content type
58 */
59 virtual const string& content_type() const = 0;
60 /**
61 * Retrieve file contents.
62 * @return reference to the stream for accessing file content.
63 */
64 virtual istream& content() = 0;
65 virtual ~basic_file_t();
66 };
67 typedef basic_file_t *file_t;
68 /**
69 * The map holding information pertaining to files uploaded via post.
70 */
71 typedef multimap<string,file_t> files_t;
72 /**
73 * Files uploaded via post
74 */
75 files_t files;
76 /**
46 * Cookies passed. 77 * Cookies passed.
@@ -56,3 +87,9 @@ namespace kingate {
56 */ 87 */
57 cgi_gateway(cgi_interface& ci); 88 cgi_gateway(cgi_interface& ci,bool parsebody = true);
89 virtual ~cgi_gateway() throw();
90
91 /**
92 * Parse request body.
93 */
94 void parse_request_body();
58 95
@@ -138,3 +175,3 @@ namespace kingate {
138 * @param n the parameter name. 175 * @param n the parameter name.
139 * @return true if yes. 176 * @return the parameter contents.
140 * @see exception_notfound. 177 * @see exception_notfound.
@@ -142,2 +179,16 @@ namespace kingate {
142 const string& get_param(const string& n) const; 179 const string& get_param(const string& n) const;
180 /**
181 * Check to see whether the file was uploaded in the request body.
182 * @param n the parameter name.
183 * @return true if yes.
184 */
185 bool has_file(const string& n) const;
186 /**
187 * Retrieve the file uploaded in the request body.
188 * @param n the parameter name.
189 * @return the file.
190 * @see exception_notfound.
191 */
192 const file_t get_file(const string& n) const;
193 file_t get_file(const string& n);
143 194
@@ -179,3 +230,3 @@ namespace kingate {
179 */ 230 */
180 unsigned long cgi_gateway::content_length() const; 231 unsigned long content_length() const;
181 /** 232 /**