#include "config_file.hpp" #include sc::config_file::config_file(const std::string& prog_name, bool has_dir) : _has_dir {has_dir}, _prog_name {prog_name} { std::string cfg_path; _root = getenv("HOME"); _root += "/.config/"; if (has_dir) { _root += prog_name + "/"; cfg_path = _root + "config"; // sensible default // TODO maybe also look for .conf or rc here. } else { cfg_path = _root + prog_name + "rc"; // standard "run control" file } _cfg = sc::parse_ini_file(cfg_path); } std::string sc::config_file::path_for_file_name(const std::string& file_name) { return _root + file_name; }