Switch to unified view

a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp
...
...
378
378
379
    if (!m_conf->get("defaultcharset", m_defcharset, m_keydir))
379
    if (!m_conf->get("defaultcharset", m_defcharset, m_keydir))
380
    m_defcharset.erase();
380
    m_defcharset.erase();
381
}
381
}
382
382
383
bool RclConfig::getConfParam(const string &name, int *ivp) const
383
bool RclConfig::getConfParam(const string &name, int *ivp, bool shallow) const
384
{
384
{
385
    string value;
385
    string value;
386
    if (!getConfParam(name, value))
386
    if (!getConfParam(name, value, shallow))
387
    return false;
387
    return false;
388
    errno = 0;
388
    errno = 0;
389
    long lval = strtol(value.c_str(), 0, 0);
389
    long lval = strtol(value.c_str(), 0, 0);
390
    if (lval == 0 && errno)
390
    if (lval == 0 && errno)
391
    return 0;
391
    return 0;
392
    if (ivp)
392
    if (ivp)
393
    *ivp = int(lval);
393
    *ivp = int(lval);
394
    return true;
394
    return true;
395
}
395
}
396
396
397
bool RclConfig::getConfParam(const string &name, bool *bvp) const
397
bool RclConfig::getConfParam(const string &name, bool *bvp, bool shallow) const
398
{
398
{
399
    if (!bvp) 
399
    if (!bvp) 
400
    return false;
400
    return false;
401
401
402
    *bvp = false;
402
    *bvp = false;
403
    string s;
403
    string s;
404
    if (!getConfParam(name, s))
404
    if (!getConfParam(name, s, shallow))
405
    return false;
405
    return false;
406
    *bvp = stringToBool(s);
406
    *bvp = stringToBool(s);
407
    return true;
407
    return true;
408
}
408
}
409
409
410
bool RclConfig::getConfParam(const string &name, vector<string> *svvp) const
410
bool RclConfig::getConfParam(const string &name, vector<string> *svvp,
411
    bool shallow) const
411
{
412
{
412
    if (!svvp) 
413
    if (!svvp) 
413
    return false;
414
    return false;
414
    svvp->clear();
415
    svvp->clear();
415
    string s;
416
    string s;
416
    if (!getConfParam(name, s))
417
    if (!getConfParam(name, s, shallow))
417
    return false;
418
    return false;
418
    return stringToStrings(s, *svvp);
419
    return stringToStrings(s, *svvp);
419
}
420
}
420
421
421
bool RclConfig::getConfParam(const string &name, vector<int> *vip) const
422
bool RclConfig::getConfParam(const string &name, vector<int> *vip,
423
    bool shallow) const
422
{
424
{
423
    if (!vip) 
425
    if (!vip) 
424
    return false;
426
    return false;
425
    vip->clear();
427
    vip->clear();
426
    vector<string> vs;
428
    vector<string> vs;
427
    if (!getConfParam(name, &vs))
429
    if (!getConfParam(name, &vs, shallow))
428
    return false;
430
    return false;
429
    vip->reserve(vs.size());
431
    vip->reserve(vs.size());
430
    for (unsigned int i = 0; i < vs.size(); i++) {
432
    for (unsigned int i = 0; i < vs.size(); i++) {
431
    char *ep;
433
    char *ep;
432
    vip->push_back(strtol(vs[i].c_str(), &ep, 0));
434
    vip->push_back(strtol(vs[i].c_str(), &ep, 0));