MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / load

Method load

Lattice/Engine/io/SimulationStateIO.cpp:577–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575void SimulationStateIO::save(const Simulation& simulation, std::string_view path) { saveNewFormat(simulation, path); }
576
577void SimulationStateIO::load(Simulation& simulation, std::string_view path) {
578 std::ifstream probe(path.data());
579 if (!probe.is_open()) {
580 return;
581 }
582
583 const std::string firstLine = readFirstNonEmptyLine(probe);
584 probe.close();
585
586 if (isNewLatFormat(firstLine)) {
587 loadNewFormat(simulation, path);
588 return;
589 }
590
591 if (isLikelyXYZFormat(path, firstLine)) {
592 loadXYZFormat(simulation, path);
593 return;
594 }
595
596 loadLegacyFormat(simulation, path);
597}

Callers

nothing calls this directly

Calls 7

readFirstNonEmptyLineFunction · 0.85
isNewLatFormatFunction · 0.85
loadNewFormatFunction · 0.85
isLikelyXYZFormatFunction · 0.85
loadXYZFormatFunction · 0.85
loadLegacyFormatFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected