added loading

This commit is contained in:
zanostro 2025-11-17 15:21:25 +01:00
parent 598865d216
commit 7b79c35f63
8 changed files with 84 additions and 14 deletions

View file

@ -5,6 +5,7 @@
#include <string>
#include <vector>
#include "file_reader.h"
#include <stdexcept>
class Machine;
@ -16,6 +17,9 @@ class Loader {
public:
Loader( shared_ptr<Machine> machine, string filename) : _machine(machine), _filename(filename) {
_file_reader = std::make_shared<FileReader>(filename, std::ios::in);
if (!_file_reader->good()) {
throw std::runtime_error("Loader: failed to open file: " + filename);
}
}
~Loader();