#pragma once #include #include #include inline void init_conf(const std::string &path) { const std::string cfgpath = [&]() { auto p = path; if(p.front() == '~') p.replace(0, 1, QStandardPaths::writableLocation(QStandardPaths::HomeLocation).toStdString()); return p; }(); auto value_map = std::make_unique>>({ @__DEFAULT_CFG__ }); std::fstream fs; fs.open(path, std::fstream::in); if(fs.is_open()) { value_map->read(fs); fs.close(); } Configuration::move_global(std::move(value_map)); }