Fully converted to using the lel-guecs library externally now.
This commit is contained in:
parent
7c90eb6da1
commit
74a8599977
30 changed files with 139 additions and 1194 deletions
12
config.cpp
12
config.cpp
|
@ -5,8 +5,10 @@
|
|||
using nlohmann::json;
|
||||
using fmt::format;
|
||||
|
||||
std::filesystem::path Config::BASE_DIR{"."};
|
||||
|
||||
Config::Config(const std::string src_path) : $src_path(src_path) {
|
||||
std::ifstream infile($src_path);
|
||||
std::ifstream infile(Config::path_to($src_path));
|
||||
$config = json::parse(infile);
|
||||
}
|
||||
|
||||
|
@ -33,3 +35,11 @@ std::vector<std::string> Config::keys() {
|
|||
|
||||
return the_fucking_keys;
|
||||
}
|
||||
|
||||
void Config::set_base_dir(const char *optarg) {
|
||||
Config::BASE_DIR.assign(optarg);
|
||||
}
|
||||
|
||||
std::filesystem::path Config::path_to(const std::string& path) {
|
||||
return Config::BASE_DIR / path;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue