bool
OptionsCont::set(const std::string &name, const std::string &value) throw(InvalidArgument) {
    Option *o = getSecure(name);
    if (!o->isWriteable()) {
        reportDoubleSetting(name);
        return false;
    }
    try {
        if (!o->set(value)) {
            return false;
        }
    } catch (InvalidArgument &e) {
        MsgHandler::getErrorInstance()->inform("While processing option '" + name + "':\n " + e.what());
        return false;
    }
    return true;
}
Esempio n. 2
0
bool
OptionsCont::set(const std::string& name, const std::string& value) {
    Option* o = getSecure(name);
    if (!o->isWriteable()) {
        reportDoubleSetting(name);
        return false;
    }
    try {
        if (!o->set(value)) {
            return false;
        }
    } catch (ProcessError& e) {
        WRITE_ERROR("While processing option '" + name + "':\n " + e.what());
        return false;
    }
    return true;
}
bool
OptionsCont::set(const std::string &name, bool value) throw(InvalidArgument) {
    Option *o = getSecure(name);
    if (!o->isBool()) {
        throw InvalidArgument("The option '" + name + "' is not a boolean attribute and requires an argument.");
    }
    if (!o->isWriteable()) {
        reportDoubleSetting(name);
        return false;
    }
    try {
        if (!o->set(value)) {
            return false;
        }
    } catch (InvalidArgument &e) {
        MsgHandler::getErrorInstance()->inform("While processing option '" + name + "':\n " + e.what());
        return false;
    }
    return true;
}
bool
OptionsCont::isWriteable(const std::string &name) throw(InvalidArgument) {
    Option *o = getSecure(name);
    return o->isWriteable();
}
Esempio n. 5
0
bool
OptionsCont::isWriteable(const std::string& name) {
    Option* o = getSecure(name);
    return o->isWriteable();
}