diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-22 14:44:47 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-22 14:44:47 +0200 |
commit | 8c0562c8ef37cd5e80c58609f7bc7ae352365f65 (patch) | |
tree | 42e9906c5ddf1b0e719ee3eb7b965a444be64c38 /Parser.cpp | |
parent | bc02054d56118110a36aea72d21f9d5e73d07d1f (diff) |
refactor parser factory
Diffstat (limited to 'Parser.cpp')
-rw-r--r-- | Parser.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Parser.cpp b/Parser.cpp new file mode 100644 index 0000000..9b07089 --- /dev/null +++ b/Parser.cpp @@ -0,0 +1,13 @@ +#include "Parser.h" +#include "Exception.h" + +void Parser::set_file(FileReader & file) { + this->file = &file; +} + +FileReader & Parser::get_file() { + if (this->file == nullptr) + throw Exception("Parser: no file to read"); + return *this->file; +} + |