#ifndef __IMFMessage_h__
#define __IMFMessage_h__

#include <typeinfo>
#include <sstream>
#include <string>
#include <vector>
#include "ZString.h"
#include "IMFMultipart.h"
#include "IMFHeader.h"

namespace coreutils {

   ///
   ///
   ///

   class IMFMessage : public ZString {

    public:
      IMFMessage();
      IMFMessage(ZString &in);
      virtual ~IMFMessage();

      void output(std::stringstream &out);

      void addHeader(IMFHeader header);

      ZString getHeader(ZString key, bool valueOnly = true);
      ZString getHeaderKeyPairValue(const char *headerKey, const char *key);
      ZString getHeaderKeyPairValue(ZString headerKey, ZString key);

      IMFMultipart multipart;
      ZString block;
      char contentLength[8];

    protected:
      std::vector<IMFHeader> headers;
      std::stringstream newHeaders;

   };

}

#endif
