}
+const SettingsEntry &Settings::getEntryDefault(const std::string &name) const
+{
+ MutexAutoLock lock(m_mutex);
+
+ SettingEntries::const_iterator n;
+ if ((n = m_defaults.find(name)) == m_defaults.end()) {
+ throw SettingNotFoundException("Setting [" + name + "] not found.");
+ }
+ return n->second;
+}
+
+
Settings *Settings::getGroup(const std::string &name) const
{
const SettingsEntry &entry = getEntry(name);
}
+const std::string &Settings::getDefault(const std::string &name) const
+{
+ const SettingsEntry &entry = getEntryDefault(name);
+ if (entry.is_group)
+ throw SettingNotFoundException("Setting [" + name + "] is a group.");
+ return entry.value;
+}
+
+
bool Settings::getBool(const std::string &name) const
{
return is_yes(get(name));
}
+bool Settings::getEntryDefaultNoEx(const std::string &name, SettingsEntry &val) const
+{
+ try {
+ val = getEntryDefault(name);
+ return true;
+ } catch (SettingNotFoundException &e) {
+ return false;
+ }
+}
+
+
bool Settings::getGroupNoEx(const std::string &name, Settings *&val) const
{
try {
}
+bool Settings::getDefaultNoEx(const std::string &name, std::string &val) const
+{
+ try {
+ val = getDefault(name);
+ return true;
+ } catch (SettingNotFoundException &e) {
+ return false;
+ }
+}
+
+
bool Settings::getFlag(const std::string &name) const
{
try {