From abd7f486a0fb34320e3afae6780677cfd4ff85cc Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 25 Apr 2021 19:19:28 +0100 Subject: Erring toward complete JSON loader --- lib/jsonParse-persistance.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/jsonParse-persistance.cpp') diff --git a/lib/jsonParse-persistance.cpp b/lib/jsonParse-persistance.cpp index 89887da..ad9fc2a 100644 --- a/lib/jsonParse-persistance.cpp +++ b/lib/jsonParse-persistance.cpp @@ -1,11 +1,10 @@ #include "jsonParse-persistance.h" namespace Persistanace { - JsonParsePersistance::JsonParsePersistance(std::istream & in) : json::jsonParser {&in} { } - void - JsonParsePersistance::loadState() + JsonParsePersistance::loadState(std::istream & in) { + this->switch_streams(&in, nullptr); yy_push_state(0); yylex(); } @@ -13,7 +12,8 @@ namespace Persistanace { void JsonParsePersistance::BeginObject() { - stk.push(current()->BeginObject()); + current()->beforeValue(stk); + current()->BeginObject(stk); } void @@ -61,7 +61,8 @@ namespace Persistanace { void JsonParsePersistance::EndObject() { - stk.pop(); + current()->EndObject(stk); + current()->EndObject(stk); } template -- cgit v1.2.3