CoreUtils/IMFFormData.cpp

25 lines
582 B
C++

#include "IMFFormData.h"
#include "IMFMessage.h"
#include "IMFPlainText.h"
namespace coreutils {
IMFFormData::IMFFormData(PString &in, std::string boundary) : IMFMultipart(in, boundary) {
}
std::string IMFFormData::getByName(std::string name) {
std::string value;
for(PString section: sections) {
IMFMessage message(section);
if(message.getHeaderKeyPairValue("Content-Disposition", "name") == name) {
IMFPlainText *text = (IMFPlainText *)message.getBody();
return text->toString();
}
}
return "";
}
}