Switch to unified view

a/src/common/rclconfig.h b/src/common/rclconfig.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 _RCLCONFIG_H_INCLUDED_
17
#ifndef _RCLCONFIG_H_INCLUDED_
18
#define _RCLCONFIG_H_INCLUDED_
18
#define _RCLCONFIG_H_INCLUDED_
19
/* @(#$Id: rclconfig.h,v 1.28 2006-12-16 15:30:02 dockes Exp $  (C) 2004 J.F.Dockes */
19
/* @(#$Id: rclconfig.h,v 1.29 2006-12-20 09:54:17 dockes Exp $  (C) 2004 J.F.Dockes */
20
20
21
#include <list>
21
#include <list>
22
#include <string>
22
#include <string>
23
#include <vector>
23
#include <vector>
24
#include <utility>
24
#include <utility>
...
...
33
#include "smallut.h"
33
#include "smallut.h"
34
34
35
class RclConfig {
35
class RclConfig {
36
 public:
36
 public:
37
37
38
    RclConfig(const string *argcnf=0);
38
    RclConfig(const string *argcnf = 0);
39
    bool ok() {return m_ok;}
39
    bool ok() {return m_ok;}
40
    const string &getReason() {return m_reason;}
40
    const string &getReason() {return m_reason;}
41
    /** Return the directory where this config is stored */
41
    /** Return the directory where this config is stored */
42
    string getConfDir() {return m_confdir;}
42
    string getConfDir() {return m_confdir;}
43
43
...
...
81
81
82
    /** Get list of skipped names for current keydir */
82
    /** Get list of skipped names for current keydir */
83
    list<string> getSkippedNames();
83
    list<string> getSkippedNames();
84
84
85
    /** 
85
    /** 
86
     * Get list of ignored suffixes from mimemap
86
     * Check if file name should be ignored because of suffix
87
     *
87
     *
88
     * The list is initialized on first call, and not changed for subsequent
88
     * The list of ignored suffixes is initialized on first call, and
89
     * setKeydirs.
89
     * not changed for subsequent setKeydirs.
90
     */
90
     */
91
    const list<string>* getStopSuffixes();
91
    bool inStopSuffixes(const string& fn);
92
92
93
    /** 
93
    /** 
94
     * Check in mimeconf if input mime type is a compressed one, and
94
     * Check in mimeconf if input mime type is a compressed one, and
95
     * return command to uncompress if it is.
95
     * return command to uncompress if it is.
96
     *
96
     *
...
...
151
    ConfStack<ConfTree> *m_conf;   // Parsed configuration files
151
    ConfStack<ConfTree> *m_conf;   // Parsed configuration files
152
    ConfStack<ConfTree> *mimemap;  // The files don't change with keydir, 
152
    ConfStack<ConfTree> *mimemap;  // The files don't change with keydir, 
153
    ConfStack<ConfTree> *mimeconf; // but their content may depend on it.
153
    ConfStack<ConfTree> *mimeconf; // but their content may depend on it.
154
    ConfStack<ConfTree> *mimeview; // 
154
    ConfStack<ConfTree> *mimeview; // 
155
155
156
    list<string> *stopsuffixes;
156
    void        *m_stopsuffixes;
157
    unsigned int m_maxsufflen;
157
158
158
    // Parameters auto-fetched on setkeydir
159
    // Parameters auto-fetched on setkeydir
159
    string defcharset;   // These are stored locally to avoid 
160
    string defcharset;   // These are stored locally to avoid 
160
    bool   guesscharset; // They are fetched initially or on setKeydir()
161
    bool   guesscharset; // They are fetched initially or on setKeydir()
161
162
...
...
169
    m_ok = false; 
170
    m_ok = false; 
170
    m_conf = 0; 
171
    m_conf = 0; 
171
    mimemap = 0; 
172
    mimemap = 0; 
172
    mimeconf = 0; 
173
    mimeconf = 0; 
173
    mimeview = 0; 
174
    mimeview = 0; 
174
    stopsuffixes = 0;
175
    m_stopsuffixes = 0;
176
  m_maxsufflen = 0;
175
    }
177
    }
176
    /** Free data then zero pointers */
178
    /** Free data then zero pointers */
177
    void freeAll() {
179
    void freeAll();
178
  delete m_conf;
179
  delete mimemap;
180
  delete mimeconf; 
181
  delete mimeview; 
182
  delete stopsuffixes;
183
  // just in case
184
  zeroMe();
185
    }
186
};
180
};
187
181
188
182
189
#endif /* _RCLCONFIG_H_INCLUDED_ */
183
#endif /* _RCLCONFIG_H_INCLUDED_ */