From 495d2cb6b47b309070b31e0ef83fa5731a150a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Mon, 27 Jan 2020 21:56:06 +0100 Subject: Storage: handle record items with unknown type --- include/erebos/storage.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include/erebos') diff --git a/include/erebos/storage.h b/include/erebos/storage.h index d855460..d23022f 100644 --- a/include/erebos/storage.h +++ b/include/erebos/storage.h @@ -160,12 +160,19 @@ class RecordT public: class Item { public: + struct UnknownType + { + std::string type; + std::string value; + }; + typedef std::variant< std::monostate, int, std::string, std::vector, - typename S::Ref> Variant; + typename S::Ref, + UnknownType> Variant; Item(const std::string & name): Item(name, std::monostate()) {} @@ -184,6 +191,7 @@ public: std::optional asText() const; std::optional> asBinary() const; std::optional asRef() const; + std::optional asUnknown() const; template std::optional> as() const; -- cgit v1.2.3