- if (not options || not strlen(options)) { /* nothing to do */
- return;
- }
-
- XBT_DEBUG("List to parse and set:'%s'", options);
- std::string optionlist(options);
- while (not optionlist.empty()) {
- XBT_DEBUG("Still to parse and set: '%s'", optionlist.c_str());
-
- // skip separators
- size_t pos = optionlist.find_first_not_of(" \t\n,");
- optionlist.erase(0, pos);
- // find option
- pos = optionlist.find_first_of(" \t\n,");
- std::string name = optionlist.substr(0, pos);
- optionlist.erase(0, pos);
- XBT_DEBUG("parse now:'%s'; parse later:'%s'", name.c_str(), optionlist.c_str());
-
- if (name.empty())
- continue;
-
- pos = name.find(':');
- xbt_assert(pos != std::string::npos, "Option '%s' badly formatted. Should be of the form 'name:value'",
- name.c_str());
-
- std::string val = name.substr(pos + 1);
- name.erase(pos);
-
- const std::string path("path");
- if (name.compare(0, path.length(), path) != 0)
- XBT_INFO("Configuration change: Set '%s' to '%s'", name.c_str(), val.c_str());
-
- (*simgrid_config)[name.c_str()].set_string_value(val.c_str());
- }