|
a/src/utils/conftree.h |
|
b/src/utils/conftree.h |
|
... |
|
... |
93 |
class ConfNull {
|
93 |
class ConfNull {
|
94 |
public:
|
94 |
public:
|
95 |
enum StatusCode {STATUS_ERROR=0, STATUS_RO=1, STATUS_RW=2};
|
95 |
enum StatusCode {STATUS_ERROR=0, STATUS_RO=1, STATUS_RW=2};
|
96 |
virtual ~ConfNull() {};
|
96 |
virtual ~ConfNull() {};
|
97 |
virtual int get(const string &name, string &value,
|
97 |
virtual int get(const string &name, string &value,
|
98 |
const string &sk = "") = 0;
|
98 |
const string &sk = string()) = 0;
|
99 |
virtual int set(const string &nm, const string &val,
|
99 |
virtual int set(const string &nm, const string &val,
|
100 |
const string &sk = "") = 0;
|
100 |
const string &sk = string()) = 0;
|
101 |
virtual bool ok() = 0;
|
101 |
virtual bool ok() = 0;
|
102 |
virtual list<string> getNames(const string &sk) = 0;
|
102 |
virtual list<string> getNames(const string &sk) = 0;
|
103 |
virtual int erase(const string &, const string &) = 0;
|
103 |
virtual int erase(const string &, const string &) = 0;
|
104 |
virtual int eraseKey(const string &) = 0;
|
104 |
virtual int eraseKey(const string &) = 0;
|
105 |
virtual void listall() {};
|
105 |
virtual void listall() {};
|
|
... |
|
... |
154 |
/**
|
154 |
/**
|
155 |
* Get value for named parameter, from specified subsection (looks in
|
155 |
* Get value for named parameter, from specified subsection (looks in
|
156 |
* global space if sk is empty).
|
156 |
* global space if sk is empty).
|
157 |
* @return 0 if name not found, 1 else
|
157 |
* @return 0 if name not found, 1 else
|
158 |
*/
|
158 |
*/
|
159 |
virtual int get(const string &name, string &value, const string &sk = "");
|
159 |
virtual int get(const string &name, string &value, const string &sk = string());
|
160 |
|
160 |
|
161 |
/**
|
161 |
/**
|
162 |
* Set value for named parameter in specified subsection (or global)
|
162 |
* Set value for named parameter in specified subsection (or global)
|
163 |
* @return 0 for error, 1 else
|
163 |
* @return 0 for error, 1 else
|
164 |
*/
|
164 |
*/
|
165 |
virtual int set(const string &nm, const string &val, const string &sk = "");
|
165 |
virtual int set(const string &nm, const string &val, const string &sk = string());
|
166 |
|
166 |
|
167 |
/**
|
167 |
/**
|
168 |
* Remove name and value from config
|
168 |
* Remove name and value from config
|
169 |
*/
|
169 |
*/
|
170 |
virtual int erase(const string &name, const string &sk);
|
170 |
virtual int erase(const string &name, const string &sk);
|
|
... |
|
... |
361 |
return true;
|
361 |
return true;
|
362 |
}
|
362 |
}
|
363 |
return false;
|
363 |
return false;
|
364 |
}
|
364 |
}
|
365 |
|
365 |
|
366 |
virtual int set(const string &nm, const string &val, const string &sk = "")
|
366 |
virtual int set(const string &nm, const string &val, const string &sk = string())
|
367 |
{
|
367 |
{
|
368 |
if (!m_ok)
|
368 |
if (!m_ok)
|
369 |
return 0;
|
369 |
return 0;
|
370 |
|
370 |
|
371 |
// Avoid adding unneeded entries: if the new value matches the
|
371 |
// Avoid adding unneeded entries: if the new value matches the
|