summaryrefslogtreecommitdiff
path: root/src/base.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-11-26 13:53:01 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-11-26 13:53:01 +0100
commitf330428223ff90eeae3e22e8de20e5aea1188061 (patch)
tree84065331ffd2f49984c1374073f539c75a878c92 /src/base.cpp
parentcdb764f2de7ee27c97708dfe44f1e6b905c571db (diff)
Add LocalIntExt and LocalStringExt::unserialize() for non-FORMAT_NETWORK
Diffstat (limited to 'src/base.cpp')
-rw-r--r--src/base.cpp12
1 files changed, 12 insertions, 0 deletions
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<intptr_t>(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<intptr_t>(get_raw(container));