Updated and working.
This commit is contained in:
1 parent
d4148b0ab4
commit
a37c4e6829
30 files changed
+422
-226
No files matched your search
+17
-12
@@ -1,30 +1,35 @@
|
||||
#include "IMFMultipart.h"
|
||||
#include "Log.h"
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
|
||||
IMFMultipart::IMFMultipart() {}
|
||||
|
||||
IMFMultipart::IMFMultipart(ZString &in, ZString boundary) {
|
||||
|
||||
IMFMultipart::IMFMultipart(ZString &in, ZString &boundary) {
|
||||
Log(LOG_DEBUG_1) << in;
|
||||
std::stringstream temp;
|
||||
temp << "\r\n--" << boundary;
|
||||
sections = in.split((char *)temp.str().c_str());
|
||||
temp << "--" << boundary;
|
||||
sections = in.split(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");
|
||||
sections[ix].ifNext("\r\n");
|
||||
sections[ix].ifCRLF();
|
||||
Log(LOG_DEBUG_1) << "[" << sections[ix] << "].";
|
||||
if(sections[ix].equals("--"))
|
||||
sections[ix] = ZString("");
|
||||
sections[ix].ifNext("\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::string IMFMultipart::toString() {
|
||||
return std::string(getData(), getLength());
|
||||
}
|
||||
|
||||
|
||||
int IMFMultipart::getCount() {
|
||||
return sections.size();
|
||||
}
|
||||
|
||||
|
||||
ZString IMFMultipart::getSectionAt(int index) {
|
||||
return sections[index];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user