From 1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 19 Mar 2019 23:06:27 +0800 Subject: *rename --- .../asura-lib-utils/filesystem/data_buffer.cpp | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 source/libs/asura-lib-utils/filesystem/data_buffer.cpp (limited to 'source/libs/asura-lib-utils/filesystem/data_buffer.cpp') diff --git a/source/libs/asura-lib-utils/filesystem/data_buffer.cpp b/source/libs/asura-lib-utils/filesystem/data_buffer.cpp new file mode 100644 index 0000000..629dc92 --- /dev/null +++ b/source/libs/asura-lib-utils/filesystem/data_buffer.cpp @@ -0,0 +1,29 @@ +#include "data_buffer.h" + +namespace AsuraEngine +{ + namespace Filesystem + { + + DataBuffer::DataBuffer(const void* data, std::size_t size) + { + this->data = (const byte*)data; + this->size = size; + } + + DataBuffer::~DataBuffer() + { + delete[] data; + } + + void DataBuffer::SetContent(const void* data, std::size_t siez) + { + if (this->data != nullptr) + delete[] this->data; + + this->data = (const byte*)data; + this->size = size; + } + + } +} \ No newline at end of file -- cgit v1.1-26-g67d0