#include "IMFFormData.h"
#include "IMFMessage.h"
#include "IMFPlainText.h"

namespace coreutils {

   IMFFormData::IMFFormData() {}

   IMFFormData::IMFFormData(ZString &in, ZString &boundary) : IMFMultipart(in, boundary) {}

   ZString IMFFormData::getByName(ZString &name) {
      for(ZString section: sections) {
         IMFMessage message(section);
         if(message.getHeaderKeyPairValue("Content-Disposition", ("name")).equals(name)) {
            return message.multipart;
         }
      }
      return ZString();
   }

}
