Switch to unified view

a/src/internfile/mh_mail.h b/src/internfile/mh_mail.h
...
...
18
#define _MAIL_H_INCLUDED_
18
#define _MAIL_H_INCLUDED_
19
19
20
#include <sstream>
20
#include <sstream>
21
#include <vector>
21
#include <vector>
22
#include <map>
22
#include <map>
23
using std::vector;
24
using std::map;
25
23
26
#include "mimehandler.h"
24
#include "mimehandler.h"
27
25
28
namespace Binc {
26
namespace Binc {
29
    class MimeDocument;
27
    class MimeDocument;
...
...
37
 * for maildir files). This has to keep state while parsing a mail folder
35
 * for maildir files). This has to keep state while parsing a mail folder
38
 * file. 
36
 * file. 
39
 */
37
 */
40
class MimeHandlerMail : public RecollFilter {
38
class MimeHandlerMail : public RecollFilter {
41
public:
39
public:
42
    MimeHandlerMail(RclConfig *cnf, const string &id);
40
    MimeHandlerMail(RclConfig *cnf, const std::string &id);
43
    virtual ~MimeHandlerMail();
41
    virtual ~MimeHandlerMail();
44
    virtual bool set_document_file(const string& mt, const string& file_path);
45
    virtual bool set_document_string(const string& mt, const string& data);
46
    virtual bool is_data_input_ok(DataInput input) const {
42
    virtual bool is_data_input_ok(DataInput input) const {
47
    if (input == DOCUMENT_FILE_NAME || input == DOCUMENT_STRING)
43
    if (input == DOCUMENT_FILE_NAME || input == DOCUMENT_STRING)
48
        return true;
44
        return true;
49
    return false;
45
    return false;
50
    }
46
    }
51
    virtual bool next_document();
47
    virtual bool next_document();
52
    virtual bool skip_to_document(const string& ipath);
48
    virtual bool skip_to_document(const std::string& ipath);
53
    virtual void clear();
49
    virtual void clear();
50
51
protected:
52
    virtual bool set_document_file_impl(const std::string& mt,
53
                                        const std::string& file_path);
54
    virtual bool set_document_string_impl(const std::string& mt,
55
                                          const std::string& data);
54
56
55
private:
57
private:
56
    bool processMsg(Binc::MimePart *doc, int depth);
58
    bool processMsg(Binc::MimePart *doc, int depth);
57
    void walkmime(Binc::MimePart* doc, int depth);
59
    void walkmime(Binc::MimePart* doc, int depth);
58
    bool processAttach();
60
    bool processAttach();
...
...
63
    // Current index in parts. starts at -1 for self, then index into
65
    // Current index in parts. starts at -1 for self, then index into
64
    // attachments
66
    // attachments
65
    int                     m_idx; 
67
    int                     m_idx; 
66
    // Start of actual text (after the reprinted headers. This is for 
68
    // Start of actual text (after the reprinted headers. This is for 
67
    // generating a semi-meaningful "abstract")
69
    // generating a semi-meaningful "abstract")
68
    string::size_type       m_startoftext; 
70
    std::string::size_type       m_startoftext; 
69
    string                  m_subject; 
71
    std::string                  m_subject; 
70
    vector<MHMailAttach *>  m_attachments;
72
    std::vector<MHMailAttach *>  m_attachments;
71
    // Additional headers to be process as per config + field name translation
73
    // Additional headers to be process as per config + field name translation
72
    map<string,string>      m_addProcdHdrs; 
74
    std::map<std::string, std::string>      m_addProcdHdrs; 
73
};
75
};
74
76
75
class MHMailAttach {
77
class MHMailAttach {
76
public:
78
public:
77
    string          m_contentType;
79
    std::string          m_contentType;
78
    string          m_filename;
80
    std::string          m_filename;
79
    string          m_charset;
81
    std::string          m_charset;
80
    string          m_contentTransferEncoding;
82
    std::string          m_contentTransferEncoding;
81
    Binc::MimePart *m_part;
83
    Binc::MimePart *m_part;
82
};
84
};
83
85
84
#endif /* _MAIL_H_INCLUDED_ */
86
#endif /* _MAIL_H_INCLUDED_ */