11 obj[name] =
static_cast<bool>(item);
14 obj[name] =
static_cast<int>(item);
17 obj[name] =
static_cast<double>(item);
20 obj[name] =
static_cast<std::string
>(item);
31 if (!val.is_boolean()) {
37 if (!val.is_number_integer()) {
43 if (!val.is_number()) {
49 if (!val.is_string()) {
70#define X(Enum, String, Default, Desc) \
86#define X(Enum, String, Default, Desc) \
101#define X(Enum, String, Default, Desc) \
102 if (key == (String)) { \
107 return "INVALID KEY";
115#define X(Enum, String, Default, Desc) \
116 if (s == (String)) { \
130 pconfig = std::make_unique<Configuration>();
146 if (key == ALTERNATIVE_REFPROP_PATH || key == ALTERNATIVE_REFPROP_HMX_BNC_PATH || key == ALTERNATIVE_REFPROP_LIBRARY_PATH) {
164 nlohmann::json doc = nlohmann::json::object();
166 item_to_json(kv.second, doc);
174 for (
auto& [name, value] : doc.items()) {
177 }
catch (std::exception& e) {
178 throw ValueError(
format(
"Unable to parse json file with error: %s", e.what()));
183 for (
auto& [name, value] : doc.items()) {
186 item_from_json(item, value);
187 }
catch (std::exception& e) {
188 throw ValueError(
format(
"Unable to parse json file with error: %s", e.what()));