XBT_PUBLIC(void) xbt_cfg_set_int (const char *name, int val);
XBT_PUBLIC(void) xbt_cfg_set_double (const char *name, double val);
XBT_PUBLIC(void) xbt_cfg_set_boolean (const char *name, const char *val);
+XBT_PUBLIC(void) xbt_cfg_set_string(const char* name, const char* val);
XBT_PUBLIC(void) xbt_cfg_set_as_string(const char *name, const char *val);
/*
if ((not xbt_cfg_is_default_value("network/model") || not xbt_cfg_is_default_value("cpu/model")) &&
xbt_cfg_is_default_value("host/model")) {
host_model_name = "compound";
- xbt_cfg_set_string("host/model", host_model_name);
+ xbt_cfg_set_string("host/model", host_model_name.c_str());
}
XBT_DEBUG("host model: %s", host_model_name.c_str());
/* Callback */
xbt_cfg_cb_t old_callback = nullptr;
- ConfigurationElement(const char* key, const char* desc)
- : key(key ? key : ""), desc(desc ? desc : "") {}
+ ConfigurationElement(const char* key, const char* desc) : key(key ? key : ""), desc(desc ? desc : "") {}
ConfigurationElement(const char* key, const char* desc, xbt_cfg_cb_t cb)
: key(key ? key : ""), desc(desc ? desc : ""), old_callback(cb) {}
private:
// name -> ConfigElement:
std::map<std::string, simgrid::config::ConfigurationElement*> options;
- // alias -> xbt_dict_elm_t from options:
+ // alias -> ConfigElement from options:
std::map<std::string, simgrid::config::ConfigurationElement*> aliases;
bool warn_for_aliases = true;
* @param value the value to be added
*
*/
-void xbt_cfg_set_string(const char* key, std::string value)
+void xbt_cfg_set_string(const char* key, const char* value)
{
try {
(*simgrid_config)[key].setValue<std::string>(value);
return;
}
- TRANSLATE_EXCEPTIONS("Could not set variable %s to string %s", key, value.c_str());
+ TRANSLATE_EXCEPTIONS("Could not set variable %s to string %s", key, value);
}
/** @brief Set or add a boolean value to \a name within \a cfg