Switch to unified view

a/src/internfile/internfile.h b/src/internfile/internfile.h
...
...
36
namespace Rcl {
36
namespace Rcl {
37
class Doc;
37
class Doc;
38
}
38
}
39
39
40
struct stat;
40
struct stat;
41
42
/** Storage for missing helper program info. We want to keep this out of the 
43
 * FileInterner class, because the data will typically be accumulated by several
44
 * FileInterner objects. Can't use static member either (because there
45
 * may be several separate usages of the class which shouldn't mix
46
 * their data).
47
 */
48
class FIMissingStore {
49
public:
50
    // Missing external programs
51
    set<string>           m_missingExternal;
52
    map<string, set<string> > m_typesForMissing;
53
};
41
54
42
/** 
55
/** 
43
 * A class to convert data from a datastore (file-system, firefox
56
 * A class to convert data from a datastore (file-system, firefox
44
 * history, etc.)  into possibly one or severaldocuments in internal
57
 * history, etc.)  into possibly one or severaldocuments in internal
45
 * representation, either for indexing or viewing at query time (gui preview).
58
 * representation, either for indexing or viewing at query time (gui preview).
...
...
108
    FileInterner(const Rcl::Doc& idoc, RclConfig *cnf, TempDir &td, 
121
    FileInterner(const Rcl::Doc& idoc, RclConfig *cnf, TempDir &td, 
109
                 int flags);
122
                 int flags);
110
123
111
    ~FileInterner();
124
    ~FileInterner();
112
125
126
    void setMissingStore(FIMissingStore *st)
127
    {
128
  m_missingdatap = st;
129
    }
130
113
    /** 
131
    /** 
114
     * Turn file or file part into Recoll document.
132
     * Turn file or file part into Recoll document.
115
     * 
133
     * 
116
     * For multidocument files (ie: mail folder), this must be called multiple
134
     * For multidocument files (ie: mail folder), this must be called multiple
117
     * times to retrieve the subdocuments
135
     * times to retrieve the subdocuments
...
...
167
     */
185
     */
168
    static bool maybeUncompressToTemp(TempFile& temp, const string& fn, 
186
    static bool maybeUncompressToTemp(TempFile& temp, const string& fn, 
169
                                      RclConfig *cnf, const Rcl::Doc& doc);
187
                                      RclConfig *cnf, const Rcl::Doc& doc);
170
188
171
    const string& getReason() const {return m_reason;}
189
    const string& getReason() const {return m_reason;}
172
    static void getMissingExternal(string& missing);
190
    static void getMissingExternal(FIMissingStore *st, string& missing);
173
    static void getMissingDescription(string& desc);
191
    static void getMissingDescription(FIMissingStore *st, string& desc);
174
    bool ok() {return m_ok;}
192
    bool ok() {return m_ok;}
175
176
193
177
 private:
194
 private:
178
    static const unsigned int MAXHANDLERS = 20;
195
    static const unsigned int MAXHANDLERS = 20;
179
    RclConfig             *m_cfg;
196
    RclConfig             *m_cfg;
180
    string                 m_fn;
197
    string                 m_fn;
...
...
201
    // Temporary files used for decoding the current stack
218
    // Temporary files used for decoding the current stack
202
    bool                   m_tmpflgs[MAXHANDLERS];
219
    bool                   m_tmpflgs[MAXHANDLERS];
203
    vector<TempFile>       m_tempfiles;
220
    vector<TempFile>       m_tempfiles;
204
    // Error data if any
221
    // Error data if any
205
    string                 m_reason;
222
    string                 m_reason;
206
    // Missing external programs
223
    FIMissingStore        *m_missingdatap;
207
    static set<string>           o_missingExternal;
208
    static map<string, set<string> > o_typesForMissing;
209
224
210
    // Pseudo-constructors
225
    // Pseudo-constructors
211
    void init(const string &fn, const struct stat *stp, 
226
    void init(const string &fn, const struct stat *stp, 
212
              RclConfig *cnf, int flags, const string *mtype = 0);
227
              RclConfig *cnf, int flags, const string *mtype = 0);
213
    void init(const string &data, RclConfig *cnf, int flags, 
228
    void init(const string &data, RclConfig *cnf, int flags,