Switch to side-by-side view

--- a/src/internfile/mh_mail.h
+++ b/src/internfile/mh_mail.h
@@ -16,8 +16,9 @@
  */
 #ifndef _MAIL_H_INCLUDED_
 #define _MAIL_H_INCLUDED_
-/* @(#$Id: mh_mail.h,v 1.8 2006-09-19 14:30:39 dockes Exp $  (C) 2004 J.F.Dockes */
+/* @(#$Id: mh_mail.h,v 1.9 2006-12-15 12:40:02 dockes Exp $  (C) 2004 J.F.Dockes */
 
+#include <sstream>
 #include "mimehandler.h"
 
 namespace Binc {
@@ -30,26 +31,21 @@
  * for maildir files). This has to keep state while parsing a mail folder
  * file. 
  */
-class MimeHandlerMail : public MimeHandler {
+class MimeHandlerMail : public RecollFilter {
  public:
-    MimeHandlerMail() : m_vfp(0), m_msgnum(0), m_conf(0) {}
-
-    virtual MimeHandler::Status 
-	mkDoc(RclConfig *conf, const std::string &fn, 
-	      const std::string &mtype, Rcl::Doc &docout, std::string& ipath);
-
+    MimeHandlerMail(const string &mt) 
+	: RecollFilter(mt), m_bincdoc(0), m_fd(-1), m_stream(0) 
+    {}
     virtual ~MimeHandlerMail();
-
+    virtual bool set_document_file(const string &file_path);
+    virtual bool set_document_string(const string &data);
+    virtual bool next_document();
  private:
-    void      *m_vfp;    // File pointer for folder
-    int        m_msgnum; // Current message number in folder. Starts at 1
-    RclConfig *m_conf;   // Keep pointer to rclconfig around
-
-    MimeHandler::Status processmbox(const string &fn, Rcl::Doc &docout, 
-				   string &ipath);
-    MimeHandler::Status processMsg(Rcl::Doc &docout, Binc::MimePart& doc,
-				   int depth);
-    void walkmime(Rcl::Doc &docout, Binc::MimePart& doc, int depth);
+    Binc::MimeDocument *m_bincdoc;
+    bool processMsg(Binc::MimePart *doc, int depth);
+    void walkmime(Binc::MimePart* doc, int depth);
+    int m_fd;
+    std::stringstream *m_stream;
 };
 
 #endif /* _MAIL_H_INCLUDED_ */