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.38 2007-10-09 09:43:10 dockes Exp $  (C) 2004 J.F.Dockes */
19
/* @(#$Id: rclconfig.h,v 1.39 2007-11-16 14:28:52 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 <set>
24
#include <utility>
25
#include <utility>
25
#ifndef NO_NAMESPACES
26
#ifndef NO_NAMESPACES
26
using std::list;
27
using std::list;
27
using std::string;
28
using std::string;
28
using std::vector;
29
using std::vector;
29
using std::pair;
30
using std::pair;
31
using std::set;
30
#endif
32
#endif
31
33
32
#include "conftree.h"
34
#include "conftree.h"
33
#include "smallut.h"
35
#include "smallut.h"
34
36
...
...
58
60
59
    /** Return the directory where this configuration is stored */
61
    /** Return the directory where this configuration is stored */
60
    string getConfDir() {return m_confdir;}
62
    string getConfDir() {return m_confdir;}
61
63
62
    /** Set current directory reference, and fetch automatic parameters. */
64
    /** Set current directory reference, and fetch automatic parameters. */
63
    void setKeyDir(const string &dir) 
65
    void setKeyDir(const string &dir);
64
    {
65
  m_keydir = dir;
66
  if (m_conf == 0)
67
      return;
68
  if (!m_conf->get("defaultcharset", defcharset, m_keydir))
69
      defcharset.erase();
70
  string str;
71
  m_conf->get("guesscharset", str, m_keydir);
72
  guesscharset = stringToBool(str);
73
    }
74
    string getKeyDir() const {return m_keydir;}
66
    string getKeyDir() const {return m_keydir;}
75
67
76
    /** Get generic configuration parameter according to current keydir */
68
    /** Get generic configuration parameter according to current keydir */
77
    bool getConfParam(const string &name, string &value) 
69
    bool getConfParam(const string &name, string &value) 
78
    {
70
    {
...
...
134
    list<string> getAllMimeTypes();
126
    list<string> getAllMimeTypes();
135
    /** mimemap: Get appropriate suffix for mime type. This is inefficient */
127
    /** mimemap: Get appropriate suffix for mime type. This is inefficient */
136
    string getSuffixFromMimeType(const string &mt);
128
    string getSuffixFromMimeType(const string &mt);
137
129
138
    /** mimeconf: get input filter for mimetype */
130
    /** mimeconf: get input filter for mimetype */
139
    string getMimeHandlerDef(const string &mimetype);
131
    string getMimeHandlerDef(const string &mimetype, bool filtertypes=false);
140
132
141
    /** mimeconf: get icon name for mimetype */
133
    /** mimeconf: get icon name for mimetype */
142
    string getMimeIconName(const string &mtype, string *path = 0);
134
    string getMimeIconName(const string &mtype, string *path = 0);
143
135
144
    /** mimeconf: get list of file categories */
136
    /** mimeconf: get list of file categories */
...
...
196
    unsigned int m_maxsufflen;
188
    unsigned int m_maxsufflen;
197
189
198
    // Parameters auto-fetched on setkeydir
190
    // Parameters auto-fetched on setkeydir
199
    string defcharset;   // These are stored locally to avoid 
191
    string defcharset;   // These are stored locally to avoid 
200
    bool   guesscharset; // They are fetched initially or on setKeydir()
192
    bool   guesscharset; // They are fetched initially or on setKeydir()
193
    // Limiting set of mime types to be processed. Normally empty.
194
    string        m_rmtstr;
195
    set<string>   m_restrictMTypes; 
201
196
202
    /** Create initial user configuration */
197
    /** Create initial user configuration */
203
    bool initUserConfig();
198
    bool initUserConfig();
204
    /** Copy from other */
199
    /** Copy from other */
205
    void initFrom(const RclConfig& r);
200
    void initFrom(const RclConfig& r);