|
a/src/internfile/internfile.h |
|
b/src/internfile/internfile.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _INTERNFILE_H_INCLUDED_
|
17 |
#ifndef _INTERNFILE_H_INCLUDED_
|
18 |
#define _INTERNFILE_H_INCLUDED_
|
18 |
#define _INTERNFILE_H_INCLUDED_
|
19 |
/* @(#$Id: internfile.h,v 1.6 2006-01-30 11:15:27 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: internfile.h,v 1.7 2006-12-15 12:40:02 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
|
|
22 |
#include <vector>
|
|
|
23 |
using std::string;
|
|
|
24 |
using std::vector;
|
22 |
|
25 |
|
23 |
#include "rclconfig.h"
|
|
|
24 |
#include "rcldb.h"
|
26 |
#include "Filter.h"
|
25 |
|
27 |
|
26 |
class MimeHandler;
|
28 |
class RclConfig;
|
|
|
29 |
namespace Rcl {
|
|
|
30 |
class Doc;
|
|
|
31 |
}
|
27 |
|
32 |
|
28 |
/// Turn external file into internal representation, according to mime
|
33 |
/// Turn external file into internal representation, according to mime
|
29 |
/// type etc
|
34 |
/// type etc
|
30 |
class FileInterner {
|
35 |
class FileInterner {
|
31 |
public:
|
36 |
public:
|
|
... |
|
... |
41 |
* decompression needed.
|
46 |
* decompression needed.
|
42 |
* @param mtype mime type if known. For a compressed file this is the
|
47 |
* @param mtype mime type if known. For a compressed file this is the
|
43 |
* mime type for the uncompressed version. This currently doubles up
|
48 |
* mime type for the uncompressed version. This currently doubles up
|
44 |
* to indicate that this object is for previewing (not indexing).
|
49 |
* to indicate that this object is for previewing (not indexing).
|
45 |
*/
|
50 |
*/
|
46 |
FileInterner(const std::string &fn, RclConfig *cnf, const string& td,
|
51 |
FileInterner(const string &fn, RclConfig *cnf, const string& td,
|
47 |
const std::string *mtype = 0);
|
52 |
const string *mtype = 0);
|
48 |
|
53 |
|
49 |
~FileInterner();
|
54 |
~FileInterner();
|
50 |
|
55 |
|
51 |
/// Return values for internfile()
|
56 |
/// Return values for internfile()
|
52 |
enum Status {FIError, FIDone, FIAgain};
|
57 |
enum Status {FIError, FIDone, FIAgain};
|
|
... |
|
... |
65 |
* should be called again to get the following one(s).
|
70 |
* should be called again to get the following one(s).
|
66 |
*/
|
71 |
*/
|
67 |
Status internfile(Rcl::Doc& doc, string &ipath);
|
72 |
Status internfile(Rcl::Doc& doc, string &ipath);
|
68 |
|
73 |
|
69 |
private:
|
74 |
private:
|
70 |
string m_fn;
|
|
|
71 |
RclConfig *m_cfg;
|
75 |
RclConfig *m_cfg;
|
|
|
76 |
string m_fn;
|
|
|
77 |
bool m_forPreview;
|
|
|
78 |
// m_tdir and m_tfile are used only for decompressing input file if needed
|
72 |
const string &m_tdir;
|
79 |
const string& m_tdir;
|
73 |
MimeHandler *m_handler;
|
80 |
string m_tfile;
|
74 |
|
81 |
vector<Dijon::Filter*> m_handlers;
|
75 |
string m_tfile;
|
|
|
76 |
string m_mime;
|
|
|
77 |
|
82 |
|
78 |
void tmpcleanup();
|
83 |
void tmpcleanup();
|
|
|
84 |
static bool dijontorcl(Dijon::Filter *, Rcl::Doc&);
|
79 |
};
|
85 |
};
|
80 |
|
86 |
|
81 |
#endif /* _INTERNFILE_H_INCLUDED_ */
|
87 |
#endif /* _INTERNFILE_H_INCLUDED_ */
|