| 77 | } |
| 78 | |
| 79 | const UTF8 *Settings::value(const UTF8 *settingName, const UTF8 *defaultValue) |
| 80 | { |
| 81 | String name; |
| 82 | buildGroupString(name, settingName); |
| 83 | |
| 84 | StringTableEntry nameEntry = StringTable->insert(name.c_str()); |
| 85 | name += "_default"; |
| 86 | StringTableEntry defaultNameEntry = StringTable->insert(name.c_str()); |
| 87 | |
| 88 | // we do this setModStaticFields call to make sure our get/set calls |
| 89 | // don't grab a regular field, don't want to stomp anything |
| 90 | setModStaticFields(false); |
| 91 | const UTF8 *value = getDataField(nameEntry, NULL); |
| 92 | const UTF8 *storedDefaultValue = getDataField(defaultNameEntry, NULL); |
| 93 | setModStaticFields(true); |
| 94 | |
| 95 | if(String::compare(value, "") != 0) |
| 96 | return value; |
| 97 | else if(String::compare(storedDefaultValue, "") != 0) |
| 98 | return storedDefaultValue; |
| 99 | else |
| 100 | return defaultValue; |
| 101 | } |
| 102 | |
| 103 | void Settings::remove(const UTF8 *settingName, bool includeDefaults) |
| 104 | { |
no test coverage detected