Working Compiling Version

This commit is contained in:
Brad Arant 2021-08-07 11:47:01 -07:00
parent 78cb2fdd10
commit ff4d818f8b
4 changed files with 16 additions and 11 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"cmake.configureOnOpen": false
}

View File

@ -5,22 +5,22 @@
#include "Log.h"
namespace coreutils {
IMFMessage::IMFMessage() : ZString() {
}
IMFMessage::IMFMessage(ZString &in) : ZString(in) {
while (!in.ifNext((char *)"\r\n")) {
headers.emplace_back(in);
}
ZString type = getHeader((char *)"Content-Type");
int len = getHeader((char *)"Content-Length").asInteger();
if(len > 0) {
ZString block = in.readBlock(len);
if(type.equals((char *)"multipart/form-data"))
body = new IMFMultipart(block, getHeaderKeyPairValue((char *)"Content-Type", (char *)"boundary"));
if(type.equals((char *)"multipart/form-data"))
body = new IMFMultipart(block, getHeaderKeyPairValue((char *)"Content-Type", (char *)"boundary"));
else if(type.equals((char *)"text/plain"))
body = new IMFPlainText(block);
else

View File

@ -24,6 +24,8 @@ namespace coreutils {
cursor = data;
}
ZString::ZString(const ZString&) {}
ZString::ZString(const char *data) : data((char *)data), length(strlen(data)), cursor((char *)data) {}
ZString::ZString(char *data, size_t length) : data(data), length(length), cursor(data) {}

View File

@ -67,18 +67,18 @@ namespace coreutils {
///
/// Return a vector of ZString objects which contain the parts established
/// by using the split method and passing a delimiter value.
/// by using the split method and passing a delimiter value.
///
std::vector<ZString> & getList();
///
/// Return the integer value of the ZString from the cursor to the first
/// non-numeric character.
/// Return the integer value of the ZString from the cursor to the first
/// non-numeric character.
///
int asInteger();
///
/// Return the value of the ZString from the cursor to the end.
///