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

Function save

src/Engine/Options.cpp:530–553  ·  view source on GitHub ↗

* Saves options to a YAML file. * @param filename YAML filename. */

Source from the content-addressed store, hash-verified

528 * @param filename YAML filename.
529 */
530void save(const std::string &filename)
531{
532 std::string s = _configFolder + filename + ".cfg";
533 std::ofstream sav(s.c_str());
534 if (!sav)
535 {
536 Log(LOG_WARNING) << "Failed to save " << filename << ".cfg";
537 return;
538 }
539 YAML::Emitter out;
540
541 YAML::Node doc, node;
542 for (std::vector<OptionInfo>::iterator i = _info.begin(); i != _info.end(); ++i)
543 {
544 i->save(node);
545 }
546 doc["options"] = node;
547 doc["purchaseexclusions"] = purchaseExclusions;
548 doc["rulesets"] = rulesets;
549 out << doc;
550
551 sav << out.c_str();
552 sav.close();
553}
554
555/**
556 * Returns the game's current Data folder where resources

Callers 14

mainFunction · 0.85
updateOptionsFunction · 0.85
runMethod · 0.85
saveMethod · 0.85
saveMethod · 0.85
saveMethod · 0.85
saveMethod · 0.85
saveMethod · 0.85
saveMethod · 0.85
saveMethod · 0.85
btnOkClickMethod · 0.85
btnCancelClickMethod · 0.85

Calls 2

saveMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected