matf-rg-engine  1.0.0
Base for project for the Computer Graphics course at Faculty of Mathematics, University of Belgrade
Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
engine::util::Configuration Class Reference

Loads and stores the configuration file. More...

#include <Configuration.hpp>

Public Types

using json = nlohmann::json
 

Public Member Functions

void initialize ()
 Initialize the Configuration class. More...
 

Static Public Member Functions

static json & config ()
 Get the configuration file. More...
 
static Configuration * instance ()
 Get the instance of the Configuration class. More...
 

Static Private Member Functions

static std::filesystem::path get_config_path ()
 Get the path to the configuration file. More...
 
static json create_default ()
 Create the default configuration file. More...
 

Private Attributes

json m_config
 The configuration file. More...
 

Static Private Attributes

constexpr static std::string_view CONFIG_FILE_NAME = "config.json"
 The default name of the configuration file. More...
 

Friends

class App
 

Detailed Description

Loads and stores the configuration file.

The configuration file is loaded from the default path: CONFIG_FILE_NAME=config.json. The configuration file is stored in a static variable, so it is shared between all instances of the Configuration class.

Member Typedef Documentation

◆ json

using engine::util::Configuration::json = nlohmann::json

Member Function Documentation

◆ config()

Configuration::json & engine::util::Configuration::config ( )
static

Get the configuration file.

Returns
The configuration file.

◆ instance()

Configuration * engine::util::Configuration::instance ( )
static

Get the instance of the Configuration class.

Returns
The instance of the Configuration class.

◆ initialize()

void engine::util::Configuration::initialize ( )

Initialize the Configuration class.

◆ get_config_path()

std::filesystem::path engine::util::Configuration::get_config_path ( )
staticprivate

Get the path to the configuration file.

Returns
The path to the configuration file.

◆ create_default()

nlohmann::json engine::util::Configuration::create_default ( )
staticprivate

Create the default configuration file.

Returns
The default configuration file.

Friends And Related Function Documentation

◆ App

friend class App
friend

Member Data Documentation

◆ CONFIG_FILE_NAME

constexpr static std::string_view engine::util::Configuration::CONFIG_FILE_NAME = "config.json"
staticconstexprprivate

The default name of the configuration file.

◆ m_config

json engine::util::Configuration::m_config
private

The configuration file.


The documentation for this class was generated from the following files: