Working Compiling Version
This commit is contained in:
parent
78cb2fdd10
commit
ff4d818f8b
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"cmake.configureOnOpen": false
|
||||
}
|
@ -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
|
||||
|
@ -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) {}
|
||||
|
10
ZString.h
10
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<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.
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user