|
a/src/common/rclconfig.cpp |
|
b/src/common/rclconfig.cpp |
|
... |
|
... |
341 |
string s;
|
341 |
string s;
|
342 |
if (!getConfParam(name, s))
|
342 |
if (!getConfParam(name, s))
|
343 |
return false;
|
343 |
return false;
|
344 |
return stringToStrings(s, *svvp);
|
344 |
return stringToStrings(s, *svvp);
|
345 |
}
|
345 |
}
|
|
|
346 |
|
346 |
bool RclConfig::getConfParam(const string &name, list<string> *svvp) const
|
347 |
bool RclConfig::getConfParam(const string &name, vector<int> *vip) const
|
347 |
{
|
348 |
{
|
348 |
if (!svvp)
|
349 |
if (!vip)
|
349 |
return false;
|
350 |
return false;
|
350 |
svvp->clear();
|
351 |
vip->clear();
|
351 |
string s;
|
352 |
vector<string> vs;
|
352 |
if (!getConfParam(name, s))
|
353 |
if (!getConfParam(name, &vs))
|
|
|
354 |
return false;
|
|
|
355 |
vip->reserve(vs.size());
|
|
|
356 |
for (unsigned int i = 0; i < vs.size(); i++) {
|
|
|
357 |
char *ep;
|
|
|
358 |
vip->push_back(strtol(vs[i].c_str(), &ep, 0));
|
|
|
359 |
if (ep == vs[i].c_str()) {
|
|
|
360 |
LOGDEB(("RclConfig::getConfParam: bad int value in [%s]\n",
|
|
|
361 |
name.c_str()));
|
353 |
return false;
|
362 |
return false;
|
354 |
return stringToStrings(s, *svvp);
|
|
|
355 |
}
|
363 |
}
|
|
|
364 |
}
|
|
|
365 |
return true;
|
|
|
366 |
}
|
356 |
|
367 |
|
|
|
368 |
pair<int,int> RclConfig::getThrConf(ThrStage who) const
|
|
|
369 |
{
|
|
|
370 |
vector<int> vq;
|
|
|
371 |
vector<int> vt;
|
|
|
372 |
if (!getConfParam("thrQSizes", &vq) || !getConfParam("thrTCounts", &vt)) {
|
|
|
373 |
return pair<int,int>(-1,-1);
|
|
|
374 |
}
|
|
|
375 |
return pair<int,int>(vq[who], vt[who]);
|
|
|
376 |
}
|
|
|
377 |
|
357 |
list<string> RclConfig::getTopdirs() const
|
378 |
vector<string> RclConfig::getTopdirs() const
|
358 |
{
|
379 |
{
|
359 |
list<string> tdl;
|
380 |
vector<string> tdl;
|
360 |
if (!getConfParam("topdirs", &tdl)) {
|
381 |
if (!getConfParam("topdirs", &tdl)) {
|
361 |
LOGERR(("RclConfig::getTopdirs: no top directories in config or bad list format\n"));
|
382 |
LOGERR(("RclConfig::getTopdirs: no top directories in config or "
|
|
|
383 |
"bad list format\n"));
|
362 |
return tdl;
|
384 |
return tdl;
|
363 |
}
|
385 |
}
|
364 |
|
386 |
|
365 |
for (list<string>::iterator it = tdl.begin(); it != tdl.end(); it++) {
|
387 |
for (vector<string>::iterator it = tdl.begin(); it != tdl.end(); it++) {
|
366 |
*it = path_tildexpand(*it);
|
388 |
*it = path_tildexpand(*it);
|
367 |
*it = path_canon(*it);
|
389 |
*it = path_canon(*it);
|
368 |
}
|
390 |
}
|
369 |
return tdl;
|
391 |
return tdl;
|
370 |
}
|
392 |
}
|