diff options
Diffstat (limited to 'source/modules/asura-utils/io')
20 files changed, 16 insertions, 886 deletions
diff --git a/source/modules/asura-utils/io/binding/_data_buffer.cpp b/source/modules/asura-utils/io/binding/_data_buffer.cpp index ac240e5..9d3f3a0 100644 --- a/source/modules/asura-utils/io/binding/_data_buffer.cpp +++ b/source/modules/asura-utils/io/binding/_data_buffer.cpp @@ -1,4 +1,4 @@ -#include "../data_buffer.h" +#include "../DataBuffer.h" using namespace Luax; diff --git a/source/modules/asura-utils/io/binding/_file_data.cpp b/source/modules/asura-utils/io/binding/_file_data.cpp index f4f6584..55cbc8b 100644 --- a/source/modules/asura-utils/io/binding/_file_data.cpp +++ b/source/modules/asura-utils/io/binding/_file_data.cpp @@ -1,4 +1,4 @@ -#include "../file_data.h" +#include "../FileData.h" using namespace std; diff --git a/source/modules/asura-utils/io/binding/_file_system.cpp b/source/modules/asura-utils/io/binding/_file_system.cpp index 0dc24d0..ace3c5f 100644 --- a/source/modules/asura-utils/io/binding/_file_system.cpp +++ b/source/modules/asura-utils/io/binding/_file_system.cpp @@ -1,4 +1,4 @@ -#include "../file_system.h" +#include "../FileSystem.h" using namespace Luax; diff --git a/source/modules/asura-utils/io/binding/_io_task.cpp b/source/modules/asura-utils/io/binding/_io_task.cpp index 4da8dc3..058f4fd 100644 --- a/source/modules/asura-utils/io/binding/_io_task.cpp +++ b/source/modules/asura-utils/io/binding/_io_task.cpp @@ -1,4 +1,4 @@ -#include "../io_task.h" +#include "../IOTask.h" using namespace std; diff --git a/source/modules/asura-utils/io/compressor.cpp b/source/modules/asura-utils/io/compressor.cpp index 095eff4..4202263 100644 --- a/source/modules/asura-utils/io/compressor.cpp +++ b/source/modules/asura-utils/io/compressor.cpp @@ -1,4 +1,4 @@ -#include "compressor.h" +#include "Compressor.h" namespace AsuraEngine { diff --git a/source/modules/asura-utils/io/compressor.h b/source/modules/asura-utils/io/compressor.h index 65fd88a..dc25e2a 100644 --- a/source/modules/asura-utils/io/compressor.h +++ b/source/modules/asura-utils/io/compressor.h @@ -1,7 +1,7 @@ -#ifndef __ASURA_COMPRESSOR_H__ -#define __ASURA_COMPRESSOR_H__ +#ifndef _ASURA_COMPRESSOR_H_ +#define _ASURA_COMPRESSOR_H_ -#include "../scripting/portable.hpp" +#include "../Scripting/Portable.hpp" namespace AsuraEngine { diff --git a/source/modules/asura-utils/io/data_buffer.cpp b/source/modules/asura-utils/io/data_buffer.cpp deleted file mode 100644 index 37f749c..0000000 --- a/source/modules/asura-utils/io/data_buffer.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include <cstdlib> -#include <cstring> -#include "data_buffer.h" - -using namespace AEThreading; - -namespace AsuraEngine -{ - namespace IO - { - - DataBuffer::DataBuffer(DataBuffer& src) - : m_Size(0) - , m_Capacity(0) - , m_Bytes(nullptr) - { - // ʼ - lock(m_Mutex) - { - m_Capacity = src.m_Size; - m_Bytes = new byte[m_Capacity]; - Clear(); - - Load(src); - } - } - - DataBuffer::DataBuffer(std::size_t capacity) - : m_Size(0) - , m_Capacity(0) - , m_Bytes(nullptr) - { - lock(m_Mutex) - { - m_Capacity = capacity; - m_Bytes = new byte[m_Capacity]; - Clear(); - } - } - - DataBuffer::DataBuffer(const void* data, std::size_t size) - : m_Capacity(0) - , m_Size(0) - , m_Bytes(nullptr) - { - lock(m_Mutex) - { - m_Capacity = size; - m_Bytes = new byte[m_Capacity]; - Clear(); - - Load(data, size); - } - } - - DataBuffer::~DataBuffer() - { - lock(m_Mutex) - { - delete[] m_Bytes; - } - } - - void DataBuffer::Refactor(size_t capacity) - { - lock(m_Mutex) - { - if (!m_Bytes || m_Capacity != capacity) - { - if(m_Bytes) - delete[] m_Bytes; - m_Capacity = capacity; - m_Bytes = new byte[m_Capacity]; - m_Size = 0; - } - Clear(); - } - } - - void DataBuffer::Load(DataBuffer& db) - { - lock(m_Mutex) - { - Load(db.GetData(), db.GetSize()); - } - } - - void DataBuffer::Load(const void* data, std::size_t size) - { - lock(m_Mutex) - { - ASSERT(m_Capacity >= size); - memcpy(m_Bytes, data, size); - m_Size = size; - } - } - - void DataBuffer::Move(void* bytes, std::size_t size) - { - lock(m_Mutex) - { - if (m_Bytes == bytes) - { - // sizeֵڶļʱ - m_Size = size; - } - else - { - if (m_Bytes) - delete[] m_Bytes; - m_Bytes = (byte*)bytes; - m_Size = size; - m_Capacity = size; - } - } - } - - byte* DataBuffer::GetData() - { - return m_Bytes; - } - - void DataBuffer::Clear() - { - lock(m_Mutex) - { - if (m_Bytes) - { - memset(m_Bytes, 0, m_Size); - m_Size = 0; - } - } - } - - std::size_t DataBuffer::GetSize() - { - return m_Size; - } - - std::size_t DataBuffer::GetCapacity() - { - return m_Capacity; - } - - void DataBuffer::Lock() - { - m_Mutex.Lock(); - } - - void DataBuffer::Unlock() - { - m_Mutex.Unlock(); - } - - } -}
\ No newline at end of file diff --git a/source/modules/asura-utils/io/data_buffer.h b/source/modules/asura-utils/io/data_buffer.h deleted file mode 100644 index 53ed603..0000000 --- a/source/modules/asura-utils/io/data_buffer.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ASURA_ENGINE_DATABUFFER_H__ -#define __ASURA_ENGINE_DATABUFFER_H__ - -#include <cstdlib> - -#include "../scripting/portable.hpp" -#include "../threading/mutex.h" - -namespace AsuraEngine -{ - namespace IO - { - - /// - /// ڴݵķװеʹData bufferװֱʹconst void*ͨresource managerȡ - /// - class DataBuffer ASURA_FINAL - : public AEScripting::Portable<DataBuffer> - { - public: - - LUAX_DECL_FACTORY(DataBuffer); - - DataBuffer(DataBuffer& src); - DataBuffer(std::size_t capacity); - DataBuffer(const void* bytes, std::size_t size); - ~DataBuffer(); - - byte* GetData(); - size_t GetSize(); - size_t GetCapacity(); - - /// - /// - /// - void Refactor(size_t capacity); - - /// - /// Դ˻ - /// - void Load(DataBuffer& db); - void Load(const void* bytes, std::size_t size); - - /// - /// bytesӵȨcapacityΪsize - /// - void Move(void* bytes, std::size_t size); - - /// - /// - /// - void Clear(); - - void Lock(); - void Unlock(); - - private: - - LUAX_DECL_METHOD(_New); - LUAX_DECL_METHOD(_GetData); - LUAX_DECL_METHOD(_GetSize); - LUAX_DECL_METHOD(_GetCapacity); - LUAX_DECL_METHOD(_Refactor); - LUAX_DECL_METHOD(_Load); - LUAX_DECL_METHOD(_Clear); - - /// - /// Bufferַݵij - /// - byte* m_Bytes; - size_t m_Size; - - /// - /// Buffer - /// - size_t m_Capacity; - - AEThreading::Mutex m_Mutex; - - }; - - } -} - -namespace AEIO = AsuraEngine::IO; - -#endif
\ No newline at end of file diff --git a/source/modules/asura-utils/io/decoded_data.h b/source/modules/asura-utils/io/decoded_data.h deleted file mode 100644 index 882556c..0000000 --- a/source/modules/asura-utils/io/decoded_data.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __ASURA_ENGINE_DATA_H__ -#define __ASURA_ENGINE_DATA_H__ - -#include <cstdlib> - -#include <asura-utils/threading/thread.h> - -#include "../scripting/portable.hpp" - -#include "data_buffer.h" - -namespace AsuraEngine -{ - namespace IO - { - - /// - /// һ̹߳data̳дࡣͼƬݡƵݵȣһ߳нԭ - /// ļڲݸʽصȡ - /// - ASURA_ABSTRACT class DecodedData - { - public: - - /// - /// ڴйdataԷһ߳棬Դϵͳء - /// - DecodedData() {}; - virtual ~DecodedData() {}; - - /// - /// ڴеݲijָʽ档 - /// - virtual void Decode(DataBuffer& buffer) = 0; - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/source/modules/asura-utils/io/file.cpp b/source/modules/asura-utils/io/file.cpp index a2f7403..6d5f4eb 100644 --- a/source/modules/asura-utils/io/file.cpp +++ b/source/modules/asura-utils/io/file.cpp @@ -1,8 +1,8 @@ #include <physfs/physfs.h> -#include <asura-utils/exceptions/exception.h> +#include <asura-utils/Exceptions/Exception.h> -#include "file.h" +#include "File.h" namespace AsuraEngine { diff --git a/source/modules/asura-utils/io/file.h b/source/modules/asura-utils/io/file.h index 16de42b..d11fa4f 100644 --- a/source/modules/asura-utils/io/file.h +++ b/source/modules/asura-utils/io/file.h @@ -1,12 +1,12 @@ -#ifndef __ASURA_ENGINE_FILE_H__ -#define __ASURA_ENGINE_FILE_H__ +#ifndef _ASURA_ENGINE_FILE_H_ +#define _ASURA_ENGINE_FILE_H_ #include "physfs/physfs.h" -#include "../scripting/portable.hpp" -#include "../threading/thread.h" +#include "../Scripting/Portable.hpp" +#include "../Threads/Thread.h" -#include "file_data.h" +#include "FileData.h" namespace AsuraEngine { diff --git a/source/modules/asura-utils/io/file_data.cpp b/source/modules/asura-utils/io/file_data.cpp deleted file mode 100644 index 30fa5bf..0000000 --- a/source/modules/asura-utils/io/file_data.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "file_data.h" - -namespace AsuraEngine -{ - namespace IO - { - - FileData::FileData(const std::string& filename) - : m_Data(nullptr) - , m_FileName(filename) - { - size_t dot = filename.rfind('.'); - if (dot != std::string::npos) - { - m_Extension = filename.substr(dot + 1); - m_Name = filename.substr(0, dot); - } - else - m_Name = filename; - } - - FileData::~FileData() - { - if (m_Data) - m_Data->Release(); - } - - const std::string& FileData::GetFileName() - { - return m_FileName; - } - - const std::string& FileData::GetExtension() - { - return m_Extension; - } - - const std::string& FileData::GetName() - { - return m_Name; - } - - void FileData::BindData(ASURA_MOVE DataBuffer* buffer) - { - if (!buffer) - return; - if (m_Data) - m_Data->Release(); - m_Data = buffer; - m_Data->Retain(); - } - - DataBuffer* FileData::GetDataBuffer() - { - return m_Data; - } - - } -}
\ No newline at end of file diff --git a/source/modules/asura-utils/io/file_data.h b/source/modules/asura-utils/io/file_data.h deleted file mode 100644 index ecc072b..0000000 --- a/source/modules/asura-utils/io/file_data.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __ASURA_ENGINE_FILE_DATA_H__ -#define __ASURA_ENGINE_FILE_DATA_H__ - -#include <string> - -#include <asura-utils/scripting/portable.hpp> - -#include "data_buffer.h" - -namespace AsuraEngine -{ - namespace IO - { - - class Filesystem; - - /// - /// filesystemֱӶȡļʱFileDataļݺϢFilesystem - /// - class FileData ASURA_FINAL - : public AEScripting::Portable<FileData> - { - public: - - LUAX_DECL_FACTORY(FileData); - - ~FileData(); - - /// - /// ļݣͨDatabufferݺʹСڲӿڶData bufferΪҲdata buffer - /// - DataBuffer* GetDataBuffer(); - - const std::string& GetFileName(); - const std::string& GetExtension(); - const std::string& GetName(); - - private: - - friend class Filesystem; - - FileData(const std::string& name); - - /// - /// data buffer - /// - void BindData(ASURA_MOVE DataBuffer* buffer); - - /// - /// Data bufferfiledataʱ٣luaüΪ0ʱluaGC١mDataʱһԱá - /// - ASURA_REF DataBuffer* m_Data; - Luax::LuaxMemberRef m_DataRef; - - std::string m_FileName; ///< չļ - std::string m_Extension; ///< չ - std::string m_Name; ///< ͺļ - - LUAX_DECL_METHOD(_GetDataBuffer); - LUAX_DECL_METHOD(_GetFileName); - LUAX_DECL_METHOD(_GetExtension); - LUAX_DECL_METHOD(_GetName); - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/source/modules/asura-utils/io/file_system.cpp b/source/modules/asura-utils/io/file_system.cpp deleted file mode 100644 index f68bad6..0000000 --- a/source/modules/asura-utils/io/file_system.cpp +++ /dev/null @@ -1,198 +0,0 @@ -#include <physfs/physfs.h> - -#include "../exceptions/exception.h" - -#include "file.h" -#include "file_data.h" -#include "file_system.h" - -using namespace std; - -namespace AsuraEngine -{ - namespace IO - { - -#ifdef ASURA_WINDOWS - #include <windows.h> - #include <direct.h> -#else - #include <sys/param.h> - #include <unistd.h> -#endif - - Filesystem::~Filesystem() - { - if (m_Inited) //PHYSFS_isInit - PHYSFS_deinit(); - } - - void Filesystem::Init(const char* arg0) - { - if (!PHYSFS_init(arg0)) - throw Exception("Failed to initialize filesystem: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); - - m_Inited = true; - } - - bool Filesystem::Mount(const std::string& locpath, const std::string& montpoint/* = "/"*/, bool prepend /*= false*/) - { - if (!m_Inited) - return false; - - return PHYSFS_mount(locpath.c_str(), montpoint.c_str(), !prepend); - } - - bool Filesystem::Mount(DataBuffer* db, const std::string& archivename, const std::string& mountpoint /*= "/"*/, bool prepend /*= false*/) - { - if (!m_Inited) - return false; - if (PHYSFS_mountMemory(db->GetData(), db->GetSize(), nullptr, archivename.c_str(), mountpoint.c_str(), !prepend)) - { - m_MountData[archivename] = db; - return true; - } - return false; - } - - bool Filesystem::Unmount(const std::string& locpath) - { - if (!m_Inited) - return false; - - // ǹ鵵ӳɾ - auto datait = m_MountData.find(locpath); - if (datait != m_MountData.end() && PHYSFS_unmount(locpath.c_str()) != 0) - { - m_MountData.erase(datait); - return true; - } - - return PHYSFS_unmount(locpath.c_str()); - } - - bool Filesystem::Unmount(DataBuffer* db) - { - for (const auto& dp : m_MountData) - { - if (dp.second == db) - { - std::string archive = dp.first; - return Unmount(archive); - } - } - } - - bool Filesystem::GetMountPoint(const std::string& locpath, ASURA_OUT std::string& mountpoint) - { - if (!m_Inited) - return false; - const char* point = PHYSFS_getMountPoint(locpath.c_str()); - if (point != nullptr) - { - mountpoint = point; - return true; - } - return false; - } - - void Filesystem::SetWriteDirectory(const std::string locpath) - { - if (!m_Inited) - return; - if (!PHYSFS_setWriteDir(locpath.c_str())) - throw Exception("Failed to set write directory %s", locpath.c_str()); - } - - std::string Filesystem::GetWriteDirectory() - { - return PHYSFS_getWriteDir(); - } - - File* Filesystem::NewFile(const std::string& name) - { - return new File(name); - } - - bool Filesystem::NewDirectory(const std::string& path) - { - if (!m_Inited) - return false; - if (!PHYSFS_getWriteDir()) - return false; - if (!PHYSFS_mkdir(path.c_str())) - return false; - return true; - } - - bool Filesystem::Write(const std::string& name, ASURA_REF DataBuffer* buffer) - { - File file(name); - file.Open(File::FILE_MODE_WRITE); - if (!file.Write(buffer)) - throw Exception("Data could not be written."); - } - - bool Filesystem::Append(const std::string& name, ASURA_REF DataBuffer* buffer) - { - File file(name); - file.Open(File::FILE_MODE_APPEND); - if (!file.Write(buffer)) - throw Exception("Data could not be append."); - } - - FileData* Filesystem::Read(const std::string& name) - { - File file = File(name); - file.Open(File::FILE_MODE_READ); - int size = file.GetSize(); - DataBuffer* db = new DataBuffer(size); - if (db) - { - file.ReadAll(db); - FileData* fd = new FileData(name); - fd->BindData(db); - return fd; - } - return nullptr; - } - - bool Filesystem::Remove(const std::string& path) - { - if (!m_Inited) - return false; - if (PHYSFS_getWriteDir() == 0) - return false; - - if (!PHYSFS_delete(path.c_str())) - return false; - - return true; - } - - bool Filesystem::GetFileInfo(const std::string& filepath, ASURA_OUT FileInfo* info) - { - if (!m_Inited) - return false; - - PHYSFS_Stat stat = {}; - if (!PHYSFS_stat(filepath.c_str(), &stat)) - return false; - - info->size = (int64)stat.filesize; - info->modtime = (int64)stat.modtime; - - if (stat.filetype == PHYSFS_FILETYPE_REGULAR) - info->type = FILE_TYPE_FILE; - else if (stat.filetype == PHYSFS_FILETYPE_DIRECTORY) - info->type = FILE_TYPE_DIRECTORY; - else if (stat.filetype == PHYSFS_FILETYPE_SYMLINK) - info->type = FILE_TYPE_SYMLINK; - else - info->type = FILE_TYPE_OTHER; - - return true; - } - - } -}
\ No newline at end of file diff --git a/source/modules/asura-utils/io/file_system.h b/source/modules/asura-utils/io/file_system.h deleted file mode 100644 index 9b4c4be..0000000 --- a/source/modules/asura-utils/io/file_system.h +++ /dev/null @@ -1,112 +0,0 @@ -#ifndef __ASURA_ENGINE_FILESYSTEM_H__ -#define __ASURA_ENGINE_FILESYSTEM_H__ - -#include <map> -#include <string> - -#include "../scripting/portable.hpp" -#include "../singleton.hpp" -#include "../type.h" - -#include "file_data.h" -#include "file.h" - -namespace AsuraEngine -{ - namespace IO - { - - enum FileType - { - FILE_TYPE_FILE, ///< ļ - FILE_TYPE_DIRECTORY, ///< ļ - FILE_TYPE_SYMLINK, ///< - FILE_TYPE_OTHER, ///< - }; - - struct FileInfo - { - int64 size; - int64 modtime; - FileType type; - }; - - /// - /// Դء洢ԴָĿ¼ȡ۱༭ʱҪƷʵĻƣûIJϷĿ¼ - /// £file systemµġFilesystemʱͱ༭õ࣬AssetDatabaseԴ࣬framework - /// ʵ֣дFilesystemʵ֣AssetDatabaseṩļݴӦԴķ - /// - class Filesystem ASURA_FINAL - : public Singleton<Filesystem> - , public AEScripting::Portable<Filesystem> - { - public: - - LUAX_DECL_SINGLETON(Filesystem); - - ~Filesystem(); - - void Init(const char* arg0); - - /// - /// ǰִļļ - /// - std::string GetWorkingDirectory(); - - bool Mount(const std::string& locpath, const std::string& montpoint = "/", bool prepend = false); - bool Mount(DataBuffer* db, const std::string& archivename, const std::string& mountpoint = "/", bool prepend = false); - - bool Unmount(const std::string& locpath); - bool Unmount(DataBuffer* db); - - bool GetMountPoint(const std::string& locpath, ASURA_OUT std::string& mountpoint); - - void SetWriteDirectory(const std::string locpath); - std::string GetWriteDirectory(); - File* NewFile(const std::string& name); - bool NewDirectory(const std::string& path); - bool Write(const std::string& path, ASURA_REF DataBuffer* buffer); - bool Append(const std::string& path, ASURA_REF DataBuffer* buffer); - bool Remove(const std::string& path); - - FileData* Read(const std::string& path); - bool GetFileInfo(const std::string& path, ASURA_OUT FileInfo* info); - - bool GetDirectoryItems(const std::string& path, ASURA_OUT std::vector<std::string>& items) { return false; }; - - private: - - typedef std::map<std::string, DataBuffer*> MountDataMap; - - bool m_Inited; ///< Ƿʼɹ - std::string m_Cwd; ///< ǰִļĹĿ¼ - MountDataMap m_MountData; ///< ·ѹĵӳ - - LUAX_DECL_METHOD(_Init); - LUAX_DECL_METHOD(_Mount); - LUAX_DECL_METHOD(_Unmount); - LUAX_DECL_METHOD(_GetMountPoint); - - LUAX_DECL_METHOD(_SetWriteDirectory); - LUAX_DECL_METHOD(_GetWriteDirectory); - LUAX_DECL_METHOD(_CreateFile); - LUAX_DECL_METHOD(_CreateDirectory); - - LUAX_DECL_METHOD(_Write); - LUAX_DECL_METHOD(_Append); - LUAX_DECL_METHOD(_Remove); - - LUAX_DECL_METHOD(_Read); - - LUAX_DECL_METHOD(_GetFileInfo); - - LUAX_DECL_METHOD(_GetDirectoryItems); - - }; - - } -} - -namespace AEIO = AsuraEngine::IO; - -#endif
\ No newline at end of file diff --git a/source/modules/asura-utils/io/io_batch_task.cpp b/source/modules/asura-utils/io/io_batch_task.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/modules/asura-utils/io/io_batch_task.cpp +++ /dev/null diff --git a/source/modules/asura-utils/io/io_batch_task.h b/source/modules/asura-utils/io/io_batch_task.h deleted file mode 100644 index 0a551e8..0000000 --- a/source/modules/asura-utils/io/io_batch_task.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __ASURA_IO_BATCH_TASK_H__ -#define __ASURA_IO_BATCH_TASK_H__ - -#include "io_task.h" - -namespace AsuraEngine -{ - namespace IO - { - - /// - /// дһύһtableδؽ - /// - class IOBatchTask ASURA_FINAL : public AEThreading::Task - { - public: - - private: - - /// - /// ÿһĽṹ£ - /// { path = "", } - /// - Luax::LuaxMemberRef m_Tasks; - - }; - - } -} - -#endif
\ No newline at end of file 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 <iostream> - -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); - } - } - } - - } -} diff --git a/source/modules/asura-utils/io/io_task.h b/source/modules/asura-utils/io/io_task.h deleted file mode 100644 index 8026a24..0000000 --- a/source/modules/asura-utils/io/io_task.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef __ASURA_IO_TASK_H__ -#define __ASURA_IO_TASK_H__ - -#include <string> - -#include "../scripting/portable.hpp" -#include "../threading/task.h" - -#include "data_buffer.h" - -namespace AsuraEngine -{ - namespace IO - { - - enum IOTaskType - { - IOTASK_TYPE_READ, - IOTASK_TYPE_WRITE, - IOTASK_TYPE_APPEND, - }; - - /// - /// ȡļ - /// - class IOTask ASURA_FINAL - : public AEScripting::Portable<IOTask, AEThreading::Task> - { - public: - - LUAX_DECL_FACTORY(IOTask); - - IOTask(const std::string& path, DataBuffer* buffer, IOTaskType type); - ~IOTask(); - - bool Execute() override ; - void Invoke(lua_State* invokeThreaad) override; - - private: - - LUAX_DECL_ENUM(IOTaskType); - - LUAX_DECL_METHOD(_New); - - std::string m_Path; - IOTaskType m_Type; - - DataBuffer* m_Buffer; - Luax::LuaxMemberRef m_BufferRef; - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/source/modules/asura-utils/io/renewable.h b/source/modules/asura-utils/io/renewable.h index fd6c638..90867f2 100644 --- a/source/modules/asura-utils/io/renewable.h +++ b/source/modules/asura-utils/io/renewable.h @@ -3,7 +3,7 @@ #include "../scripting/portable.hpp" -#include "decoded_data.h" +#include "DecodedData.h" namespace AsuraEngine { |