From f330428223ff90eeae3e22e8de20e5aea1188061 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 26 Nov 2015 13:53:01 +0100 Subject: Add LocalIntExt and LocalStringExt::unserialize() for non-FORMAT_NETWORK --- src/base.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/base.cpp b/src/base.cpp index b007a1098..496b23ef5 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -243,6 +243,12 @@ std::string LocalStringExt::serialize(SerializeFormat format, const Extensible* return ""; } +void LocalStringExt::unserialize(SerializeFormat format, Extensible* container, const std::string& value) +{ + if (format != FORMAT_NETWORK) + set(container, value); +} + LocalIntExt::LocalIntExt(const std::string& Key, ExtensibleType exttype, Module* mod) : LocalExtItem(Key, exttype, mod) { @@ -259,6 +265,12 @@ std::string LocalIntExt::serialize(SerializeFormat format, const Extensible* con return ConvToStr(reinterpret_cast(item)); } +void LocalIntExt::unserialize(SerializeFormat format, Extensible* container, const std::string& value) +{ + if (format != FORMAT_NETWORK) + set(container, ConvToInt(value)); +} + intptr_t LocalIntExt::get(const Extensible* container) const { return reinterpret_cast(get_raw(container)); -- cgit v1.2.3