From bad78945ceba425f6a80e3b8dca2414d592970eb Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 2 Aug 2019 20:51:00 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E5=90=8D=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/modules/asura-utils/io/io_task.cpp | 61 ------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 source/modules/asura-utils/io/io_task.cpp (limited to 'source/modules/asura-utils/io/io_task.cpp') diff --git a/source/modules/asura-utils/io/io_task.cpp b/source/modules/asura-utils/io/io_task.cpp deleted file mode 100644 index 6c323de..0000000 --- a/source/modules/asura-utils/io/io_task.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "file_system.h" -#include "io_task.h" - -#include - -using namespace AEScripting; -using namespace Luax; - -namespace AsuraEngine -{ - namespace IO - { - - IOTask::IOTask(const std::string& path, DataBuffer* buffer, IOTaskType type) - : m_Path(path) - , m_Buffer(buffer) - { - if (buffer) - buffer->Retain(); - } - - IOTask::~IOTask() - { - if (m_Buffer) - m_Buffer->Release(); - } - - bool IOTask::Execute() - { - File file(m_Path); - if (m_Type == IOTASK_TYPE_WRITE) - { - - } - // 从path读取内容保存在mBuffer中 - else if (m_Type == IOTASK_TYPE_READ) - { - if (!m_Buffer) - return false; - file.Open(File::FILE_MODE_READ); - file.ReadAll(m_Buffer); - file.Close(); - } - return true; - } - - void IOTask::Invoke(lua_State* invokeThreaad) - { - if (m_Callback) - { - LuaxScopedState state(invokeThreaad); - if (this->PushLuaxMemberRef(state, m_Callback)) - { - this->PushLuaxMemberRef(state, m_BufferRef); - state.Call(1, 0); - } - } - } - - } -} -- cgit v1.1-26-g67d0