Sunshine/sunshine/config.cpp

705 lines
17 KiB
C++
Raw Normal View History

2021-05-26 17:34:25 +02:00
#include <algorithm>
2019-12-03 23:19:00 +01:00
#include <fstream>
#include <functional>
2021-05-17 21:21:57 +02:00
#include <iostream>
2019-12-03 23:19:00 +01:00
#include <boost/asio.hpp>
#include "config.h"
2021-05-17 21:21:57 +02:00
#include "utility.h"
#define CA_DIR "credentials"
#define PRIVATE_KEY_FILE CA_DIR "/cakey.pem"
#define CERTIFICATE_FILE CA_DIR "/cacert.pem"
#define APPS_JSON_PATH SUNSHINE_ASSETS_DIR "/" APPS_JSON
namespace config {
using namespace std::literals;
2020-04-14 00:15:24 +03:00
namespace nv {
enum preset_e : int {
_default = 0,
slow,
medium,
fast,
hp,
hq,
bd,
ll_default,
llhq,
llhp,
lossless_default, // lossless presets must be the last ones
lossless_hp,
};
enum rc_e : int {
2021-05-17 21:21:57 +02:00
constqp = 0x0, /**< Constant QP mode */
vbr = 0x1, /**< Variable bitrate mode */
cbr = 0x2, /**< Constant bitrate mode */
cbr_ld_hq = 0x8, /**< low-delay CBR, high quality */
cbr_hq = 0x10, /**< CBR, high quality (slower) */
vbr_hq = 0x20 /**< VBR, high quality (slower) */
2020-04-14 00:15:24 +03:00
};
enum coder_e : int {
_auto = 0,
cabac,
cavlc
};
std::optional<preset_e> preset_from_view(const std::string_view &preset) {
2021-05-17 21:21:57 +02:00
#define _CONVERT_(x) \
if(preset == #x##sv) return x
2020-04-14 00:15:24 +03:00
_CONVERT_(slow);
_CONVERT_(medium);
_CONVERT_(fast);
_CONVERT_(hp);
_CONVERT_(bd);
_CONVERT_(ll_default);
_CONVERT_(llhq);
_CONVERT_(llhp);
_CONVERT_(lossless_default);
_CONVERT_(lossless_hp);
if(preset == "default"sv) return _default;
#undef _CONVERT_
return std::nullopt;
}
std::optional<rc_e> rc_from_view(const std::string_view &rc) {
2021-05-17 21:21:57 +02:00
#define _CONVERT_(x) \
if(rc == #x##sv) return x
2020-04-14 00:15:24 +03:00
_CONVERT_(constqp);
_CONVERT_(vbr);
_CONVERT_(cbr);
_CONVERT_(cbr_hq);
_CONVERT_(vbr_hq);
_CONVERT_(cbr_ld_hq);
#undef _CONVERT_
return std::nullopt;
}
int coder_from_view(const std::string_view &coder) {
if(coder == "auto"sv) return _auto;
2021-05-17 21:21:57 +02:00
if(coder == "cabac"sv || coder == "ac"sv) return cabac;
if(coder == "cavlc"sv || coder == "vlc"sv) return cavlc;
2020-04-14 00:15:24 +03:00
return -1;
}
2021-05-17 21:21:57 +02:00
} // namespace nv
2020-04-14 00:15:24 +03:00
2021-01-28 18:32:58 -05:00
namespace amd {
enum quality_e : int {
_default = 0,
speed,
balanced,
//quality2,
};
enum rc_e : int {
2021-05-09 16:37:40 +02:00
constqp, /**< Constant QP mode */
vbr_latency, /**< Latency Constrained Variable Bitrate */
vbr_peak, /**< Peak Contrained Variable Bitrate */
cbr, /**< Constant bitrate mode */
2021-01-28 18:32:58 -05:00
};
enum coder_e : int {
_auto = 0,
cabac,
cavlc
};
std::optional<quality_e> quality_from_view(const std::string_view &quality) {
2021-05-17 21:21:57 +02:00
#define _CONVERT_(x) \
if(quality == #x##sv) return x
2021-01-28 18:32:58 -05:00
_CONVERT_(speed);
_CONVERT_(balanced);
//_CONVERT_(quality2);
if(quality == "default"sv) return _default;
#undef _CONVERT_
return std::nullopt;
}
std::optional<rc_e> rc_from_view(const std::string_view &rc) {
2021-05-17 21:21:57 +02:00
#define _CONVERT_(x) \
if(rc == #x##sv) return x
2021-01-28 18:32:58 -05:00
_CONVERT_(constqp);
2021-05-09 16:37:40 +02:00
_CONVERT_(vbr_latency);
_CONVERT_(vbr_peak);
2021-01-28 18:32:58 -05:00
_CONVERT_(cbr);
#undef _CONVERT_
return std::nullopt;
}
int coder_from_view(const std::string_view &coder) {
if(coder == "auto"sv) return _auto;
2021-05-17 21:21:57 +02:00
if(coder == "cabac"sv || coder == "ac"sv) return cabac;
if(coder == "cavlc"sv || coder == "vlc"sv) return cavlc;
2021-01-28 18:32:58 -05:00
return -1;
}
2021-05-17 21:21:57 +02:00
} // namespace amd
2021-01-28 18:32:58 -05:00
video_t video {
2021-05-17 21:21:57 +02:00
0, // crf
28, // qp
0, // hevc_mode
2020-04-14 00:15:24 +03:00
1, // min_threads
{
2021-05-17 21:21:57 +02:00
"superfast"s, // preset
2020-04-14 00:15:24 +03:00
"zerolatency"s, // tune
2021-05-17 21:21:57 +02:00
}, // software
2020-04-14 00:15:24 +03:00
{
nv::llhq,
std::nullopt,
2021-05-17 21:21:57 +02:00
-1 }, // nv
2020-04-14 00:15:24 +03:00
2021-01-28 18:32:58 -05:00
{
amd::balanced,
std::nullopt,
2021-05-17 21:21:57 +02:00
-1 }, // amd
2021-01-28 18:32:58 -05:00
2020-04-14 00:15:24 +03:00
{}, // encoder
{}, // adapter_name
2021-05-17 21:21:57 +02:00
{}, // output_name
};
audio_t audio {};
stream_t stream {
2s, // ping_timeout
APPS_JSON_PATH,
2020-02-08 16:26:38 +01:00
10, // fecPercentage
2021-05-17 21:21:57 +02:00
1 // channels
};
nvhttp_t nvhttp {
"lan", // origin_pin
PRIVATE_KEY_FILE,
CERTIFICATE_FILE,
boost::asio::ip::host_name(), // sunshine_name,
2021-05-26 17:34:25 +02:00
"sunshine_state.json"s, // file_state
{}, // external_ip
{
"352x240"s,
"480x360"s,
"858x480"s,
"1280x720"s,
"1920x1080"s,
"2560x1080"s,
"3440x1440"s
"1920x1200"s,
"3860x2160"s,
"3840x1600"s,
}, // supported resolutions
{ 10, 30, 60, 90, 120 }, // supported fps
};
2019-12-03 23:19:00 +01:00
2019-12-22 23:34:12 +01:00
input_t input {
2021-05-17 21:21:57 +02:00
2s, // back_button_timeout
500ms, // key_repeat_delay
std::chrono::duration<double> { 1 / 24.9 } // key_repeat_period
2019-12-22 23:34:12 +01:00
};
sunshine_t sunshine {
2020-03-19 19:59:27 +01:00
2, // min_log_level
0, // flags
"user_credentials.json"s,//User file
""s,//Username
""s,//Password
""s//Password Salt
};
2021-05-26 17:34:25 +02:00
bool endline(char ch) {
return ch == '\r' || ch == '\n';
}
bool space_tab(char ch) {
2019-12-03 23:19:00 +01:00
return ch == ' ' || ch == '\t';
}
2021-05-26 17:34:25 +02:00
bool whitespace(char ch) {
return space_tab(ch) || endline(ch);
}
2019-12-03 23:19:00 +01:00
std::string to_string(const char *begin, const char *end) {
2021-05-26 17:34:25 +02:00
std::string result;
KITTY_WHILE_LOOP(auto pos = begin, pos != end, {
auto comment = std::find(pos, end, '#');
auto endl = std::find_if(comment, end, endline);
result.append(pos, comment);
pos = endl;
})
return result;
2019-12-03 23:19:00 +01:00
}
2021-05-26 17:34:25 +02:00
template<class It>
It skip_list(It skipper, It end) {
int stack = 1;
while(skipper != end && stack) {
if(*skipper == '[') {
++stack;
}
if(*skipper == ']') {
--stack;
}
2019-12-03 23:19:00 +01:00
2021-05-26 17:34:25 +02:00
++skipper;
2019-12-03 23:19:00 +01:00
}
2021-05-26 17:34:25 +02:00
return skipper;
2019-12-03 23:19:00 +01:00
}
2021-05-26 17:34:25 +02:00
std::pair<
std::string_view::const_iterator,
std::optional<std::pair<std::string, std::string>>>
parse_option(std::string_view::const_iterator begin, std::string_view::const_iterator end) {
begin = std::find_if_not(begin, end, whitespace);
auto endl = std::find_if(begin, end, endline);
auto endc = std::find(begin, endl, '#');
endc = std::find_if(std::make_reverse_iterator(endc), std::make_reverse_iterator(begin), std::not_fn(whitespace)).base();
auto eq = std::find(begin, endc, '=');
if(eq == endc || eq == begin) {
return std::make_pair(endl, std::nullopt);
}
2019-12-03 23:19:00 +01:00
2021-05-26 17:34:25 +02:00
auto end_name = std::find_if_not(std::make_reverse_iterator(eq), std::make_reverse_iterator(begin), space_tab).base();
auto begin_val = std::find_if_not(eq + 1, endc, space_tab);
if(begin_val == endl) {
return std::make_pair(endl, std::nullopt);
2019-12-03 23:19:00 +01:00
}
2021-05-26 17:34:25 +02:00
// Lists might contain newlines
if(*begin_val == '[') {
endl = skip_list(begin_val + 1, end);
if(endl == end) {
std::cout << "Warning: Config option ["sv << to_string(begin, end_name) << "] Missing ']'"sv;
return std::make_pair(endl, std::nullopt);
}
}
2019-12-03 23:19:00 +01:00
2021-05-26 17:34:25 +02:00
return std::make_pair(
endl,
std::make_pair(to_string(begin, end_name), to_string(begin_val, endl)));
2019-12-03 23:19:00 +01:00
}
std::unordered_map<std::string, std::string> parse_config(std::string_view file_content) {
std::unordered_map<std::string, std::string> vars;
2020-01-11 01:17:57 +01:00
auto pos = std::begin(file_content);
2019-12-03 23:19:00 +01:00
auto end = std::end(file_content);
2020-01-11 01:17:57 +01:00
while(pos < end) {
2021-05-26 17:34:25 +02:00
// auto newline = std::find_if(pos, end, [](auto ch) { return ch == '\n' || ch == '\r'; });
TUPLE_2D(endl, var, parse_option(pos, end));
pos = endl;
if(pos != end) {
pos += (*pos == '\r') ? 2 : 1;
}
2019-12-03 23:19:00 +01:00
if(!var) {
continue;
}
vars.emplace(std::move(*var));
}
return vars;
}
void string_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, std::string &input) {
auto it = vars.find(name);
if(it == std::end(vars)) {
return;
}
input = std::move(it->second);
vars.erase(it);
2019-12-03 23:19:00 +01:00
}
void string_restricted_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, std::string &input, const std::vector<std::string_view> &allowed_vals) {
std::string temp;
string_f(vars, name, temp);
for(auto &allowed_val : allowed_vals) {
if(temp == allowed_val) {
input = std::move(temp);
return;
}
}
}
2019-12-03 23:19:00 +01:00
void int_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, int &input) {
auto it = vars.find(name);
if(it == std::end(vars)) {
return;
}
auto &val = it->second;
2021-05-17 21:21:57 +02:00
input = util::from_chars(&val[0], &val[0] + val.size());
vars.erase(it);
2019-12-03 23:19:00 +01:00
}
2020-04-14 00:15:24 +03:00
void int_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, std::optional<int> &input) {
auto it = vars.find(name);
if(it == std::end(vars)) {
return;
}
auto &val = it->second;
2021-05-17 21:21:57 +02:00
input = util::from_chars(&val[0], &val[0] + val.size());
2020-04-14 00:15:24 +03:00
vars.erase(it);
}
template<class F>
void int_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, int &input, F &&f) {
std::string tmp;
string_f(vars, name, tmp);
if(!tmp.empty()) {
input = f(tmp);
}
}
template<class F>
void int_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, std::optional<int> &input, F &&f) {
std::string tmp;
string_f(vars, name, tmp);
if(!tmp.empty()) {
input = f(tmp);
}
}
void int_between_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, int &input, const std::pair<int, int> &range) {
int temp = input;
int_f(vars, name, temp);
TUPLE_2D_REF(lower, upper, range);
if(temp >= lower && temp <= upper) {
input = temp;
}
}
2020-04-14 00:15:24 +03:00
bool to_bool(std::string &boolean) {
2021-05-17 21:21:57 +02:00
std::for_each(std::begin(boolean), std::end(boolean), [](char ch) { return (char)std::tolower(ch); });
2020-04-14 00:15:24 +03:00
2021-05-17 21:21:57 +02:00
return boolean == "true"sv ||
boolean == "yes"sv ||
boolean == "enable"sv ||
(std::find(std::begin(boolean), std::end(boolean), '1') != std::end(boolean));
2020-04-14 00:15:24 +03:00
}
2021-05-17 21:21:57 +02:00
void bool_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, int &input) {
2020-04-14 00:15:24 +03:00
std::string tmp;
2020-04-26 00:23:34 +02:00
string_f(vars, name, tmp);
2020-04-14 00:15:24 +03:00
if(tmp.empty()) {
return;
}
input = to_bool(tmp) ? 1 : 0;
}
2021-05-17 21:21:57 +02:00
void double_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, double &input) {
2020-04-26 00:23:34 +02:00
std::string tmp;
string_f(vars, name, tmp);
if(tmp.empty()) {
return;
}
char *c_str_p;
auto val = std::strtod(tmp.c_str(), &c_str_p);
if(c_str_p == tmp.c_str()) {
return;
}
input = val;
}
void double_between_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, double &input, const std::pair<double, double> &range) {
double temp = input;
double_f(vars, name, temp);
TUPLE_2D_REF(lower, upper, range);
if(temp >= lower && temp <= upper) {
input = temp;
}
}
2021-05-26 17:34:25 +02:00
void list_string_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, std::vector<std::string> &input) {
std::string string;
string_f(vars, name, string);
if(string.empty()) {
return;
}
input.clear();
auto begin = std::cbegin(string);
if(*begin == '[') {
++begin;
}
begin = std::find_if_not(begin, std::cend(string), whitespace);
if(begin == std::cend(string)) {
return;
}
auto pos = begin;
while(pos < std::cend(string)) {
if(*pos == '[') {
pos = skip_list(pos + 1, std::cend(string)) + 1;
}
else if(*pos == ']') {
break;
}
else if(*pos == ',') {
input.emplace_back(begin, pos);
pos = begin = std::find_if_not(pos + 1, std::cend(string), whitespace);
}
else {
++pos;
}
}
if(pos != begin) {
input.emplace_back(begin, pos);
}
}
void list_int_f(std::unordered_map<std::string, std::string> &vars, const std::string &name, std::vector<int> &input) {
std::vector<std::string> list;
list_string_f(vars, name, list);
for(auto &el : list) {
input.emplace_back(util::from_view(el));
}
}
2020-03-19 19:59:27 +01:00
void print_help(const char *name) {
2021-05-26 17:34:25 +02:00
std::cout
<< "Usage: "sv << name << " [options] [/path/to/configuration_file]"sv << std::endl
<< " Any configurable option can be overwritten with: \"name=value\""sv << std::endl
<< std::endl
<< " --help | print help"sv << std::endl
<< std::endl
<< " flags"sv << std::endl
<< " -0 | Read PIN from stdin"sv << std::endl
<< " -1 | Do not load previously saved state and do retain any state after shutdown"sv << std::endl
<< " | Effectively starting as if for the first time without overwriting any pairings with your devices"sv;
2020-03-19 19:59:27 +01:00
}
2019-12-03 23:19:00 +01:00
2020-03-19 19:59:27 +01:00
int apply_flags(const char *line) {
int ret = 0;
while(*line != '\0') {
switch(*line) {
2021-05-17 21:21:57 +02:00
case '0':
config::sunshine.flags[config::flag::PIN_STDIN].flip();
break;
case '1':
config::sunshine.flags[config::flag::FRESH_STATE].flip();
break;
case 'p':
config::sunshine.flags[config::flag::CONST_PIN].flip();
break;
default:
std::cout << "Warning: Unrecognized flag: ["sv << *line << ']' << std::endl;
ret = -1;
2020-03-19 19:59:27 +01:00
}
++line;
}
2019-12-03 23:19:00 +01:00
2020-03-19 19:59:27 +01:00
return ret;
}
void apply_config(std::unordered_map<std::string, std::string> &&vars) {
2019-12-03 23:19:00 +01:00
for(auto &[name, val] : vars) {
std::cout << "["sv << name << "] -- ["sv << val << ']' << std::endl;
2019-12-03 23:19:00 +01:00
}
int_f(vars, "crf", video.crf);
2019-12-12 13:13:10 +01:00
int_f(vars, "qp", video.qp);
2020-01-20 17:23:57 -08:00
int_f(vars, "min_threads", video.min_threads);
2021-05-17 21:21:57 +02:00
int_between_f(vars, "hevc_mode", video.hevc_mode, { 0, 3 });
2020-04-14 00:15:24 +03:00
string_f(vars, "sw_preset", video.sw.preset);
string_f(vars, "sw_tune", video.sw.tune);
int_f(vars, "nv_preset", video.nv.preset, nv::preset_from_view);
2021-01-28 18:32:58 -05:00
int_f(vars, "nv_rc", video.nv.rc, nv::rc_from_view);
2020-04-14 00:15:24 +03:00
int_f(vars, "nv_coder", video.nv.coder, nv::coder_from_view);
2021-01-28 18:32:58 -05:00
int_f(vars, "amd_quality", video.amd.quality, amd::quality_from_view);
int_f(vars, "amd_rc", video.amd.rc, amd::rc_from_view);
int_f(vars, "amd_coder", video.amd.coder, amd::coder_from_view);
2020-04-14 00:15:24 +03:00
string_f(vars, "encoder", video.encoder);
string_f(vars, "adapter_name", video.adapter_name);
string_f(vars, "output_name", video.output_name);
2019-12-03 23:19:00 +01:00
string_f(vars, "pkey", nvhttp.pkey);
string_f(vars, "cert", nvhttp.cert);
string_f(vars, "sunshine_name", nvhttp.sunshine_name);
2020-01-20 23:08:44 +01:00
string_f(vars, "file_state", nvhttp.file_state);
2019-12-03 23:19:00 +01:00
string_f(vars, "external_ip", nvhttp.external_ip);
2021-05-26 17:34:25 +02:00
list_string_f(vars, "resolutions"s, nvhttp.resolutions);
list_int_f(vars, "fps"s, nvhttp.fps);
2019-12-03 23:19:00 +01:00
string_f(vars, "audio_sink", audio.sink);
2021-05-22 19:51:01 +02:00
string_f(vars, "virtual_sink", audio.virtual_sink);
2021-05-17 21:21:57 +02:00
string_restricted_f(vars, "origin_pin_allowed", nvhttp.origin_pin_allowed, { "pc"sv, "lan"sv, "wan"sv });
2019-12-03 23:19:00 +01:00
int to = -1;
2021-05-17 21:21:57 +02:00
int_between_f(vars, "ping_timeout", to, { -1, std::numeric_limits<int>::max() });
2020-03-16 19:15:50 +01:00
if(to != -1) {
2020-03-01 14:06:47 +01:00
stream.ping_timeout = std::chrono::milliseconds(to);
}
2020-03-19 19:59:27 +01:00
2021-05-17 21:21:57 +02:00
int_between_f(vars, "channels", stream.channels, { 1, std::numeric_limits<int>::max() });
2020-02-08 16:26:38 +01:00
string_f(vars, "file_apps", stream.file_apps);
2021-05-17 21:21:57 +02:00
int_between_f(vars, "fec_percentage", stream.fec_percentage, { 1, 100 });
2019-12-22 23:34:12 +01:00
to = std::numeric_limits<int>::min();
int_f(vars, "back_button_timeout", to);
if(to > std::numeric_limits<int>::min()) {
2020-03-16 20:01:30 +01:00
input.back_button_timeout = std::chrono::milliseconds { to };
2019-12-22 23:34:12 +01:00
}
2020-04-26 00:23:34 +02:00
double repeat_frequency { 0 };
2021-05-17 21:21:57 +02:00
double_between_f(vars, "key_repeat_frequency", repeat_frequency, { 0, std::numeric_limits<double>::max() });
2020-04-26 00:23:34 +02:00
if(repeat_frequency > 0) {
2021-05-17 21:21:57 +02:00
config::input.key_repeat_period = std::chrono::duration<double> { 1 / repeat_frequency };
2020-04-26 00:23:34 +02:00
}
to = -1;
int_f(vars, "key_repeat_delay", to);
if(to >= 0) {
input.key_repeat_delay = std::chrono::milliseconds { to };
}
std::string log_level_string;
2021-05-17 21:21:57 +02:00
string_restricted_f(vars, "min_log_level", log_level_string, { "verbose"sv, "debug"sv, "info"sv, "warning"sv, "error"sv, "fatal"sv, "none"sv });
2020-01-11 01:23:49 +01:00
if(!log_level_string.empty()) {
if(log_level_string == "verbose"sv) {
sunshine.min_log_level = 0;
}
else if(log_level_string == "debug"sv) {
sunshine.min_log_level = 1;
}
else if(log_level_string == "info"sv) {
sunshine.min_log_level = 2;
}
else if(log_level_string == "warning"sv) {
sunshine.min_log_level = 3;
}
else if(log_level_string == "error"sv) {
sunshine.min_log_level = 4;
}
else if(log_level_string == "fatal"sv) {
sunshine.min_log_level = 5;
}
else if(log_level_string == "none"sv) {
sunshine.min_log_level = 6;
}
}
2020-03-19 19:59:27 +01:00
auto it = vars.find("flags"s);
if(it != std::end(vars)) {
apply_flags(it->second.c_str());
vars.erase(it);
}
if(sunshine.min_log_level <= 3) {
2021-05-17 21:21:57 +02:00
for(auto &[var, _] : vars) {
std::cout << "Warning: Unrecognized configurable option ["sv << var << ']' << std::endl;
}
}
2019-12-03 23:19:00 +01:00
}
2020-03-19 19:59:27 +01:00
int parse(int argc, char *argv[]) {
const char *config_file = SUNSHINE_ASSETS_DIR "/sunshine.conf";
std::unordered_map<std::string, std::string> cmd_vars;
2021-05-17 21:21:57 +02:00
for(auto x = argc - 1; x > 0; --x) {
2020-03-19 19:59:27 +01:00
auto line = argv[x];
if(line == "--help"sv) {
print_help(*argv);
return 1;
}
else if(*line == '-') {
if(apply_flags(line + 1)) {
print_help(*argv);
return -1;
}
}
else {
auto line_end = line + strlen(line);
auto pos = std::find(line, line_end, '=');
if(pos == line_end) {
config_file = line;
}
else {
2021-05-26 17:34:25 +02:00
TUPLE_EL(var, 1, parse_option(line, line_end));
2020-03-19 19:59:27 +01:00
if(!var) {
print_help(*argv);
return -1;
}
cmd_vars.emplace(std::move(*var));
}
}
}
std::ifstream in { config_file };
if(!in.is_open()) {
std::cout << "Error: Couldn't open "sv << config_file << std::endl;
return -1;
}
auto vars = parse_config(std::string {
// Quick and dirty
std::istreambuf_iterator<char>(in),
2021-05-17 21:21:57 +02:00
std::istreambuf_iterator<char>() });
2019-12-03 23:19:00 +01:00
2021-05-17 21:21:57 +02:00
for(auto &[name, value] : cmd_vars) {
2020-03-25 10:51:32 +01:00
vars.insert_or_assign(std::move(name), std::move(value));
2020-03-19 19:59:27 +01:00
}
apply_config(std::move(vars));
return 0;
}
2021-05-17 21:21:57 +02:00
} // namespace config