|
a/src/common/rclconfig.h |
|
b/src/common/rclconfig.h |
1 |
#ifndef _RCLCONFIG_H_INCLUDED_
|
1 |
#ifndef _RCLCONFIG_H_INCLUDED_
|
2 |
#define _RCLCONFIG_H_INCLUDED_
|
2 |
#define _RCLCONFIG_H_INCLUDED_
|
3 |
/* @(#$Id: rclconfig.h,v 1.5 2005-10-17 13:36:53 dockes Exp $ (C) 2004 J.F.Dockes */
|
3 |
/* @(#$Id: rclconfig.h,v 1.6 2005-11-05 14:40:50 dockes Exp $ (C) 2004 J.F.Dockes */
|
4 |
|
4 |
|
5 |
#include <list>
|
5 |
#include <list>
|
6 |
|
6 |
|
7 |
#include "conftree.h"
|
7 |
#include "conftree.h"
|
8 |
|
8 |
|
9 |
class RclConfig {
|
9 |
class RclConfig {
|
10 |
int m_ok;
|
10 |
int m_ok;
|
|
|
11 |
string reason; // Explanation for bad state
|
11 |
string confdir; // Directory where the files are stored
|
12 |
string confdir; // Directory where the files are stored
|
12 |
ConfTree *conf; // Parsed main configuration
|
13 |
ConfTree *conf; // Parsed main configuration
|
13 |
string keydir; // Current directory used for parameter fetches.
|
14 |
string keydir; // Current directory used for parameter fetches.
|
14 |
|
15 |
|
15 |
ConfTree *mimemap; // These are independant of current keydir. We might
|
16 |
ConfTree *mimemap; // These are independant of current keydir. We might
|
|
... |
|
... |
24 |
|
25 |
|
25 |
RclConfig();
|
26 |
RclConfig();
|
26 |
~RclConfig() {delete conf;delete mimemap;delete mimeconf;}
|
27 |
~RclConfig() {delete conf;delete mimemap;delete mimeconf;}
|
27 |
|
28 |
|
28 |
bool ok() {return m_ok;}
|
29 |
bool ok() {return m_ok;}
|
29 |
|
30 |
const string &getReason() {return reason;}
|
30 |
string getConfDir() {return confdir;}
|
31 |
string getConfDir() {return confdir;}
|
31 |
ConfTree *getConfig() {return m_ok ? conf : 0;}
|
32 |
ConfTree *getConfig() {return m_ok ? conf : 0;}
|
32 |
|
33 |
|
33 |
/// Get generic configuration parameter according to current keydir
|
34 |
/// Get generic configuration parameter according to current keydir
|
34 |
bool getConfParam(const string &name, string &value)
|
35 |
bool getConfParam(const string &name, string &value)
|