matf-rg-engine 1.0.0
Base for project for the Computer Graphics course at Faculty of Mathematics, University of Belgrade
Loading...
Searching...
No Matches
Configuration.hpp
Go to the documentation of this file.
1
6#ifndef CONFIGURATION_HPP
7#define CONFIGURATION_HPP
8#include <json.hpp>
9namespace engine::util {
18 friend class App;
19
20 public:
21 using json = nlohmann::json;
22
27 static json &config();
28
33 static Configuration *instance();
34
38 void initialize();
39
40 private:
45 static std::filesystem::path get_config_path();
46
51 static json create_default();
52
56 constexpr static std::string_view CONFIG_FILE_NAME = "config.json";
57
62 };
63}
64#endif //CONFIGURATION_HPP
Loads and stores the configuration file.
Definition Configuration.hpp:17
friend class App
Definition Configuration.hpp:18
json m_config
The configuration file.
Definition Configuration.hpp:61
static json & config()
Get the configuration file.
Definition Utils.cpp:74
void initialize()
Initialize the Configuration class.
Definition Utils.cpp:26
static json create_default()
Create the default configuration file.
Definition Utils.cpp:61
static Configuration * instance()
Get the instance of the Configuration class.
Definition Utils.cpp:69
static std::filesystem::path get_config_path()
Get the path to the configuration file.
Definition Utils.cpp:46
static constexpr std::string_view CONFIG_FILE_NAME
The default name of the configuration file.
Definition Configuration.hpp:56
nlohmann::json json
Definition Configuration.hpp:21
Definition App.hpp:9