From 35b27bbe676534a62d85c392d52dc4b025d2e6f6 Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 19 Nov 2015 14:03:26 +0100 Subject: [PATCH] Core/MemoryStream: Add hash overload for MemoryStream Former-commit-id: ab618e0db87bd85994a3b11a29c7f38e28d8aae3 --- include/Nazara/Core/MemoryStream.hpp | 8 ++++++++ include/Nazara/Core/MemoryStream.inl | 15 +++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 include/Nazara/Core/MemoryStream.inl diff --git a/include/Nazara/Core/MemoryStream.hpp b/include/Nazara/Core/MemoryStream.hpp index 465abf745..861d28d40 100644 --- a/include/Nazara/Core/MemoryStream.hpp +++ b/include/Nazara/Core/MemoryStream.hpp @@ -47,6 +47,14 @@ namespace Nz ByteArray m_buffer; UInt64 m_pos; }; + + class AbstractHash; + + inline bool HashAppend(AbstractHash* hash, const String& string); + NAZARA_CORE_API bool Serialize(SerializationContext& context, const String& string); + NAZARA_CORE_API bool Unserialize(UnserializationContext& context, String* string); } +#include + #endif // NAZARA_MEMORYSTREAM_HPP diff --git a/include/Nazara/Core/MemoryStream.inl b/include/Nazara/Core/MemoryStream.inl new file mode 100644 index 000000000..61b2f0bb4 --- /dev/null +++ b/include/Nazara/Core/MemoryStream.inl @@ -0,0 +1,15 @@ +// Copyright (C) 2015 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 + +#include + +namespace Nz +{ + inline bool HashAppend(AbstractHash* hash, const MemoryStream& stream) + { + return HashAppend(hash, stream.GetBuffer()); + } +} + +#include