|
a/src/query/dynconf.cpp |
|
b/src/query/dynconf.cpp |
|
... |
|
... |
41 |
// This avoids templating this routine for the actual entry type.
|
41 |
// This avoids templating this routine for the actual entry type.
|
42 |
bool RclDynConf::insertNew(const string &sk, DynConfEntry &n, DynConfEntry &s,
|
42 |
bool RclDynConf::insertNew(const string &sk, DynConfEntry &n, DynConfEntry &s,
|
43 |
int maxlen)
|
43 |
int maxlen)
|
44 |
{
|
44 |
{
|
45 |
// Is this doc already in list ? If it is we remove the old entry
|
45 |
// Is this doc already in list ? If it is we remove the old entry
|
46 |
list<string> names = m_data.getNames(sk);
|
46 |
vector<string> names = m_data.getNames(sk);
|
47 |
list<string>::const_iterator it;
|
47 |
vector<string>::const_iterator it;
|
48 |
bool changed = false;
|
48 |
bool changed = false;
|
49 |
for (it = names.begin(); it != names.end(); it++) {
|
49 |
for (it = names.begin(); it != names.end(); it++) {
|
50 |
string oval;
|
50 |
string oval;
|
51 |
if (!m_data.get(*it, oval, sk)) {
|
51 |
if (!m_data.get(*it, oval, sk)) {
|
52 |
LOGDEB(("No data for %s\n", (*it).c_str()));
|
52 |
LOGDEB(("No data for %s\n", (*it).c_str()));
|
|
... |
|
... |
59 |
m_data.erase(*it, sk);
|
59 |
m_data.erase(*it, sk);
|
60 |
changed = true;
|
60 |
changed = true;
|
61 |
}
|
61 |
}
|
62 |
}
|
62 |
}
|
63 |
|
63 |
|
64 |
// Maybe reget list
|
64 |
// Maybe reget things
|
65 |
if (changed)
|
65 |
if (changed)
|
66 |
names = m_data.getNames(sk);
|
66 |
names = m_data.getNames(sk);
|
67 |
|
67 |
|
68 |
// Need to prune ?
|
68 |
// Need to prune ?
|
69 |
if (maxlen > 0 && names.size() >= (unsigned int)maxlen) {
|
69 |
if (maxlen > 0 && names.size() >= (unsigned int)maxlen) {
|
|
... |
|
... |
93 |
return true;
|
93 |
return true;
|
94 |
}
|
94 |
}
|
95 |
|
95 |
|
96 |
bool RclDynConf::eraseAll(const string &sk)
|
96 |
bool RclDynConf::eraseAll(const string &sk)
|
97 |
{
|
97 |
{
|
98 |
list<string> names = m_data.getNames(sk);
|
98 |
vector<string> names = m_data.getNames(sk);
|
99 |
list<string>::const_iterator it;
|
99 |
vector<string>::const_iterator it;
|
100 |
for (it = names.begin(); it != names.end(); it++) {
|
100 |
for (it = names.begin(); it != names.end(); it++) {
|
101 |
m_data.erase(*it, sk);
|
101 |
m_data.erase(*it, sk);
|
102 |
}
|
102 |
}
|
103 |
return true;
|
103 |
return true;
|
104 |
}
|
104 |
}
|