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"
|
#include "Log.h"
|
||||||
|
|
||||||
namespace coreutils {
|
namespace coreutils {
|
||||||
|
|
||||||
IMFMessage::IMFMessage() : ZString() {
|
IMFMessage::IMFMessage() : ZString() {
|
||||||
}
|
}
|
||||||
|
|
||||||
IMFMessage::IMFMessage(ZString &in) : ZString(in) {
|
IMFMessage::IMFMessage(ZString &in) : ZString(in) {
|
||||||
|
|
||||||
while (!in.ifNext((char *)"\r\n")) {
|
while (!in.ifNext((char *)"\r\n")) {
|
||||||
headers.emplace_back(in);
|
headers.emplace_back(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZString type = getHeader((char *)"Content-Type");
|
ZString type = getHeader((char *)"Content-Type");
|
||||||
int len = getHeader((char *)"Content-Length").asInteger();
|
int len = getHeader((char *)"Content-Length").asInteger();
|
||||||
if(len > 0) {
|
if(len > 0) {
|
||||||
ZString block = in.readBlock(len);
|
ZString block = in.readBlock(len);
|
||||||
if(type.equals((char *)"multipart/form-data"))
|
if(type.equals((char *)"multipart/form-data"))
|
||||||
body = new IMFMultipart(block, getHeaderKeyPairValue((char *)"Content-Type", (char *)"boundary"));
|
body = new IMFMultipart(block, getHeaderKeyPairValue((char *)"Content-Type", (char *)"boundary"));
|
||||||
else if(type.equals((char *)"text/plain"))
|
else if(type.equals((char *)"text/plain"))
|
||||||
body = new IMFPlainText(block);
|
body = new IMFPlainText(block);
|
||||||
else
|
else
|
||||||
|
@ -24,6 +24,8 @@ namespace coreutils {
|
|||||||
cursor = data;
|
cursor = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZString::ZString(const ZString&) {}
|
||||||
|
|
||||||
ZString::ZString(const char *data) : data((char *)data), length(strlen(data)), cursor((char *)data) {}
|
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) {}
|
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
|
/// 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();
|
std::vector<ZString> & getList();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the integer value of the ZString from the cursor to the first
|
/// Return the integer value of the ZString from the cursor to the first
|
||||||
/// non-numeric character.
|
/// non-numeric character.
|
||||||
///
|
///
|
||||||
|
|
||||||
int asInteger();
|
int asInteger();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Return the value of the ZString from the cursor to the end.
|
/// Return the value of the ZString from the cursor to the end.
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user