swm/include/config/config.h

20 lines
397 B
C
Raw Normal View History

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;
std::string path;
2021-12-08 01:17:10 +00:00
Config(const std::string& config_path) {
this->path = config_path;
2021-12-08 01:17:10 +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
}
};