diff options
Diffstat (limited to 'src/android/app/src/main/jni/config.h')
-rw-r--r-- | src/android/app/src/main/jni/config.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/android/app/src/main/jni/config.h b/src/android/app/src/main/jni/config.h new file mode 100644 index 000000000..0d7d6e94d --- /dev/null +++ b/src/android/app/src/main/jni/config.h @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include <filesystem> +#include <memory> +#include <optional> +#include <string> + +#include "common/settings.h" + +class INIReader; + +class Config { + std::filesystem::path config_loc; + std::unique_ptr<INIReader> config; + + bool LoadINI(const std::string& default_contents = "", bool retry = true); + void ReadValues(); + +public: + explicit Config(std::optional<std::filesystem::path> config_path = std::nullopt); + ~Config(); + + void Reload(); + +private: + /** + * Applies a value read from the sdl2_config to a Setting. + * + * @param group The name of the INI group + * @param setting The yuzu setting to modify + */ + template <typename Type, bool ranged> + void ReadSetting(const std::string& group, Settings::Setting<Type, ranged>& setting); +}; |