Core: Rename MemoryStream to MemoryView, add MemoryStream

Former-commit-id: c180d5f34fa7c477f35c4b70ebf7b64e3f35fe3d
This commit is contained in:
Lynix
2015-11-17 14:06:57 +01:00
parent a1bb104255
commit ddc343a630
13 changed files with 153 additions and 41 deletions

View File

@@ -0,0 +1,42 @@
// 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
#pragma once
#ifndef NAZARA_MEMORYVIEW_HPP
#define NAZARA_MEMORYVIEW_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/InputStream.hpp>
namespace Nz
{
class NAZARA_CORE_API MemoryView : public InputStream
{
public:
MemoryView(const void* ptr, UInt64 size);
MemoryView(const MemoryView&) = delete;
MemoryView(MemoryView&&) = delete; ///TODO
~MemoryView() = default;
bool EndOfStream() const override;
UInt64 GetCursorPos() const override;
UInt64 GetSize() const override;
std::size_t Read(void* buffer, std::size_t size) override;
bool SetCursorPos(UInt64 offset) override;
MemoryView& operator=(const MemoryView&) = delete;
MemoryView& operator=(MemoryView&&) = delete; ///TODO
private:
const UInt8* m_ptr;
UInt64 m_pos;
UInt64 m_size;
};
}
#endif // NAZARA_MEMORYVIEW_HPP