|
a/src/internfile/mimehandler.h |
|
b/src/internfile/mimehandler.h |
|
... |
|
... |
17 |
#ifndef _MIMEHANDLER_H_INCLUDED_
|
17 |
#ifndef _MIMEHANDLER_H_INCLUDED_
|
18 |
#define _MIMEHANDLER_H_INCLUDED_
|
18 |
#define _MIMEHANDLER_H_INCLUDED_
|
19 |
#include "autoconfig.h"
|
19 |
#include "autoconfig.h"
|
20 |
|
20 |
|
21 |
#include <stdio.h>
|
21 |
#include <stdio.h>
|
22 |
|
22 |
#include <stdint.h>
|
23 |
#include <string>
|
23 |
#include <string>
|
24 |
|
24 |
|
25 |
#include "Filter.h"
|
25 |
#include "Filter.h"
|
26 |
#include "cstr.h"
|
26 |
#include "cstr.h"
|
27 |
#include "smallut.h"
|
27 |
#include "smallut.h"
|
|
... |
|
... |
29 |
class RclConfig;
|
29 |
class RclConfig;
|
30 |
|
30 |
|
31 |
class RecollFilter : public Dijon::Filter {
|
31 |
class RecollFilter : public Dijon::Filter {
|
32 |
public:
|
32 |
public:
|
33 |
RecollFilter(RclConfig *config, const std::string& id)
|
33 |
RecollFilter(RclConfig *config, const std::string& id)
|
34 |
: m_config(config), m_forPreview(false), m_havedoc(false), m_id(id) {
|
34 |
: m_config(config), m_id(id) {
|
35 |
}
|
35 |
}
|
36 |
virtual ~RecollFilter() {}
|
36 |
virtual ~RecollFilter() {}
|
37 |
|
37 |
|
38 |
virtual void setConfig(RclConfig *config) {
|
38 |
virtual void setConfig(RclConfig *config) {
|
39 |
m_config = config;
|
39 |
m_config = config;
|
|
... |
|
... |
80 |
const char *cp, size_t sz)
|
80 |
const char *cp, size_t sz)
|
81 |
{
|
81 |
{
|
82 |
return set_document_string(mtype, std::string(cp, sz));
|
82 |
return set_document_string(mtype, std::string(cp, sz));
|
83 |
}
|
83 |
}
|
84 |
|
84 |
|
85 |
virtual void set_docsize(off_t size) {
|
85 |
virtual void set_docsize(int64_t size) {
|
86 |
m_docsize = size;
|
86 |
m_docsize = size;
|
87 |
}
|
87 |
}
|
88 |
|
88 |
|
89 |
virtual off_t get_docsize() const {
|
89 |
virtual int64_t get_docsize() const {
|
90 |
return m_docsize;
|
90 |
return m_docsize;
|
91 |
}
|
91 |
}
|
92 |
|
92 |
|
93 |
virtual bool has_documents() const {
|
93 |
virtual bool has_documents() const {
|
94 |
return m_havedoc;
|
94 |
return m_havedoc;
|
|
... |
|
... |
144 |
bool preview() {
|
144 |
bool preview() {
|
145 |
return m_forPreview;
|
145 |
return m_forPreview;
|
146 |
}
|
146 |
}
|
147 |
|
147 |
|
148 |
RclConfig *m_config;
|
148 |
RclConfig *m_config;
|
149 |
bool m_forPreview;
|
149 |
bool m_forPreview{false};
|
150 |
std::string m_dfltInputCharset;
|
150 |
std::string m_dfltInputCharset;
|
151 |
std::string m_reason;
|
151 |
std::string m_reason;
|
152 |
bool m_havedoc;
|
152 |
bool m_havedoc{false};
|
153 |
std::string m_udi; // May be set by creator as a hint
|
153 |
std::string m_udi; // May be set by creator as a hint
|
154 |
// m_id is and md5 of the filter definition line (from mimeconf) and
|
154 |
// m_id is and md5 of the filter definition line (from mimeconf) and
|
155 |
// is used when fetching/returning filters to / from the cache.
|
155 |
// is used when fetching/returning filters to / from the cache.
|
156 |
std::string m_id;
|
156 |
std::string m_id;
|
157 |
off_t m_docsize; // Size of the top document
|
157 |
int64_t m_docsize{0}; // Size of the top document
|
158 |
};
|
158 |
};
|
159 |
|
159 |
|
160 |
/**
|
160 |
/**
|
161 |
* Return indexing handler object for the given mime type. The returned
|
161 |
* Return indexing handler object for the given mime type. The returned
|
162 |
* pointer should be passed to returnMimeHandler() for recycling, after use.
|
162 |
* pointer should be passed to returnMimeHandler() for recycling, after use.
|