12 #define X(Enum, String, Default, Desc) \
28 #define X(Enum, String, Default, Desc) \
43 #define X(Enum, String, Default, Desc) \
44 if (key == String) { \
57 #define X(Enum, String, Default, Desc) \
68 static Configuration config;
81 if (key == ALTERNATIVE_REFPROP_PATH || key == ALTERNATIVE_REFPROP_HMX_BNC_PATH || key == ALTERNATIVE_REFPROP_LIBRARY_PATH) {
87 return static_cast<bool>(config.
get_item(key));
90 return static_cast<int>(config.
get_item(key));
93 return static_cast<double>(config.
get_item(key));
96 return static_cast<std::string
>(config.
get_item(key));
100 std::map<configuration_keys, ConfigurationItem> items = config.
get_items();
101 for (std::map<configuration_keys, ConfigurationItem>::const_iterator it = items.begin(); it != items.end(); ++it) {
102 it->second.add_to_json(doc, doc);
106 rapidjson::Document doc;
114 for (rapidjson::Value::MemberIterator it = val.MemberBegin(); it != val.MemberEnd(); ++it) {
117 std::string s = std::string(it->name.GetString());
121 }
catch (std::exception& e) {
122 throw ValueError(
format(
"Unable to parse json file with error: %s", e.what()));
127 for (rapidjson::Value::MemberIterator it = val.MemberBegin(); it != val.MemberEnd(); ++it) {
129 std::string s = std::string(it->name.GetString());
136 }
catch (std::exception& e) {
137 throw ValueError(
format(
"Unable to parse json file with error: %s", e.what()));
143 rapidjson::Document doc;
144 doc.Parse<0>(s.c_str());