summaryrefslogtreecommitdiff
path: root/lib/jsonParse-persistance.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-04-25 19:19:28 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-11-07 16:41:37 +0000
commitabd7f486a0fb34320e3afae6780677cfd4ff85cc (patch)
treef2633cc76e78e35300a7dafdf3bce1bd8bcf2b7b /lib/jsonParse-persistance.h
parentRemove spare semi colons (diff)
downloadilt-abd7f486a0fb34320e3afae6780677cfd4ff85cc.tar.bz2
ilt-abd7f486a0fb34320e3afae6780677cfd4ff85cc.tar.xz
ilt-abd7f486a0fb34320e3afae6780677cfd4ff85cc.zip
Erring toward complete JSON loader
Diffstat (limited to 'lib/jsonParse-persistance.h')
-rw-r--r--lib/jsonParse-persistance.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/jsonParse-persistance.h b/lib/jsonParse-persistance.h
index d5c76ed..bea93e0 100644
--- a/lib/jsonParse-persistance.h
+++ b/lib/jsonParse-persistance.h
@@ -11,18 +11,18 @@
namespace Persistanace {
class JsonParsePersistance : public json::jsonParser {
public:
- explicit JsonParsePersistance(std::istream & in);
-
template<typename T>
- void
- loadState(T & t)
+ inline T
+ loadState(std::istream & in)
{
+ T t {};
stk.push(std::make_unique<SelectionT<T>>(std::ref(t)));
- loadState();
+ loadState(in);
+ return t;
}
protected:
- void loadState();
+ void loadState(std::istream & in);
void BeginObject() override;
void BeginArray() override;
@@ -34,7 +34,6 @@ namespace Persistanace {
void EndArray() override;
void EndObject() override;
- private:
Stack stk;
template<typename T> inline void PushValue(T && value);