mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
COMMON: ConfMan needs getValOrDefault
This commit is contained in:
parent
2eb52fe900
commit
470505cc56
@ -458,7 +458,7 @@ const String &ConfigManager::get(const String &key) const {
|
|||||||
else if (_appDomain.contains(key))
|
else if (_appDomain.contains(key))
|
||||||
return _appDomain[key];
|
return _appDomain[key];
|
||||||
|
|
||||||
return _defaultsDomain.getVal(key);
|
return _defaultsDomain.getValOrDefault(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
const String &ConfigManager::get(const String &key, const String &domName) const {
|
const String &ConfigManager::get(const String &key, const String &domName) const {
|
||||||
@ -477,7 +477,7 @@ const String &ConfigManager::get(const String &key, const String &domName) const
|
|||||||
if (domain->contains(key))
|
if (domain->contains(key))
|
||||||
return (*domain)[key];
|
return (*domain)[key];
|
||||||
|
|
||||||
return _defaultsDomain.getVal(key);
|
return _defaultsDomain.getValOrDefault(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ConfigManager::getInt(const String &key, const String &domName) const {
|
int ConfigManager::getInt(const String &key, const String &domName) const {
|
||||||
|
@ -89,6 +89,7 @@ public:
|
|||||||
* @return True if the key exists, false otherwise.
|
* @return True if the key exists, false otherwise.
|
||||||
* You can use this method if you frequently attempt to access keys that do not exist.
|
* You can use this method if you frequently attempt to access keys that do not exist.
|
||||||
*/
|
*/
|
||||||
|
const String &getValOrDefault(const String &key) const { return _entries.getValOrDefault(key); }
|
||||||
bool tryGetVal(const String &key, String &out) const { return _entries.tryGetVal(key, out); }
|
bool tryGetVal(const String &key, String &out) const { return _entries.tryGetVal(key, out); }
|
||||||
|
|
||||||
void clear() { _entries.clear(); } /*!< Clear all configuration entries in the domain. */
|
void clear() { _entries.clear(); } /*!< Clear all configuration entries in the domain. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user