added loading
This commit is contained in:
parent
598865d216
commit
7b79c35f63
8 changed files with 84 additions and 14 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue