|
MetaImGUI 1.0.0
ImGui Application Template for C++20
|
Configuration manager for persistent application settings. More...
#include <ConfigManager.h>
Classes | |
| struct | Impl |
Public Member Functions | |
| ConfigManager () | |
| ~ConfigManager () | |
| ConfigManager (const ConfigManager &)=delete | |
| ConfigManager & | operator= (const ConfigManager &)=delete |
| ConfigManager (ConfigManager &&)=default | |
| ConfigManager & | operator= (ConfigManager &&)=default |
| bool | Load () |
| Load configuration from disk. | |
| bool | Save () |
| Save configuration to disk. | |
| void | Reset () |
| Reset configuration to defaults. | |
| bool | ConfigFileExists () const |
| Check if configuration file exists. | |
| std::filesystem::path | GetConfigPath () const |
| Get configuration file path. | |
| void | SetWindowPosition (int x, int y) |
| void | SetWindowSize (int width, int height) |
| std::optional< std::pair< int, int > > | GetWindowPosition () const |
| std::optional< std::pair< int, int > > | GetWindowSize () const |
| void | SetWindowMaximized (bool maximized) |
| bool | GetWindowMaximized () const |
| void | SetTheme (const std::string &theme) |
| std::string | GetTheme () const |
| void | AddRecentFile (const std::string &filepath) |
| std::vector< std::string > | GetRecentFiles () const |
| void | ClearRecentFiles () |
| void | SetMaxRecentFiles (size_t max) |
| void | SetString (const std::string &key, const std::string &value) |
| std::optional< std::string > | GetString (const std::string &key) const |
| void | SetInt (const std::string &key, int value) |
| std::optional< int > | GetInt (const std::string &key) const |
| void | SetBool (const std::string &key, bool value) |
| std::optional< bool > | GetBool (const std::string &key) const |
| void | SetFloat (const std::string &key, float value) |
| std::optional< float > | GetFloat (const std::string &key) const |
| bool | HasKey (const std::string &key) const |
| void | RemoveKey (const std::string &key) |
| std::vector< std::string > | GetAllKeys () const |
Configuration manager for persistent application settings.
ConfigManager handles loading, saving, and accessing application configuration using JSON format. Settings are stored in the user's config directory.
Supported platforms:
Definition at line 41 of file ConfigManager.h.
| MetaImGUI::ConfigManager::ConfigManager | ( | ) |
Definition at line 76 of file ConfigManager.cpp.
References GetConfigPath().
|
default |
|
delete |
|
default |
| void MetaImGUI::ConfigManager::AddRecentFile | ( | const std::string & | filepath | ) |
Definition at line 236 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::ClearRecentFiles | ( | ) |
Definition at line 276 of file ConfigManager.cpp.
| bool MetaImGUI::ConfigManager::ConfigFileExists | ( | ) | const |
Check if configuration file exists.
Definition at line 148 of file ConfigManager.cpp.
| std::vector< std::string > MetaImGUI::ConfigManager::GetAllKeys | ( | ) | const |
Definition at line 380 of file ConfigManager.cpp.
References LOG_WARNING.
| std::optional< bool > MetaImGUI::ConfigManager::GetBool | ( | const std::string & | key | ) | const |
Definition at line 336 of file ConfigManager.cpp.
References LOG_WARNING.
| std::filesystem::path MetaImGUI::ConfigManager::GetConfigPath | ( | ) | const |
Get configuration file path.
Definition at line 153 of file ConfigManager.cpp.
Referenced by ConfigManager().
| std::optional< float > MetaImGUI::ConfigManager::GetFloat | ( | const std::string & | key | ) | const |
Definition at line 356 of file ConfigManager.cpp.
References LOG_WARNING.
| std::optional< int > MetaImGUI::ConfigManager::GetInt | ( | const std::string & | key | ) | const |
Definition at line 316 of file ConfigManager.cpp.
References LOG_WARNING.
| std::vector< std::string > MetaImGUI::ConfigManager::GetRecentFiles | ( | ) | const |
Definition at line 261 of file ConfigManager.cpp.
References LOG_WARNING.
| std::optional< std::string > MetaImGUI::ConfigManager::GetString | ( | const std::string & | key | ) | const |
Definition at line 296 of file ConfigManager.cpp.
References LOG_WARNING.
| std::string MetaImGUI::ConfigManager::GetTheme | ( | ) | const |
Definition at line 222 of file ConfigManager.cpp.
References LOG_WARNING.
| bool MetaImGUI::ConfigManager::GetWindowMaximized | ( | ) | const |
Definition at line 203 of file ConfigManager.cpp.
References LOG_WARNING.
| std::optional< std::pair< int, int > > MetaImGUI::ConfigManager::GetWindowPosition | ( | ) | const |
Definition at line 171 of file ConfigManager.cpp.
References LOG_WARNING.
| std::optional< std::pair< int, int > > MetaImGUI::ConfigManager::GetWindowSize | ( | ) | const |
Definition at line 184 of file ConfigManager.cpp.
References LOG_WARNING.
| bool MetaImGUI::ConfigManager::HasKey | ( | const std::string & | key | ) | const |
Definition at line 368 of file ConfigManager.cpp.
| bool MetaImGUI::ConfigManager::Load | ( | ) |
Load configuration from disk.
Definition at line 85 of file ConfigManager.cpp.
|
default |
|
delete |
| void MetaImGUI::ConfigManager::RemoveKey | ( | const std::string & | key | ) |
Definition at line 373 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::Reset | ( | ) |
Reset configuration to defaults.
Definition at line 143 of file ConfigManager.cpp.
| bool MetaImGUI::ConfigManager::Save | ( | ) |
Save configuration to disk.
Definition at line 112 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::SetBool | ( | const std::string & | key, |
| bool | value | ||
| ) |
Definition at line 328 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::SetFloat | ( | const std::string & | key, |
| float | value | ||
| ) |
Definition at line 348 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::SetInt | ( | const std::string & | key, |
| int | value | ||
| ) |
Definition at line 308 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::SetMaxRecentFiles | ( | size_t | max | ) |
Definition at line 281 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::SetString | ( | const std::string & | key, |
| const std::string & | value | ||
| ) |
Definition at line 288 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::SetTheme | ( | const std::string & | theme | ) |
Definition at line 217 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::SetWindowMaximized | ( | bool | maximized | ) |
Definition at line 198 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::SetWindowPosition | ( | int | x, |
| int | y | ||
| ) |
Definition at line 159 of file ConfigManager.cpp.
| void MetaImGUI::ConfigManager::SetWindowSize | ( | int | width, |
| int | height | ||
| ) |
Definition at line 165 of file ConfigManager.cpp.