2020-12-28 16:15:37 +01:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-05-08 09:49:31 +02:00
|
|
|
#include <filesystem>
|
2020-12-28 16:15:37 +01:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
|
2021-07-03 11:00:06 +02:00
|
|
|
#include "common/settings.h"
|
|
|
|
|
2020-12-28 16:15:37 +01:00
|
|
|
class INIReader;
|
|
|
|
|
|
|
|
class Config {
|
|
|
|
std::unique_ptr<INIReader> sdl2_config;
|
2021-05-08 09:49:31 +02:00
|
|
|
std::filesystem::path sdl2_config_loc;
|
2020-12-28 16:15:37 +01:00
|
|
|
|
|
|
|
bool LoadINI(const std::string& default_contents = "", bool retry = true);
|
|
|
|
void ReadValues();
|
|
|
|
|
|
|
|
public:
|
|
|
|
Config();
|
|
|
|
~Config();
|
|
|
|
|
|
|
|
void Reload();
|
2021-07-03 11:00:06 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Applies a value read from the sdl2_config to a BasicSetting.
|
|
|
|
*
|
|
|
|
* @param group The name of the INI group
|
|
|
|
* @param setting The yuzu setting to modify
|
|
|
|
*/
|
|
|
|
template <typename Type>
|
|
|
|
void ReadSetting(const std::string& group, Settings::BasicSetting<Type>& setting);
|
2020-12-28 16:15:37 +01:00
|
|
|
};
|