From bfea0319aa07ad2c921ba29ba216e921d65f2ed1 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 9 Jan 2024 00:23:16 +0000 Subject: Integer support in persistence Splits bool and arithmatic types, pass arithmatic values as string views from JSON and parse according to the target type. --- lib/jsonParse-persistence.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/jsonParse-persistence.cpp') diff --git a/lib/jsonParse-persistence.cpp b/lib/jsonParse-persistence.cpp index 5c0011a..ba61849 100644 --- a/lib/jsonParse-persistence.cpp +++ b/lib/jsonParse-persistence.cpp @@ -36,7 +36,7 @@ namespace Persistence { } void - JsonParsePersistence::pushNumber(float value) + JsonParsePersistence::pushNumber(std::string_view value) { pushValue(value); } @@ -163,6 +163,12 @@ namespace Persistence { strm << value; } + void + JsonWritePersistence::pushValue(int value) const + { + strm << value; + } + void JsonWritePersistence::pushValue(std::nullptr_t) const { -- cgit v1.2.3