Core: Add OwnedMemoryStream class
This commit is contained in:
33
include/Nazara/Core/OwnedMemoryStream.inl
Normal file
33
include/Nazara/Core/OwnedMemoryStream.inl
Normal file
@@ -0,0 +1,33 @@
|
||||
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Core module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/OwnedMemoryStream.hpp>
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
* \brief Constructs an OwnedMemoryStream object
|
||||
*
|
||||
* \param openMode Reading/writing mode for the stream
|
||||
*/
|
||||
inline OwnedMemoryStream::OwnedMemoryStream(OpenModeFlags openMode)
|
||||
{
|
||||
SetBuffer(&m_ownedByteArray, openMode);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Constructs an OwnedMemoryStream object
|
||||
*
|
||||
* \param byteArray Content
|
||||
* \param openMode Reading/writing mode for the stream
|
||||
*/
|
||||
inline OwnedMemoryStream::OwnedMemoryStream(ByteArray byteArray, OpenModeFlags openMode) :
|
||||
m_ownedByteArray(std::move(byteArray))
|
||||
{
|
||||
SetBuffer(&m_ownedByteArray, openMode);
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Core/DebugOff.hpp>
|
||||
Reference in New Issue
Block a user