| 575 | void SimulationStateIO::save(const Simulation& simulation, std::string_view path) { saveNewFormat(simulation, path); } |
| 576 | |
| 577 | void 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 | } |
nothing calls this directly
no test coverage detected