double SimpleConfig::getFloat(const std::string §ion, const std::string &key, double default_, bool set) { ConfigValue *v = _find(section, key); if (v) { return atof(v->getValue().c_str()); } else if (set) { setFloat(section, key, default_); } return default_; }
std::string SimpleConfig::getString(const std::string §ion, const std::string &key, std::string default_, bool set) { ConfigValue *v = _find(section, key); if (v) { return v->getValue(); } else if (set) { setString(section, key, default_); } return default_; }
std::string SimpleConfig::getPath(const std::string §ion, const std::string &key, std::string default_, bool set) { ConfigValue *v = _find(section, key); std::string native = ospath::filter(default_); if (v) { return ospath::filter(v->getValue()); } else if (set) { setString(section, key, native); } return native; }
bool SimpleConfig::getBool(const std::string §ion, const std::string &key, bool default_, bool set) { ConfigValue *v = _find(section, key); if (v) { std::string const &value = v->getValue(); if (value == "true" || atoi(value.c_str())) { return true; } else { return false; } } else if (set) { setBool(section, key, default_); } return default_; }