diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..82cfcc9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cmake.configureOnOpen": false +} \ No newline at end of file diff --git a/IMFMessage.cpp b/IMFMessage.cpp index 6c2a61a..d204edc 100644 --- a/IMFMessage.cpp +++ b/IMFMessage.cpp @@ -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 diff --git a/ZString.cpp b/ZString.cpp index 5a58f75..b29e1f4 100644 --- a/ZString.cpp +++ b/ZString.cpp @@ -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) {} diff --git a/ZString.h b/ZString.h index c87fd8d..84d373d 100644 --- a/ZString.h +++ b/ZString.h @@ -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 & 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. ///