add getConfParam->std::set
This commit is contained in:
parent
90bae886c2
commit
148e7eec0d
@ -395,7 +395,7 @@ bool RclConfig::getConfParam(const string &name, bool *bvp, bool shallow) const
|
||||
}
|
||||
|
||||
bool RclConfig::getConfParam(const string &name, vector<string> *svvp,
|
||||
bool shallow) const
|
||||
bool shallow) const
|
||||
{
|
||||
if (!svvp)
|
||||
return false;
|
||||
@ -406,8 +406,20 @@ bool RclConfig::getConfParam(const string &name, vector<string> *svvp,
|
||||
return stringToStrings(s, *svvp);
|
||||
}
|
||||
|
||||
bool RclConfig::getConfParam(const string &name, unordered_set<string> *out,
|
||||
bool shallow) const
|
||||
{
|
||||
vector<string> v;
|
||||
if (!out || !getConfParam(name, &v, shallow)) {
|
||||
return false;
|
||||
}
|
||||
out->clear();
|
||||
out->insert(v.begin(), v.end());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RclConfig::getConfParam(const string &name, vector<int> *vip,
|
||||
bool shallow) const
|
||||
bool shallow) const
|
||||
{
|
||||
if (!vip)
|
||||
return false;
|
||||
@ -420,7 +432,8 @@ bool RclConfig::getConfParam(const string &name, vector<int> *vip,
|
||||
char *ep;
|
||||
vip->push_back(strtol(vs[i].c_str(), &ep, 0));
|
||||
if (ep == vs[i].c_str()) {
|
||||
LOGDEB("RclConfig::getConfParam: bad int value in [" << (name) << "]\n" );
|
||||
LOGDEB("RclConfig::getConfParam: bad int value in [" << name <<
|
||||
"]\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,6 +140,10 @@ class RclConfig {
|
||||
* (stringToStrings). Can fail if the string is malformed. */
|
||||
bool getConfParam(const string &name, vector<string> *value,
|
||||
bool shallow=false) const;
|
||||
/** Variant with conversion to unordered_set<string>
|
||||
* (stringToStrings). Can fail if the string is malformed. */
|
||||
bool getConfParam(const string &name, std::unordered_set<std::string> *v,
|
||||
bool shallow=false) const;
|
||||
/** Variant with conversion to vector<int> */
|
||||
bool getConfParam(const string &name, vector<int> *value,
|
||||
bool shallow=false) const;
|
||||
@ -189,8 +193,7 @@ class RclConfig {
|
||||
string getIdxStatusFile() const;
|
||||
/** Do path translation according to the ptrans table */
|
||||
void urlrewrite(const string& dbdir, string& url) const;
|
||||
ConfSimple *getPTrans()
|
||||
{
|
||||
ConfSimple *getPTrans() {
|
||||
return m_ptrans;
|
||||
}
|
||||
/** Get Web Queue directory name */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user