From 9834b532c586fc0e84f87401b1648579212d8d41 Mon Sep 17 00:00:00 2001 From: Guillermo Serrahima Date: Tue, 26 Mar 2024 16:18:59 +0100 Subject: [PATCH] Recovered reading from file --- src/Grammar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Grammar.cpp b/src/Grammar.cpp index bc32fb4..a288451 100644 --- a/src/Grammar.cpp +++ b/src/Grammar.cpp @@ -6,7 +6,9 @@ Grammar::Grammar() : type{NONE}, content{} {} Grammar::Grammar(const GrammarType type, const std::string content) : type(type), content(content) { if (type == COMPILED) { std::ifstream input(content, std::ios::binary); - compiledBytes = {content.data(), content.data() + content.length()}; + compiledBytes = std::vector ( + (std::istreambuf_iterator(input)), + (std::istreambuf_iterator())); input.close(); } }