|
a/src/utils/conftree.h |
|
b/src/utils/conftree.h |
|
... |
|
... |
103 |
virtual list<string> getNames(const string &sk, const char* = 0) = 0;
|
103 |
virtual list<string> getNames(const string &sk, const char* = 0) = 0;
|
104 |
virtual int erase(const string &, const string &) = 0;
|
104 |
virtual int erase(const string &, const string &) = 0;
|
105 |
virtual int eraseKey(const string &) = 0;
|
105 |
virtual int eraseKey(const string &) = 0;
|
106 |
virtual void listall() {};
|
106 |
virtual void listall() {};
|
107 |
virtual list<string> getSubKeys() = 0;
|
107 |
virtual list<string> getSubKeys() = 0;
|
|
|
108 |
virtual list<string> getSubKeys(bool) = 0;
|
108 |
virtual bool holdWrites(bool) = 0;
|
109 |
virtual bool holdWrites(bool) = 0;
|
109 |
};
|
110 |
};
|
110 |
|
111 |
|
111 |
/**
|
112 |
/**
|
112 |
* Manages a simple configuration file with subsections.
|
113 |
* Manages a simple configuration file with subsections.
|
|
... |
|
... |
203 |
virtual bool hasNameAnywhere(const string& nm);
|
204 |
virtual bool hasNameAnywhere(const string& nm);
|
204 |
|
205 |
|
205 |
/**
|
206 |
/**
|
206 |
* Return all subkeys
|
207 |
* Return all subkeys
|
207 |
*/
|
208 |
*/
|
|
|
209 |
virtual list<string> getSubKeys(bool) {return getSubKeys();}
|
208 |
virtual list<string> getSubKeys();
|
210 |
virtual list<string> getSubKeys();
|
209 |
|
211 |
|
210 |
virtual string getFilename() {return m_filename;}
|
212 |
virtual string getFilename() {return m_filename;}
|
211 |
|
213 |
|
212 |
/**
|
214 |
/**
|
|
... |
|
... |
433 |
nms.sort();
|
435 |
nms.sort();
|
434 |
nms.unique();
|
436 |
nms.unique();
|
435 |
return nms;
|
437 |
return nms;
|
436 |
}
|
438 |
}
|
437 |
|
439 |
|
|
|
440 |
virtual list<string> getSubKeys(){return getSubKeys(false);}
|
438 |
virtual list<string> getSubKeys()
|
441 |
virtual list<string> getSubKeys(bool shallow)
|
439 |
{
|
442 |
{
|
440 |
list<string> sks;
|
443 |
list<string> sks;
|
441 |
typename list<T*>::iterator it;
|
444 |
typename list<T*>::iterator it;
|
442 |
for (it = m_confs.begin();it != m_confs.end(); it++) {
|
445 |
for (it = m_confs.begin();it != m_confs.end(); it++) {
|
443 |
list<string> lst;
|
446 |
list<string> lst;
|
444 |
lst = (*it)->getSubKeys();
|
447 |
lst = (*it)->getSubKeys();
|
445 |
sks.insert(sks.end(), lst.begin(), lst.end());
|
448 |
sks.insert(sks.end(), lst.begin(), lst.end());
|
|
|
449 |
if (shallow)
|
|
|
450 |
break;
|
446 |
}
|
451 |
}
|
447 |
sks.sort();
|
452 |
sks.sort();
|
448 |
sks.unique();
|
453 |
sks.unique();
|
449 |
return sks;
|
454 |
return sks;
|
450 |
}
|
455 |
}
|