Switch to unified view

a/src/internfile/mimehandler.h b/src/internfile/mimehandler.h
1
#ifndef _MIMEHANDLER_H_INCLUDED_
1
#ifndef _MIMEHANDLER_H_INCLUDED_
2
#define _MIMEHANDLER_H_INCLUDED_
2
#define _MIMEHANDLER_H_INCLUDED_
3
/* @(#$Id: mimehandler.h,v 1.6 2005-03-25 09:40:27 dockes Exp $  (C) 2004 J.F.Dockes */
3
/* @(#$Id: mimehandler.h,v 1.7 2005-11-08 21:02:55 dockes Exp $  (C) 2004 J.F.Dockes */
4
4
5
#include <string>
5
#include <string>
6
#include <list>
6
#include <list>
7
7
8
#include "rclconfig.h"
8
#include "rclconfig.h"
...
...
14
 */
14
 */
15
class MimeHandler {
15
class MimeHandler {
16
 public:
16
 public:
17
    virtual ~MimeHandler() {}
17
    virtual ~MimeHandler() {}
18
18
19
    /// Status from mkDoc method.
20
    enum Status {MHError, MHDone, MHAgain};
19
    /**
21
    /**
20
     * Transform external data into internal utf8 document
22
     * Transform external data into internal utf8 document
21
     *
23
     *
22
     * @param conf the global configuration
24
     * @param conf the global configuration
23
     * @param filename File from which the data comes from
25
     * @param filename File from which the data comes from
...
...
29
     *              multiple emails. If this is not empty in input, then the
31
     *              multiple emails. If this is not empty in input, then the
30
     *              caller is requesting a single document (ie: for display).
32
     *              caller is requesting a single document (ie: for display).
31
     *              If this is empty (during indexation), it will be filled-up
33
     *              If this is empty (during indexation), it will be filled-up
32
     *              by the function, and all the file's documents will be 
34
     *              by the function, and all the file's documents will be 
33
     *              returned by successive calls.
35
     *              returned by successive calls.
34
     * @return the return value indicates if there are more documents to be 
36
     * @return The return value indicates if there are more documents to be 
35
     *         fetched from the same file.
37
     *         fetched from the same file.
36
     */
38
     */
37
    enum Status {MHError, MHDone, MHAgain};
39
    virtual MimeHandler::Status mkDoc(RclConfig * conf, 
38
    virtual Status worker(RclConfig * conf, const std::string &filename, 
40
                    const std::string &filename, 
39
              const std::string &mimetype, Rcl::Doc& outdoc,
41
                    const std::string &mimetype, 
42
                    Rcl::Doc& outdoc,
40
              string& ipath) = 0;
43
                    string& ipath) = 0;
41
};
44
};
42
45
43
/**
46
/**
44
 * Return indexing handler class for given mime type
47
 * Return indexing handler object for the given mime type
45
 * returned pointer should be deleted by caller
48
 * returned pointer should be deleted by caller
46
 */
49
 */
47
extern MimeHandler *getMimeHandler(const std::string &mtyp, ConfTree *mhdlers);
50
extern MimeHandler *getMimeHandler(const std::string &mtyp, ConfTree *mhdlers);
48
51
49
/**
52
/**