Slight rework so that config can have a base dir but the program can start in another one.

This commit is contained in:
Zed A. Shaw 2025-04-23 12:08:36 -04:00
parent d1c2352237
commit 3d4ddde96e
8 changed files with 32 additions and 13 deletions

View file

@ -2,8 +2,10 @@
#include <nlohmann/json.hpp>
#include <fstream>
#include <codecvt>
#include <filesystem>
struct Config {
static std::filesystem::path BASE_DIR;
nlohmann::json $config;
std::string $src_path;
@ -16,4 +18,7 @@ struct Config {
nlohmann::json &json() { return $config; };
std::wstring wstring(const std::string main_key, const std::string sub_key);
std::vector<std::string> keys();
static void set_base_dir(const char *optarg);
static std::filesystem::path path_to(const std::string& path);
};