11 if (std::filesystem::exists(json_filename))
13 spdlog::critical(
"Cannot dump the default value to the configuration file {:?} as it's already existed!",
17 const auto parent_dir = std::filesystem::absolute(std::filesystem::path{ json_filename }).parent_path();
18 std::filesystem::create_directories(parent_dir);
19 auto error_code = glz::write_file_json<glz::opts{ .prettify =
true, .new_lines_in_arrays =
false }>(
20 app_config, json_filename, std::string{});
25 if (json_filename.empty())
29 if (not std::filesystem::exists(json_filename))
31 spdlog::warn(
"configuration file {:?} doesn't exist. Creating a new file with default values",
37 auto error_code = glz::read_file_json(app_config, json_filename, std::string{});