MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / load

Function load

src/Engine/Options.cpp:502–524  ·  view source on GitHub ↗

* Loads options from a YAML file. * @param filename YAML filename. */

Source from the content-addressed store, hash-verified

500 * @param filename YAML filename.
501 */
502void load(const std::string &filename)
503{
504 std::string s = _configFolder + filename + ".cfg";
505 try
506 {
507 YAML::Node doc = YAML::LoadFile(s);
508 // Ignore old options files
509 if (doc["options"]["NewBattleMission"])
510 {
511 return;
512 }
513 for (std::vector<OptionInfo>::iterator i = _info.begin(); i != _info.end(); ++i)
514 {
515 i->load(doc["options"]);
516 }
517 purchaseExclusions = doc["purchaseexclusions"].as< std::vector<std::string> >(purchaseExclusions);
518 rulesets = doc["rulesets"].as< std::vector<std::string> >(rulesets);
519 }
520 catch (YAML::Exception e)
521 {
522 Log(LOG_WARNING) << e.what();
523 }
524}
525
526/**
527 * Saves options to a YAML file.

Callers 15

updateOptionsFunction · 0.85
loadMIDIMethod · 0.85
EquipmentLayoutItemMethod · 0.85
loadMethod · 0.85
loadMethod · 0.85
loadMethod · 0.85
loadMethod · 0.85
loadMethod · 0.85
loadMethod · 0.85
loadMethod · 0.85
loadMethod · 0.85
initMethod · 0.85

Calls 2

whatMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected