Switch to unified view

a/src/common/rclconfig.h b/src/common/rclconfig.h
...
...
20
#include <string>
20
#include <string>
21
#include <vector>
21
#include <vector>
22
#include <set>
22
#include <set>
23
#include <utility>
23
#include <utility>
24
#include <map>
24
#include <map>
25
#include "unordered_defs.h"
25
26
26
using std::string;
27
using std::string;
27
using std::vector;
28
using std::vector;
28
using std::pair;
29
using std::pair;
29
using std::set;
30
using std::set;
...
...
46
    string    paramname;
47
    string    paramname;
47
    bool      active; // Check at init if config defines name at all
48
    bool      active; // Check at init if config defines name at all
48
    int       savedkeydirgen;
49
    int       savedkeydirgen;
49
    string    savedvalue;
50
    string    savedvalue;
50
51
51
    void init(RclConfig *rconf, ConfNull *cnf, const string& nm);
52
    ParamStale(RclConfig *rconf, const string& nm);
53
    void init(ConfNull *cnf);
52
    bool needrecompute();
54
    bool needrecompute();
53
};
55
};
54
56
55
// Hold the description for an external metadata-gathering command
57
// Hold the description for an external metadata-gathering command
56
struct MDReaper {
58
struct MDReaper {
...
...
73
75
74
    // Constructor: we normally look for a configuration file, except
76
    // Constructor: we normally look for a configuration file, except
75
    // if this was specified on the command line and passed through
77
    // if this was specified on the command line and passed through
76
    // argcnf
78
    // argcnf
77
    RclConfig(const string *argcnf = 0);
79
    RclConfig(const string *argcnf = 0);
80
81
    RclConfig(const RclConfig &r) 
82
    : m_stpsuffstate(this, "recoll_noindex"),
83
      m_skpnstate(this, "skippedNames"),
84
      m_rmtstate(this, "indexedmimetypes"),
85
      m_xmtstate(this, "excludedmimetypes"),
86
      m_mdrstate(this, "metadatacmds") {
87
        initFrom(r);
88
    }
89
90
    ~RclConfig() {
91
  freeAll();
92
    }
78
93
79
    // Return a writable clone of the main config. This belongs to the
94
    // Return a writable clone of the main config. This belongs to the
80
    // caller (must delete it when done)
95
    // caller (must delete it when done)
81
    ConfNull *cloneMainConfig();
96
    ConfNull *cloneMainConfig();
82
97
...
...
224
    /** mimeconf: get query lang frag for named filter */
239
    /** mimeconf: get query lang frag for named filter */
225
    bool getGuiFilter(const string& filtername, string& frag) const;
240
    bool getGuiFilter(const string& filtername, string& frag) const;
226
241
227
    /** fields: get field prefix from field name */
242
    /** fields: get field prefix from field name */
228
    bool getFieldTraits(const string& fldname, const FieldTraits **) const;
243
    bool getFieldTraits(const string& fldname, const FieldTraits **) const;
244
229
    const set<string>& getStoredFields() const {return m_storedFields;}
245
    const set<string>& getStoredFields() const {return m_storedFields;}
246
230
    set<string> getIndexedFields() const;
247
    set<string> getIndexedFields() const;
248
231
    /** Get canonic name for possible alias */
249
    /** Get canonic name for possible alias */
232
    string fieldCanon(const string& fld) const;
250
    string fieldCanon(const string& fld) const;
251
233
    /** Get xattr name to field names translations */
252
    /** Get xattr name to field names translations */
234
    const map<string, string>& getXattrToField() const {return m_xattrtofld;}
253
    const map<string, string>& getXattrToField() const {return m_xattrtofld;}
254
235
    /** Get value of a parameter inside the "fields" file. Only some filters 
255
    /** Get value of a parameter inside the "fields" file. Only some filters 
236
        use this (ie: mh_mail). The information specific to a given filter
256
     * use this (ie: mh_mail). The information specific to a given filter
237
        is typically stored in a separate section(ie: [mail]) */
257
     * is typically stored in a separate section(ie: [mail]) 
258
     */
238
    vector<string> getFieldSectNames(const string &sk, const char* = 0) const;
259
    vector<string> getFieldSectNames(const string &sk, const char* = 0) const;
239
    bool getFieldConfParam(const string &name, const string &sk, string &value)
260
    bool getFieldConfParam(const string &name, const string &sk, string &value)
240
    const;
261
    const;
241
262
242
    /** mimeview: get/set external viewer exec string(s) for mimetype(s) */
263
    /** mimeview: get/set external viewer exec string(s) for mimetype(s) */
...
...
270
    const string& getOrigCwd() 
291
    const string& getOrigCwd() 
271
    {
292
    {
272
    return o_origcwd;
293
    return o_origcwd;
273
    }
294
    }
274
295
275
    ~RclConfig() {
276
  freeAll();
277
    }
278
279
    RclConfig(const RclConfig &r) {
280
  initFrom(r);
281
    }
282
    RclConfig& operator=(const RclConfig &r) {
296
    RclConfig& operator=(const RclConfig &r) {
283
    if (this != &r) {
297
    if (this != &r) {
284
        freeAll();
298
        freeAll();
285
        initFrom(r);
299
        initFrom(r);
286
    }
300
    }
...
...
324
    // Parameters auto-fetched on setkeydir
338
    // Parameters auto-fetched on setkeydir
325
    string m_defcharset;
339
    string m_defcharset;
326
    static string o_localecharset;
340
    static string o_localecharset;
327
    // Limiting set of mime types to be processed. Normally empty.
341
    // Limiting set of mime types to be processed. Normally empty.
328
    ParamStale    m_rmtstate;
342
    ParamStale    m_rmtstate;
329
    set<string>   m_restrictMTypes; 
343
    STD_UNORDERED_SET<string>   m_restrictMTypes; 
344
    // Exclusion set of mime types. Normally empty
345
    ParamStale    m_xmtstate;
346
    STD_UNORDERED_SET<string>   m_excludeMTypes; 
347
330
    vector<pair<int, int> > m_thrConf;
348
    vector<pair<int, int> > m_thrConf;
331
349
332
    // Same idea with the metadata-gathering external commands,
350
    // Same idea with the metadata-gathering external commands,
333
    // (e.g. used to reap tagging info: "tmsu tags %f")
351
    // (e.g. used to reap tagging info: "tmsu tags %f")
334
    ParamStale    m_mdrstate;
352
    ParamStale    m_mdrstate;