2021-12-08 01:17:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <toml.hpp>
|
|
|
|
#include <toml/parser.hpp>
|
|
|
|
#include <toml/value.hpp>
|
|
|
|
|
|
|
|
#include "programs_config.h"
|
|
|
|
|
|
|
|
class Config {
|
|
|
|
public:
|
|
|
|
ProgramsConfig programs;
|
2021-12-15 17:43:55 +00:00
|
|
|
std::string path;
|
2021-12-08 01:17:10 +00:00
|
|
|
|
|
|
|
Config(const std::string& config_path) {
|
2021-12-15 17:43:55 +00:00
|
|
|
this->path = config_path;
|
2021-12-08 01:17:10 +00:00
|
|
|
|
2021-12-15 17:43:55 +00:00
|
|
|
toml::value toml = toml::parse(path + "config.toml");
|
2021-12-08 02:31:51 +00:00
|
|
|
programs = ProgramsConfig(toml["Programs"]);
|
2021-12-08 01:17:10 +00:00
|
|
|
}
|
|
|
|
};
|