summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-utils/filesystem/data_buffer.h
blob: 4b013ede6f289c06cc24829912bb0b25a4f8477b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __ASURA_ENGINE_DATABUFFER_H__
#define __ASURA_ENGINE_DATABUFFER_H__

#include <cstdlib>

#include "../scripting/Luax.hpp"
#include "../scripting/portable.hpp"

namespace AsuraEngine
{
	namespace Filesystem
	{

		///
		/// ڴݵķװеʹData bufferװֱʹconst void*ͨresource managerȡ
		///
		class DataBuffer ASURA_FINAL
			: public Scripting::Portable<DataBuffer>
		{
		public:

			DataBuffer(const void* data, std::size_t size);

			~DataBuffer();

			void SetContent(const void* data, std::size_t siez);
			
			const byte* data;
			size_t size;

			//----------------------------------------------------------------------------------------------------------

			LUAX_DECL_FACTORY(DataBuffer);

			LUAX_DECL_METHOD(_New);
			LUAX_DECL_METHOD(_SetContent);
			LUAX_DECL_METHOD(_GetContent);
			LUAX_DECL_METHOD(_GetContentLength);

		};

	}
}

#endif