All sorts of new crap and adjustments

This commit is contained in:
barant committed 2021-07-23 11:44:36 -07:00
1 parent 5bd9e9ca21
commit ff2c2b7432
84 files changed
+5935 -664

No files matched your search

+23 -27
View File
@@ -1,34 +1,30 @@
#include "IMFMultipart.h"
#include "PString.h"
namespace coreutils {
IMFMultipart::IMFMultipart() {
buffer = "";
}
IMFMultipart::IMFMultipart(PString &in, std::string boundary) {
buffer = in.str();
in.cursor -= 2;
sections = in.split("\r\n--" + boundary);
for(int ix = 0; ix < sections.size(); ++ix) {
if(sections[ix].str() == "--\r\n")
sections[ix] = PString("");
if(sections[ix].str().substr(0, 2) == "\r\n")
sections[ix].cursor += 2;
IMFMultipart::IMFMultipart() {}
IMFMultipart::IMFMultipart(ZString &in, ZString boundary) {
std::stringstream temp;
temp << "\r\n--" << boundary;
sections = in.split((char *)temp.str().c_str());
for(int ix = 0; ix < sections.size(); ++ix) {
if(sections[ix].equals((char *)"--\r\n"))
sections[ix] = ZString((char *)"");
sections[ix].ifNext((char *)"\r\n");
}
}
std::string IMFMultipart::toString() {
return buffer;
}
int IMFMultipart::getCount() {
return sections.size();
}
PString IMFMultipart::getSectionAt(int index) {
return sections[index];
}
std::string IMFMultipart::toString() {
return std::string(getData(), getLength());
}
int IMFMultipart::getCount() {
return sections.size();
}
ZString IMFMultipart::getSectionAt(int index) {
return sections[index];
}
}