Core: Rename MemoryStream to MemoryView, add MemoryStream
Former-commit-id: c180d5f34fa7c477f35c4b70ebf7b64e3f35fe3d
This commit is contained in:
42
include/Nazara/Core/MemoryView.hpp
Normal file
42
include/Nazara/Core/MemoryView.hpp
Normal 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
|
||||
Reference in New Issue
Block a user