aboutsummaryrefslogtreecommitdiff
path: root/Parser.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-22 14:44:47 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-22 14:44:47 +0200
commit8c0562c8ef37cd5e80c58609f7bc7ae352365f65 (patch)
tree42e9906c5ddf1b0e719ee3eb7b965a444be64c38 /Parser.cpp
parentbc02054d56118110a36aea72d21f9d5e73d07d1f (diff)
refactor parser factory
Diffstat (limited to 'Parser.cpp')
-rw-r--r--Parser.cpp13
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;
+}
+