summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-utils/filesystem/data_buffer.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-20 22:43:25 +0800
committerchai <chaifix@163.com>2019-03-20 22:43:25 +0800
commit82956beb1fe17e1226327638c8ab22b5f5adfc1d (patch)
treeb47464697174d5f9db4c8c9ab4a25cc384927d97 /source/libs/asura-lib-utils/filesystem/data_buffer.h
parent1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 (diff)
*misc
Diffstat (limited to 'source/libs/asura-lib-utils/filesystem/data_buffer.h')
-rw-r--r--source/libs/asura-lib-utils/filesystem/data_buffer.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/source/libs/asura-lib-utils/filesystem/data_buffer.h b/source/libs/asura-lib-utils/filesystem/data_buffer.h
index 4b013ed..5c80efb 100644
--- a/source/libs/asura-lib-utils/filesystem/data_buffer.h
+++ b/source/libs/asura-lib-utils/filesystem/data_buffer.h
@@ -3,7 +3,6 @@
#include <cstdlib>
-#include "../scripting/Luax.hpp"
#include "../scripting/portable.hpp"
namespace AsuraEngine
@@ -19,23 +18,34 @@ namespace AsuraEngine
{
public:
- DataBuffer(const void* data, std::size_t size);
-
+ DataBuffer(DataBuffer& src);
+ DataBuffer(std::size_t size);
+ DataBuffer(const void* bytes, std::size_t size);
~DataBuffer();
- void SetContent(const void* data, std::size_t siez);
+ byte* GetBuffer();
+ size_t GetSize();
+
+ void Load(DataBuffer& db);
+ void Load(const void* bytes, std::size_t size);
+ void Clear();
- const byte* data;
- size_t size;
+ private:
- //----------------------------------------------------------------------------------------------------------
+ byte* mBytes;
+ size_t mSize;
+
+ //------------------------------------------------------------------------------------------------------------
+
+ public:
LUAX_DECL_FACTORY(DataBuffer);
LUAX_DECL_METHOD(_New);
- LUAX_DECL_METHOD(_SetContent);
- LUAX_DECL_METHOD(_GetContent);
- LUAX_DECL_METHOD(_GetContentLength);
+ LUAX_DECL_METHOD(_GetBuffer);
+ LUAX_DECL_METHOD(_GetSize);
+ LUAX_DECL_METHOD(_Load);
+ LUAX_DECL_METHOD(_Clear);
};