2016-06-14 22:30:35 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
namespace config
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
namespace system
|
|
|
|
|
{
|
|
|
|
|
|
2017-04-24 23:32:00 +01:00
|
|
|
int timeout_ms = 0;
|
2016-06-14 22:30:35 +01:00
|
|
|
|
|
|
|
|
} // namespace system
|
|
|
|
|
|
2017-04-24 23:32:00 +01:00
|
|
|
bool
|
2017-04-26 11:53:53 +01:00
|
|
|
loadFrontendToml(std::shared_ptr<cpptoml::table> config)
|
2016-07-26 21:57:48 +09:00
|
|
|
{
|
2017-04-24 23:32:00 +01:00
|
|
|
system::timeout_ms = config->get_qualified_as<int>("system.timeout_ms").value_or(system::timeout_ms);
|
2016-06-14 22:30:35 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-26 11:53:53 +01:00
|
|
|
bool
|
|
|
|
|
saveFrontendToml(std::shared_ptr<cpptoml::table> config)
|
|
|
|
|
{
|
|
|
|
|
auto system = config->get_table("system");
|
|
|
|
|
if (!system) {
|
|
|
|
|
system = cpptoml::make_table();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
system->insert("timeout_ms", system::timeout_ms);
|
|
|
|
|
config->insert("system", system);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-14 22:30:35 +01:00
|
|
|
} // namespace config
|