#include "config.hpp" #include using namespace nlohmann; Config::Config(const string json_file) { load(json_file); } void Config::load(const string file_name) { std::ifstream infile(file_name); json_config = json::parse(infile); listen_at = json_config["listen_at"].template get(); fail_max = json_config["fail_max"].template get(); json send_list = json_config["send_to"]; for(auto &el : send_list.items()) { json spec = el.value(); SendTo send_spec{ .url = spec["url"].template get(), .bitrate = spec["bitrate"].template get() }; send_to[el.key()] = send_spec; } }