diff --git a/Source/core/JSON.h b/Source/core/JSON.h index 164ff3db9..d48089e07 100644 --- a/Source/core/JSON.h +++ b/Source/core/JSON.h @@ -2511,6 +2511,7 @@ namespace Core { private: enum modus : uint8_t { ERROR = 0x80, + SET = 0x20, UNDEFINED = 0x40 }; @@ -2751,7 +2752,7 @@ namespace Core { // IElement and IMessagePack iface: bool IsSet() const override { - return (Length() > 0); + return ( (Length() > 0) || ((_state & modus::SET) != 0) ); } bool IsNull() const override @@ -2760,6 +2761,16 @@ namespace Core { return ((_state & UNDEFINED) != 0); } + void Set(const bool enabled) + { + if (enabled == true) { + _state |= (modus::SET); + } + else { + _state &= (~modus::SET); + } + } + void Clear() override { _state = 0; @@ -2934,6 +2945,7 @@ namespace Core { if (loaded < maxLength) { switch (stream[loaded]) { case ']': + _state |= (modus::SET); offset = FIND_MARKER; loaded++; break;