2022-06-18 00:46:47 +00:00
|
|
|
#include "values.hpp"
|
|
|
|
|
2023-04-22 18:40:17 +00:00
|
|
|
#include <stdexcept>
|
|
|
|
|
2022-06-18 00:46:47 +00:00
|
|
|
namespace Settings
|
|
|
|
{
|
|
|
|
Values* Values::sValues = nullptr;
|
|
|
|
|
2023-04-22 18:40:17 +00:00
|
|
|
void Values::initDefaults()
|
2022-06-18 00:46:47 +00:00
|
|
|
{
|
2023-04-22 18:40:17 +00:00
|
|
|
if (Values::sValues != nullptr)
|
|
|
|
throw std::logic_error("Default settings already initialized");
|
2022-06-18 00:46:47 +00:00
|
|
|
static Values values;
|
|
|
|
Values::sValues = &values;
|
|
|
|
}
|
2023-04-22 18:40:17 +00:00
|
|
|
|
|
|
|
void Values::init()
|
|
|
|
{
|
|
|
|
if (Values::sValues == nullptr)
|
|
|
|
throw std::logic_error("Default settings are not initialized");
|
|
|
|
static Values values(std::move(*Values::sValues));
|
|
|
|
Values::sValues = &values;
|
|
|
|
}
|
2022-06-18 00:46:47 +00:00
|
|
|
}
|