mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Config: Implement Get and Set
This commit is contained in:
@ -38,22 +38,6 @@ void InvokeConfigChangedCallbacks();
|
||||
void Load();
|
||||
void Save();
|
||||
|
||||
// Often used functions for getting or setting configuration on the base layer for the main system
|
||||
template <typename T>
|
||||
T Get(const std::string& section_name, const std::string& key, const T& default_value)
|
||||
{
|
||||
auto base_layer = GetLayer(Config::LayerType::Base);
|
||||
return base_layer->GetOrCreateSection(Config::System::Main, section_name)
|
||||
->Get(key, default_value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void Set(const std::string& section_name, const std::string& key, const T& value)
|
||||
{
|
||||
auto base_layer = GetLayer(Config::LayerType::Base);
|
||||
base_layer->GetOrCreateSection(Config::System::Main, section_name)->Set(key, value);
|
||||
}
|
||||
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
|
Reference in New Issue
Block a user