From ffa3361fd20cb2498175fa41ad89d1b70a9a11de Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Mon, 8 Dec 2025 16:35:15 -0800 Subject: [PATCH] CGIFormData work in progress. --- CGIFormData.cpp | 27 +++++++++++++++++++++++++++ CGIFormData.h | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 CGIFormData.cpp create mode 100644 CGIFormData.h diff --git a/CGIFormData.cpp b/CGIFormData.cpp new file mode 100644 index 0000000..59e0977 --- /dev/null +++ b/CGIFormData.cpp @@ -0,0 +1,27 @@ +#include "CGIFormData.h" +#include "IMFHeader.h" +#include "malloc.h" + +namespace coreutils { + + CGIFormData::CGIFormData(int fd, ZString contentType, int contentLength, ZString boundary) + : contentType(contentType) { + if(contentType == "application/x-www-form-urlencoded") { + setSize(contentLength); + read(fd, contentLength); + formdata = new CGIFormattedData(*this); + } else if(contentType == "multipart/form-data") { + + + } + + + } + + MString CGIFormData::operator[](ZString name) { + if(contentType == "application/x-www-form-urlencoded") + return formdata[name]; + return name; + } + +} diff --git a/CGIFormData.h b/CGIFormData.h new file mode 100644 index 0000000..945817e --- /dev/null +++ b/CGIFormData.h @@ -0,0 +1,27 @@ +#ifndef __CGIFormData_h__ +# define __IMFFormData_h__ + +#include "MString.h" +#include "ZString.h" +#include "CGIFormattedData.h" + +namespace coreutils { + + class CGIFormData : public MString { + + public: + CGIFormData(int fd, ZString contentType, int contentLength, ZString boundary); + + MString operator[](ZString name); + + private: + CGIFormattedData *formdata; + MString contentType; + + }; + +} + +#endif + +