|
a/src/internfile/mimehandler.h |
|
b/src/internfile/mimehandler.h |
|
... |
|
... |
21 |
|
21 |
|
22 |
#include <string>
|
22 |
#include <string>
|
23 |
#include <list>
|
23 |
#include <list>
|
24 |
using std::string;
|
24 |
using std::string;
|
25 |
using std::list;
|
25 |
using std::list;
|
26 |
#ifdef RCL_USE_XATTR
|
|
|
27 |
#include <map>
|
|
|
28 |
using std::map;
|
|
|
29 |
#endif // RCL_USE_XATTR
|
|
|
30 |
|
26 |
|
31 |
#include <Filter.h>
|
27 |
#include <Filter.h>
|
32 |
|
28 |
|
33 |
class RclConfig;
|
29 |
class RclConfig;
|
34 |
|
30 |
|
|
... |
|
... |
54 |
}
|
50 |
}
|
55 |
|
51 |
|
56 |
// We don't use this for now
|
52 |
// We don't use this for now
|
57 |
virtual bool set_document_uri(const std::string &) {return false;}
|
53 |
virtual bool set_document_uri(const std::string &) {return false;}
|
58 |
|
54 |
|
59 |
/// This does the extended attributes thing if enabled and should
|
55 |
/// This does nothing right now but should be called from the
|
60 |
/// be called from subclasses.
|
56 |
/// subclass method in case we need some common processing one day
|
|
|
57 |
/// (was used for xattrs at some point).
|
61 |
virtual bool set_document_file(const string &file_path);
|
58 |
virtual bool set_document_file(const string &file_path) {return true;}
|
62 |
|
59 |
|
63 |
// Default implementations
|
60 |
// Default implementations
|
64 |
virtual bool set_document_string(const std::string &) {return false;}
|
61 |
virtual bool set_document_string(const std::string &) {return false;}
|
65 |
virtual bool set_document_data(const char *cp, unsigned int sz) {
|
62 |
virtual bool set_document_data(const char *cp, unsigned int sz) {
|
66 |
return set_document_string(string(cp, sz));
|
63 |
return set_document_string(string(cp, sz));
|
|
... |
|
... |
88 |
virtual void clear() {
|
85 |
virtual void clear() {
|
89 |
Dijon::Filter::clear();
|
86 |
Dijon::Filter::clear();
|
90 |
m_forPreview = m_havedoc = false;
|
87 |
m_forPreview = m_havedoc = false;
|
91 |
m_defcharset.clear();
|
88 |
m_defcharset.clear();
|
92 |
m_reason.clear();
|
89 |
m_reason.clear();
|
93 |
#ifdef RCL_USE_XATTR
|
|
|
94 |
m_fieldsFromAttrs.clear();
|
|
|
95 |
#endif // RCL_USE_XATTR
|
|
|
96 |
}
|
90 |
}
|
97 |
#ifdef RCL_USE_XATTR
|
|
|
98 |
const map<string, string>& getFieldsFromAttrs() {return m_fieldsFromAttrs;}
|
|
|
99 |
#endif // RCL_USE_XATTR
|
|
|
100 |
|
91 |
|
101 |
protected:
|
92 |
protected:
|
102 |
bool m_forPreview;
|
93 |
bool m_forPreview;
|
103 |
string m_defcharset;
|
94 |
string m_defcharset;
|
104 |
string m_reason;
|
95 |
string m_reason;
|
105 |
bool m_havedoc;
|
96 |
bool m_havedoc;
|
106 |
#ifdef RCL_USE_XATTR
|
|
|
107 |
map<string, string> m_fieldsFromAttrs;
|
|
|
108 |
#endif // RCL_USE_XATTR
|
|
|
109 |
};
|
97 |
};
|
110 |
|
98 |
|
111 |
/**
|
99 |
/**
|
112 |
* Return indexing handler object for the given mime type
|
100 |
* Return indexing handler object for the given mime type
|
113 |
* returned pointer should be deleted by caller
|
101 |
* returned pointer should be deleted by caller
|