summaryrefslogtreecommitdiffstats
path: root/source/HTTPServer/HTTPFormParser.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-13 20:29:57 +0200
committermadmaxoft <github@xoft.cz>2013-10-13 20:29:57 +0200
commitefb7d4fd3e9d20facf6a5b3d41bee8ca3d894bbc (patch)
tree9a39bde0b280721461c7597631182a08d7921c86 /source/HTTPServer/HTTPFormParser.h
parentMerge branch 'metadata' of git://github.com/tigerw/MCServer into tigerw-metadata. (diff)
downloadcuberite-efb7d4fd3e9d20facf6a5b3d41bee8ca3d894bbc.tar
cuberite-efb7d4fd3e9d20facf6a5b3d41bee8ca3d894bbc.tar.gz
cuberite-efb7d4fd3e9d20facf6a5b3d41bee8ca3d894bbc.tar.bz2
cuberite-efb7d4fd3e9d20facf6a5b3d41bee8ca3d894bbc.tar.lz
cuberite-efb7d4fd3e9d20facf6a5b3d41bee8ca3d894bbc.tar.xz
cuberite-efb7d4fd3e9d20facf6a5b3d41bee8ca3d894bbc.tar.zst
cuberite-efb7d4fd3e9d20facf6a5b3d41bee8ca3d894bbc.zip
Diffstat (limited to 'source/HTTPServer/HTTPFormParser.h')
-rw-r--r--source/HTTPServer/HTTPFormParser.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/HTTPServer/HTTPFormParser.h b/source/HTTPServer/HTTPFormParser.h
index b92ef9d3c..a554ca5a4 100644
--- a/source/HTTPServer/HTTPFormParser.h
+++ b/source/HTTPServer/HTTPFormParser.h
@@ -26,6 +26,13 @@ class cHTTPFormParser :
public cMultipartParser::cCallbacks
{
public:
+ enum eKind
+ {
+ fpkURL, ///< The form has been transmitted as parameters to a GET request
+ fpkFormUrlEncoded, ///< The form has been POSTed or PUT, with Content-Type of "application/x-www-form-urlencoded"
+ fpkMultipart, ///< The form has been POSTed or PUT, with Content-Type of "multipart/form-data"
+ } ;
+
class cCallbacks
{
public:
@@ -40,8 +47,12 @@ public:
} ;
+ /// Creates a parser that is tied to a request and notifies of various events using a callback mechanism
cHTTPFormParser(cHTTPRequest & a_Request, cCallbacks & a_Callbacks);
+ /// Creates a parser with the specified content type that reads data from a string
+ cHTTPFormParser(eKind a_Kind, const char * a_Data, int a_Size, cCallbacks & a_Callbacks);
+
/// Adds more data into the parser, as the request body is received
void Parse(const char * a_Data, int a_Size);
@@ -54,12 +65,6 @@ public:
static bool HasFormData(const cHTTPRequest & a_Request);
protected:
- enum eKind
- {
- fpkURL, ///< The form has been transmitted as parameters to a GET request
- fpkFormUrlEncoded, ///< The form has been POSTed or PUT, with Content-Type of "application/x-www-form-urlencoded"
- fpkMultipart, ///< The form has been POSTed or PUT, with Content-Type of "multipart/form-data"
- };
/// The callbacks to call for incoming file data
cCallbacks & m_Callbacks;