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

namespace coreutils {
   
   IMFFormData::IMFFormData() {}

   IMFFormData::IMFFormData(ZString &in, ZString boundary) : IMFMultipart(in, boundary) {
      
   }
   
   IMFBody * IMFFormData::getByName(ZString name) {
      for(ZString section: sections) {
         IMFMessage message(section);
         if(message.getHeaderKeyPairValue((char *)"Content-Disposition", (char *)"name").equals(name)) {
            return message.getBody();		      
         }         
      }
      return new IMFBody();
   }
   
}
