Core/Serialization: Add type tag parameters
This commit is contained in:
parent
3165dbe095
commit
69f079fcc8
|
|
@ -72,6 +72,7 @@ Nazara Engine:
|
||||||
- ⚠️ Removed array/pointer constructor from Vector classes
|
- ⚠️ Removed array/pointer constructor from Vector classes
|
||||||
- Fixed Platform module not being classified as client-only
|
- Fixed Platform module not being classified as client-only
|
||||||
- ⚠️ Renamed Bitset::Read to Bitset::Write
|
- ⚠️ Renamed Bitset::Read to Bitset::Write
|
||||||
|
- ⚠️ Added a type tag parameter to Serialize and Unserialize functions, to prevent implicit conversions with overloads
|
||||||
|
|
||||||
Nazara Development Kit:
|
Nazara Development Kit:
|
||||||
- Added ImageWidget (#139)
|
- Added ImageWidget (#139)
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include <Nazara/Prerequisites.hpp>
|
#include <Nazara/Prerequisites.hpp>
|
||||||
#include <Nazara/Core/Enums.hpp>
|
#include <Nazara/Core/Enums.hpp>
|
||||||
#include <Nazara/Core/SerializationContext.hpp>
|
#include <Nazara/Core/SerializationContext.hpp>
|
||||||
|
#include <Nazara/Core/TypeTag.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
@ -37,19 +38,22 @@ namespace Nz
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct TypeTag {};
|
bool Serialize(SerializationContext& context, T&& value);
|
||||||
|
|
||||||
inline bool Serialize(SerializationContext& context, bool value);
|
inline bool Serialize(SerializationContext& context, bool value, TypeTag<bool>);
|
||||||
inline bool Serialize(SerializationContext& context, const std::string& value);
|
inline bool Serialize(SerializationContext& context, const std::string& value, TypeTag<std::string>);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
std::enable_if_t<std::is_arithmetic<T>::value, bool> Serialize(SerializationContext& context, T value);
|
std::enable_if_t<std::is_arithmetic<T>::value, bool> Serialize(SerializationContext& context, T value, TypeTag<T>);
|
||||||
|
|
||||||
inline bool Unserialize(SerializationContext& context, bool* value);
|
|
||||||
inline bool Unserialize(SerializationContext& context, std::string* value);
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
std::enable_if_t<std::is_arithmetic<T>::value, bool> Unserialize(SerializationContext& context, T* value);
|
bool Unserialize(SerializationContext& context, T* value);
|
||||||
|
|
||||||
|
inline bool Unserialize(SerializationContext& context, bool* value, TypeTag<bool>);
|
||||||
|
inline bool Unserialize(SerializationContext& context, std::string* value, TypeTag<std::string>);
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::enable_if_t<std::is_arithmetic<T>::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag<T>);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/Algorithm.inl>
|
#include <Nazara/Core/Algorithm.inl>
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Core/Stream.hpp>
|
#include <Nazara/Core/Stream.hpp>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
#include <utility>
|
||||||
#include <Nazara/Core/Debug.hpp>
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
|
|
@ -199,6 +200,13 @@ namespace Nz
|
||||||
template<typename T> struct PointedType<T* volatile> {typedef T type;};
|
template<typename T> struct PointedType<T* volatile> {typedef T type;};
|
||||||
template<typename T> struct PointedType<T* const volatile> {typedef T type;};
|
template<typename T> struct PointedType<T* const volatile> {typedef T type;};
|
||||||
|
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, T&& value)
|
||||||
|
{
|
||||||
|
return Serialize(context, std::forward<T>(value), TypeTag<std::decay_t<T>>());
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief Serializes a boolean
|
* \brief Serializes a boolean
|
||||||
|
|
@ -209,7 +217,7 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Serialize, Unserialize
|
* \see Serialize, Unserialize
|
||||||
*/
|
*/
|
||||||
inline bool Serialize(SerializationContext& context, bool value)
|
inline bool Serialize(SerializationContext& context, bool value, TypeTag<bool>)
|
||||||
{
|
{
|
||||||
if (context.currentBitPos == 8)
|
if (context.currentBitPos == 8)
|
||||||
{
|
{
|
||||||
|
|
@ -221,7 +229,7 @@ namespace Nz
|
||||||
context.currentByte |= 1 << context.currentBitPos;
|
context.currentByte |= 1 << context.currentBitPos;
|
||||||
|
|
||||||
if (++context.currentBitPos >= 8)
|
if (++context.currentBitPos >= 8)
|
||||||
return Serialize<UInt8>(context, context.currentByte);
|
return Serialize(context, context.currentByte, TypeTag<UInt8>());
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -234,9 +242,9 @@ namespace Nz
|
||||||
* \param context Context for the serialization
|
* \param context Context for the serialization
|
||||||
* \param value String to serialize
|
* \param value String to serialize
|
||||||
*/
|
*/
|
||||||
bool Serialize(SerializationContext& context, const std::string& value)
|
bool Serialize(SerializationContext& context, const std::string& value, TypeTag<std::string>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, UInt32(value.size())))
|
if (!Serialize(context, UInt32(value.size()), TypeTag<UInt32>()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return context.stream->Write(value.data(), value.size()) == value.size();
|
return context.stream->Write(value.data(), value.size()) == value.size();
|
||||||
|
|
@ -253,7 +261,7 @@ namespace Nz
|
||||||
* \see Serialize, Unserialize
|
* \see Serialize, Unserialize
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
std::enable_if_t<std::is_arithmetic<T>::value, bool> Serialize(SerializationContext& context, T value)
|
std::enable_if_t<std::is_arithmetic<T>::value, bool> Serialize(SerializationContext& context, T value, TypeTag<T>)
|
||||||
{
|
{
|
||||||
// Flush bits in case a writing is in progress
|
// Flush bits in case a writing is in progress
|
||||||
context.FlushBits();
|
context.FlushBits();
|
||||||
|
|
@ -264,6 +272,13 @@ namespace Nz
|
||||||
return context.stream->Write(&value, sizeof(T)) == sizeof(T);
|
return context.stream->Write(&value, sizeof(T)) == sizeof(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, T* value)
|
||||||
|
{
|
||||||
|
return Unserialize(context, value, TypeTag<T>());
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief Unserializes a boolean
|
* \brief Unserializes a boolean
|
||||||
|
|
@ -274,11 +289,11 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Serialize, Unserialize
|
* \see Serialize, Unserialize
|
||||||
*/
|
*/
|
||||||
inline bool Unserialize(SerializationContext& context, bool* value)
|
inline bool Unserialize(SerializationContext& context, bool* value, TypeTag<bool>)
|
||||||
{
|
{
|
||||||
if (context.currentBitPos == 8)
|
if (context.currentBitPos == 8)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &context.currentByte))
|
if (!Unserialize(context, &context.currentByte, TypeTag<UInt8>()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
context.currentBitPos = 0;
|
context.currentBitPos = 0;
|
||||||
|
|
@ -299,10 +314,10 @@ namespace Nz
|
||||||
* \param context Context of unserialization
|
* \param context Context of unserialization
|
||||||
* \param string std::string to unserialize
|
* \param string std::string to unserialize
|
||||||
*/
|
*/
|
||||||
bool Unserialize(SerializationContext& context, std::string* string)
|
bool Unserialize(SerializationContext& context, std::string* string, TypeTag<std::string>)
|
||||||
{
|
{
|
||||||
UInt32 size;
|
UInt32 size;
|
||||||
if (!Unserialize(context, &size))
|
if (!Unserialize(context, &size, TypeTag<UInt32>()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string->resize(size);
|
string->resize(size);
|
||||||
|
|
@ -322,7 +337,7 @@ namespace Nz
|
||||||
* \see Serialize, Unserialize
|
* \see Serialize, Unserialize
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
std::enable_if_t<std::is_arithmetic<T>::value, bool> Unserialize(SerializationContext& context, T* value)
|
std::enable_if_t<std::is_arithmetic<T>::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag<T>)
|
||||||
{
|
{
|
||||||
NazaraAssert(value, "Invalid data pointer");
|
NazaraAssert(value, "Invalid data pointer");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
m_context.currentBitPos = 8; //< To prevent Serialize to flush bits itself
|
m_context.currentBitPos = 8; //< To prevent Serialize to flush bits itself
|
||||||
|
|
||||||
if (!Serialize<UInt8>(m_context, m_context.currentByte))
|
if (!Serialize(m_context, m_context.currentByte))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ namespace Nz
|
||||||
static float Hue2RGB(float v1, float v2, float vH);
|
static float Hue2RGB(float v1, float v2, float vH);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool Serialize(SerializationContext& context, const Color& color);
|
inline bool Serialize(SerializationContext& context, const Color& color, TypeTag<Color>);
|
||||||
inline bool Unserialize(SerializationContext& context, Color* color);
|
inline bool Unserialize(SerializationContext& context, Color* color, TypeTag<Color>);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& out, const Nz::Color& color);
|
std::ostream& operator<<(std::ostream& out, const Nz::Color& color);
|
||||||
|
|
|
||||||
|
|
@ -617,7 +617,7 @@ namespace Nz
|
||||||
* \param context Serialization context
|
* \param context Serialization context
|
||||||
* \param color Input color
|
* \param color Input color
|
||||||
*/
|
*/
|
||||||
inline bool Serialize(SerializationContext& context, const Color& color)
|
inline bool Serialize(SerializationContext& context, const Color& color, TypeTag<Color>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, color.r))
|
if (!Serialize(context, color.r))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -641,7 +641,7 @@ namespace Nz
|
||||||
* \param context Serialization context
|
* \param context Serialization context
|
||||||
* \param color Output color
|
* \param color Output color
|
||||||
*/
|
*/
|
||||||
inline bool Unserialize(SerializationContext& context, Color* color)
|
inline bool Unserialize(SerializationContext& context, Color* color, TypeTag<Color>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &color->r))
|
if (!Unserialize(context, &color->r))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include <Nazara/Prerequisites.hpp>
|
#include <Nazara/Prerequisites.hpp>
|
||||||
#include <Nazara/Core/Config.hpp>
|
#include <Nazara/Core/Config.hpp>
|
||||||
#include <Nazara/Core/Endianness.hpp>
|
#include <Nazara/Core/Endianness.hpp>
|
||||||
|
#include <Nazara/Core/TypeTag.hpp>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include <Nazara/Prerequisites.hpp>
|
#include <Nazara/Prerequisites.hpp>
|
||||||
#include <Nazara/Core/Endianness.hpp>
|
#include <Nazara/Core/Endianness.hpp>
|
||||||
|
#include <Nazara/Core/TypeTag.hpp>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
@ -328,8 +329,8 @@ namespace Nz
|
||||||
class AbstractHash;
|
class AbstractHash;
|
||||||
|
|
||||||
inline bool HashAppend(AbstractHash* hash, const String& string);
|
inline bool HashAppend(AbstractHash* hash, const String& string);
|
||||||
NAZARA_CORE_API bool Serialize(SerializationContext& context, const String& string);
|
NAZARA_CORE_API bool Serialize(SerializationContext& context, const String& string, TypeTag<String>);
|
||||||
NAZARA_CORE_API bool Unserialize(SerializationContext& context, String* string);
|
NAZARA_CORE_API bool Unserialize(SerializationContext& context, String* string, TypeTag<String>);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine - Core module"
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_TYPETAG_HPP
|
||||||
|
#define NAZARA_TYPETAG_HPP
|
||||||
|
|
||||||
|
namespace Nz
|
||||||
|
{
|
||||||
|
template<typename T>
|
||||||
|
struct TypeTag {};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // NAZARA_TYPETAG_HPP
|
||||||
|
|
@ -72,8 +72,8 @@ namespace Nz
|
||||||
typedef BoundingVolume<double> BoundingVolumed;
|
typedef BoundingVolume<double> BoundingVolumed;
|
||||||
typedef BoundingVolume<float> BoundingVolumef;
|
typedef BoundingVolume<float> BoundingVolumef;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const BoundingVolume<T>& boundingVolume);
|
template<typename T> bool Serialize(SerializationContext& context, const BoundingVolume<T>& boundingVolume, TypeTag<BoundingVolume<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, BoundingVolume<T>* boundingVolume);
|
template<typename T> bool Unserialize(SerializationContext& context, BoundingVolume<T>* boundingVolume, TypeTag<BoundingVolume<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -603,9 +603,9 @@ namespace Nz
|
||||||
* \remark Does not save OBB corners
|
* \remark Does not save OBB corners
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const BoundingVolume<T>& boundingVolume)
|
bool Serialize(SerializationContext& context, const BoundingVolume<T>& boundingVolume, TypeTag<BoundingVolume<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, static_cast<UInt8>(boundingVolume.extend)))
|
if (!Serialize(context, static_cast<UInt8>(boundingVolume.extend)>))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!Serialize(context, boundingVolume.aabb))
|
if (!Serialize(context, boundingVolume.aabb))
|
||||||
|
|
@ -627,7 +627,7 @@ namespace Nz
|
||||||
* \remark The resulting oriented box corners will *not* be updated, a call to Update is required
|
* \remark The resulting oriented box corners will *not* be updated, a call to Update is required
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, BoundingVolume<T>* boundingVolume)
|
bool Unserialize(SerializationContext& context, BoundingVolume<T>* boundingVolume, TypeTag<BoundingVolume<T>>)
|
||||||
{
|
{
|
||||||
UInt8 extend;
|
UInt8 extend;
|
||||||
if (!Unserialize(context, &extend))
|
if (!Unserialize(context, &extend))
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,8 @@ namespace Nz
|
||||||
typedef Box<Int32> Boxi32;
|
typedef Box<Int32> Boxi32;
|
||||||
typedef Box<UInt32> Boxui32;
|
typedef Box<UInt32> Boxui32;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Box<T>& box);
|
template<typename T> bool Serialize(SerializationContext& context, const Box<T>& box, TypeTag<Box<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Box<T>* box);
|
template<typename T> bool Unserialize(SerializationContext& context, Box<T>* box, TypeTag<Box<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -912,7 +912,7 @@ namespace Nz
|
||||||
* \param box Input Box
|
* \param box Input Box
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Box<T>& box)
|
bool Serialize(SerializationContext& context, const Box<T>& box, TypeTag<Box<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, box.x))
|
if (!Serialize(context, box.x))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -943,7 +943,7 @@ namespace Nz
|
||||||
* \param box Output Box
|
* \param box Output Box
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Box<T>* box)
|
bool Unserialize(SerializationContext& context, Box<T>* box, TypeTag<Box<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &box->x))
|
if (!Unserialize(context, &box->x))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,8 @@ namespace Nz
|
||||||
typedef EulerAngles<double> EulerAnglesd;
|
typedef EulerAngles<double> EulerAnglesd;
|
||||||
typedef EulerAngles<float> EulerAnglesf;
|
typedef EulerAngles<float> EulerAnglesf;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const EulerAngles<T>& eulerAngles);
|
template<typename T> bool Serialize(SerializationContext& context, const EulerAngles<T>& eulerAngles, TypeTag<EulerAngles<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, EulerAngles<T>* eulerAngles);
|
template<typename T> bool Unserialize(SerializationContext& context, EulerAngles<T>* eulerAngles, TypeTag<EulerAngles<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::EulerAngles<T>& angles);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::EulerAngles<T>& angles);
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ namespace Nz
|
||||||
* \param angles Input euler angles
|
* \param angles Input euler angles
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const EulerAngles<T>& angles)
|
bool Serialize(SerializationContext& context, const EulerAngles<T>& angles, TypeTag<EulerAngles<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, angles.pitch))
|
if (!Serialize(context, angles.pitch))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -362,7 +362,7 @@ namespace Nz
|
||||||
* \param angles Output euler angles
|
* \param angles Output euler angles
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, EulerAngles<T>* angles)
|
bool Unserialize(SerializationContext& context, EulerAngles<T>* angles, TypeTag<EulerAngles<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &angles->pitch))
|
if (!Unserialize(context, &angles->pitch))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,9 @@ namespace Nz
|
||||||
String ToString() const;
|
String ToString() const;
|
||||||
|
|
||||||
template<typename U>
|
template<typename U>
|
||||||
friend bool Serialize(SerializationContext& context, const Frustum<U>& frustum);
|
friend bool Serialize(SerializationContext& context, const Frustum<U>& frustum, TypeTag<Frustum<T>>);
|
||||||
template<typename U>
|
template<typename U>
|
||||||
friend bool Unserialize(SerializationContext& context, Frustum<U>* frustum);
|
friend bool Unserialize(SerializationContext& context, Frustum<U>* frustum, TypeTag<Frustum<T>>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Vector3<T> m_corners[BoxCorner_Max+1];
|
Vector3<T> m_corners[BoxCorner_Max+1];
|
||||||
|
|
|
||||||
|
|
@ -684,7 +684,7 @@ namespace Nz
|
||||||
* \param matrix Input frustum
|
* \param matrix Input frustum
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Frustum<T>& frustum)
|
bool Serialize(SerializationContext& context, const Frustum<T>& frustum, TypeTag<Frustum<T>>)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i <= BoxCorner_Max; ++i)
|
for (unsigned int i = 0; i <= BoxCorner_Max; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -709,7 +709,7 @@ namespace Nz
|
||||||
* \param matrix Output frustum
|
* \param matrix Output frustum
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Frustum<T>* frustum)
|
bool Unserialize(SerializationContext& context, Frustum<T>* frustum, TypeTag<Frustum<T>>)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i <= BoxCorner_Max; ++i)
|
for (unsigned int i = 0; i <= BoxCorner_Max; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -141,8 +141,8 @@ namespace Nz
|
||||||
typedef Matrix4<double> Matrix4d;
|
typedef Matrix4<double> Matrix4d;
|
||||||
typedef Matrix4<float> Matrix4f;
|
typedef Matrix4<float> Matrix4f;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Matrix4<T>& matrix);
|
template<typename T> bool Serialize(SerializationContext& context, const Matrix4<T>& matrix, TypeTag<Matrix4<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Matrix4<T>* matrix);
|
template<typename T> bool Unserialize(SerializationContext& context, Matrix4<T>* matrix, TypeTag<Matrix4<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Matrix4<T>& matrix);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Matrix4<T>& matrix);
|
||||||
|
|
|
||||||
|
|
@ -1767,7 +1767,7 @@ namespace Nz
|
||||||
* \param matrix Input matrix
|
* \param matrix Input matrix
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Matrix4<T>& matrix)
|
bool Serialize(SerializationContext& context, const Matrix4<T>& matrix, TypeTag<Matrix4<T>>)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < 16; ++i)
|
for (unsigned int i = 0; i < 16; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -1786,7 +1786,7 @@ namespace Nz
|
||||||
* \param matrix Output matrix
|
* \param matrix Output matrix
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Matrix4<T>* matrix)
|
bool Unserialize(SerializationContext& context, Matrix4<T>* matrix, TypeTag<Matrix4<T>>)
|
||||||
{
|
{
|
||||||
T* head = matrix->operator T*();
|
T* head = matrix->operator T*();
|
||||||
for (unsigned int i = 0; i < 16; ++i)
|
for (unsigned int i = 0; i < 16; ++i)
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ namespace Nz
|
||||||
typedef OrientedBox<double> OrientedBoxd;
|
typedef OrientedBox<double> OrientedBoxd;
|
||||||
typedef OrientedBox<float> OrientedBoxf;
|
typedef OrientedBox<float> OrientedBoxf;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const OrientedBox<T>& obb);
|
template<typename T> bool Serialize(SerializationContext& context, const OrientedBox<T>& obb, TypeTag<OrientedBox<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, OrientedBox<T>* obb);
|
template<typename T> bool Unserialize(SerializationContext& context, OrientedBox<T>* obb, TypeTag<OrientedBox<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ namespace Nz
|
||||||
* \remark Does not save OBB corners
|
* \remark Does not save OBB corners
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const OrientedBox<T>& obb)
|
bool Serialize(SerializationContext& context, const OrientedBox<T>& obb, TypeTag<OrientedBox<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, obb.localBox))
|
if (!Serialize(context, obb.localBox))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -460,7 +460,7 @@ namespace Nz
|
||||||
* \remark The resulting oriented box corners will *not* be updated, a call to Update is required
|
* \remark The resulting oriented box corners will *not* be updated, a call to Update is required
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, OrientedBox<T>* obb)
|
bool Unserialize(SerializationContext& context, OrientedBox<T>* obb, TypeTag<OrientedBox<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &obb->localBox))
|
if (!Unserialize(context, &obb->localBox))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@ namespace Nz
|
||||||
typedef Plane<double> Planed;
|
typedef Plane<double> Planed;
|
||||||
typedef Plane<float> Planef;
|
typedef Plane<float> Planef;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Plane<T>& plane);
|
template<typename T> bool Serialize(SerializationContext& context, const Plane<T>& plane, TypeTag<Plane<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Plane<T>* plane);
|
template<typename T> bool Unserialize(SerializationContext& context, Plane<T>* plane, TypeTag<Plane<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -434,7 +434,7 @@ namespace Nz
|
||||||
* \param plane Input Vector2
|
* \param plane Input Vector2
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Plane<T>& plane)
|
bool Serialize(SerializationContext& context, const Plane<T>& plane, TypeTag<Plane<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, plane.normal))
|
if (!Serialize(context, plane.normal))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -453,7 +453,7 @@ namespace Nz
|
||||||
* \param plane Output Plane
|
* \param plane Output Plane
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Plane<T>* plane)
|
bool Unserialize(SerializationContext& context, Plane<T>* plane, TypeTag<Plane<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &plane->normal))
|
if (!Unserialize(context, &plane->normal))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,8 @@ namespace Nz
|
||||||
typedef Quaternion<double> Quaterniond;
|
typedef Quaternion<double> Quaterniond;
|
||||||
typedef Quaternion<float> Quaternionf;
|
typedef Quaternion<float> Quaternionf;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Quaternion<T>& quat);
|
template<typename T> bool Serialize(SerializationContext& context, const Quaternion<T>& quat, TypeTag<Quaternion<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Quaternion<T>* quat);
|
template<typename T> bool Unserialize(SerializationContext& context, Quaternion<T>* quat, TypeTag<Quaternion<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Quaternion<T>& quat);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Quaternion<T>& quat);
|
||||||
|
|
|
||||||
|
|
@ -826,7 +826,7 @@ namespace Nz
|
||||||
* \param quat Input Quaternion
|
* \param quat Input Quaternion
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Quaternion<T>& quat)
|
bool Serialize(SerializationContext& context, const Quaternion<T>& quat, TypeTag<Quaternion<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, quat.x))
|
if (!Serialize(context, quat.x))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -851,7 +851,7 @@ namespace Nz
|
||||||
* \param quat Output Quaternion
|
* \param quat Output Quaternion
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Quaternion<T>* quat)
|
bool Unserialize(SerializationContext& context, Quaternion<T>* quat, TypeTag<Quaternion<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &quat->x))
|
if (!Unserialize(context, &quat->x))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,8 @@ namespace Nz
|
||||||
typedef Ray<double> Rayd;
|
typedef Ray<double> Rayd;
|
||||||
typedef Ray<float> Rayf;
|
typedef Ray<float> Rayf;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Ray<T>& ray);
|
template<typename T> bool Serialize(SerializationContext& context, const Ray<T>& ray, TypeTag<Ray<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Ray<T>* ray);
|
template<typename T> bool Unserialize(SerializationContext& context, Ray<T>* ray, TypeTag<Ray<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Ray<T>& vec);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Ray<T>& vec);
|
||||||
|
|
|
||||||
|
|
@ -772,7 +772,7 @@ namespace Nz
|
||||||
* \param ray Input Ray
|
* \param ray Input Ray
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Ray<T>& ray)
|
bool Serialize(SerializationContext& context, const Ray<T>& ray, TypeTag<Ray<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, ray.origin))
|
if (!Serialize(context, ray.origin))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -791,7 +791,7 @@ namespace Nz
|
||||||
* \param ray Output Ray
|
* \param ray Output Ray
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Ray<T>* ray)
|
bool Unserialize(SerializationContext& context, Ray<T>* ray, TypeTag<Ray<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &ray->origin))
|
if (!Unserialize(context, &ray->origin))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,8 @@ namespace Nz
|
||||||
typedef Rect<Int32> Recti32;
|
typedef Rect<Int32> Recti32;
|
||||||
typedef Rect<UInt32> Rectui32;
|
typedef Rect<UInt32> Rectui32;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Rect<T>& rect);
|
template<typename T> bool Serialize(SerializationContext& context, const Rect<T>& rect, TypeTag<Rect<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Rect<T>* rect);
|
template<typename T> bool Unserialize(SerializationContext& context, Rect<T>* rect, TypeTag<Rect<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -808,7 +808,7 @@ namespace Nz
|
||||||
* \param rect Input Rect
|
* \param rect Input Rect
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Rect<T>& rect)
|
bool Serialize(SerializationContext& context, const Rect<T>& rect, TypeTag<Rect<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, rect.x))
|
if (!Serialize(context, rect.x))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -833,7 +833,7 @@ namespace Nz
|
||||||
* \param rect Output Rect
|
* \param rect Output Rect
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Rect<T>* rect)
|
bool Unserialize(SerializationContext& context, Rect<T>* rect, TypeTag<Rect<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &rect->x))
|
if (!Unserialize(context, &rect->x))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,8 @@ namespace Nz
|
||||||
typedef Sphere<double> Sphered;
|
typedef Sphere<double> Sphered;
|
||||||
typedef Sphere<float> Spheref;
|
typedef Sphere<float> Spheref;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Sphere<T>& sphere);
|
template<typename T> bool Serialize(SerializationContext& context, const Sphere<T>& sphere, TypeTag<Sphere<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Sphere<T>* sphere);
|
template<typename T> bool Unserialize(SerializationContext& context, Sphere<T>* sphere, TypeTag<Sphere<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -623,7 +623,7 @@ namespace Nz
|
||||||
* \param sphere Input Sphere
|
* \param sphere Input Sphere
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Sphere<T>& sphere)
|
bool Serialize(SerializationContext& context, const Sphere<T>& sphere, TypeTag<Sphere<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, sphere.x))
|
if (!Serialize(context, sphere.x))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -648,7 +648,7 @@ namespace Nz
|
||||||
* \param sphere Output Sphere
|
* \param sphere Output Sphere
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Sphere<T>* sphere)
|
bool Unserialize(SerializationContext& context, Sphere<T>* sphere, TypeTag<Sphere<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &sphere->x))
|
if (!Unserialize(context, &sphere->x))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -103,15 +103,15 @@ namespace Nz
|
||||||
T x, y;
|
T x, y;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef Vector2<double> Vector2d;
|
|
||||||
typedef Vector2<float> Vector2f;
|
|
||||||
typedef Vector2<int> Vector2i;
|
|
||||||
typedef Vector2<unsigned int> Vector2ui;
|
|
||||||
typedef Vector2<Int32> Vector2i32;
|
|
||||||
typedef Vector2<UInt32> Vector2ui32;
|
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Vector2<T>& vector);
|
template<typename T> bool Serialize(SerializationContext& context, const Vector2<T>& vector);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Vector2<T>* vector);
|
template<typename T> bool Unserialize(SerializationContext& context, Vector2<T>* vector);
|
||||||
|
using Vector2d = Vector2<double>;
|
||||||
|
using Vector2f = Vector2<float>;
|
||||||
|
using Vector2i = Vector2<int>;
|
||||||
|
using Vector2ui = Vector2<unsigned int>;
|
||||||
|
using Vector2i32 = Vector2<Int32>;
|
||||||
|
using Vector2ui32 = Vector2<UInt32>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector2<T>& vec);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector2<T>& vec);
|
||||||
|
|
|
||||||
|
|
@ -961,7 +961,7 @@ namespace Nz
|
||||||
* \param vector Input Vector2
|
* \param vector Input Vector2
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Vector2<T>& vector)
|
bool Serialize(SerializationContext& context, const Vector2<T>& vector, TypeTag<Vector2<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, vector.x))
|
if (!Serialize(context, vector.x))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -980,7 +980,7 @@ namespace Nz
|
||||||
* \param vector Output Vector2
|
* \param vector Output Vector2
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Vector2<T>* vector)
|
bool Unserialize(SerializationContext& context, Vector2<T>* vector, TypeTag<Vector2<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &vector->x))
|
if (!Unserialize(context, &vector->x))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -132,8 +132,8 @@ namespace Nz
|
||||||
typedef Vector3<Int32> Vector3i32;
|
typedef Vector3<Int32> Vector3i32;
|
||||||
typedef Vector3<UInt32> Vector3ui32;
|
typedef Vector3<UInt32> Vector3ui32;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Vector3<T>& vector);
|
template<typename T> bool Serialize(SerializationContext& context, const Vector3<T>& vector, TypeTag<Vector3<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Vector3<T>* vector);
|
template<typename T> bool Unserialize(SerializationContext& context, Vector3<T>* vector, TypeTag<Vector3<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector3<T>& vec);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector3<T>& vec);
|
||||||
|
|
|
||||||
|
|
@ -1248,7 +1248,7 @@ namespace Nz
|
||||||
* \param vector Input Vector3
|
* \param vector Input Vector3
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Vector3<T>& vector)
|
bool Serialize(SerializationContext& context, const Vector3<T>& vector, TypeTag<Vector3<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, vector.x))
|
if (!Serialize(context, vector.x))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1270,7 +1270,7 @@ namespace Nz
|
||||||
* \param vector Output Vector3
|
* \param vector Output Vector3
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Vector3<T>* vector)
|
bool Unserialize(SerializationContext& context, Vector3<T>* vector, TypeTag<Vector3<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &vector->x))
|
if (!Unserialize(context, &vector->x))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -108,8 +108,8 @@ namespace Nz
|
||||||
typedef Vector4<Int32> Vector4i32;
|
typedef Vector4<Int32> Vector4i32;
|
||||||
typedef Vector4<UInt32> Vector4ui32;
|
typedef Vector4<UInt32> Vector4ui32;
|
||||||
|
|
||||||
template<typename T> bool Serialize(SerializationContext& context, const Vector4<T>& vector);
|
template<typename T> bool Serialize(SerializationContext& context, const Vector4<T>& vector, TypeTag<Vector4<T>>);
|
||||||
template<typename T> bool Unserialize(SerializationContext& context, Vector4<T>* vector);
|
template<typename T> bool Unserialize(SerializationContext& context, Vector4<T>* vector, TypeTag<Vector4<T>>);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector4<T>& vec);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector4<T>& vec);
|
||||||
|
|
|
||||||
|
|
@ -1011,7 +1011,7 @@ namespace Nz
|
||||||
* \param vector Input Vector3
|
* \param vector Input Vector3
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Serialize(SerializationContext& context, const Vector4<T>& vector)
|
bool Serialize(SerializationContext& context, const Vector4<T>& vector, TypeTag<Vector4<T>>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, vector.x))
|
if (!Serialize(context, vector.x))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1036,7 +1036,7 @@ namespace Nz
|
||||||
* \param vector Output Vector3
|
* \param vector Output Vector3
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Unserialize(SerializationContext& context, Vector4<T>* vector)
|
bool Unserialize(SerializationContext& context, Vector4<T>* vector, TypeTag<Vector4<T>>)
|
||||||
{
|
{
|
||||||
if (!Unserialize(context, &vector->x))
|
if (!Unserialize(context, &vector->x))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace Nz
|
||||||
ResetBitPosition();
|
ResetBitPosition();
|
||||||
|
|
||||||
// Serialize will reset the bit position
|
// Serialize will reset the bit position
|
||||||
if (!Serialize<UInt8>(*this, currentByte))
|
if (!Serialize(*this, currentByte))
|
||||||
NazaraWarning("Failed to flush bits");
|
NazaraWarning("Failed to flush bits");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5932,7 +5932,7 @@ namespace Nz
|
||||||
* \param context Context of serialization
|
* \param context Context of serialization
|
||||||
* \param string String to serialize
|
* \param string String to serialize
|
||||||
*/
|
*/
|
||||||
bool Serialize(SerializationContext& context, const String& string)
|
bool Serialize(SerializationContext& context, const String& string, TypeTag<String>)
|
||||||
{
|
{
|
||||||
if (!Serialize(context, UInt32(string.GetSize())))
|
if (!Serialize(context, UInt32(string.GetSize())))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -5947,7 +5947,7 @@ namespace Nz
|
||||||
* \param context Context of unserialization
|
* \param context Context of unserialization
|
||||||
* \param string String to unserialize
|
* \param string String to unserialize
|
||||||
*/
|
*/
|
||||||
bool Unserialize(SerializationContext& context, String* string)
|
bool Unserialize(SerializationContext& context, String* string, TypeTag<String>)
|
||||||
{
|
{
|
||||||
UInt32 size;
|
UInt32 size;
|
||||||
if (!Unserialize(context, &size))
|
if (!Unserialize(context, &size))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue