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/resource_manager.h | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 source/libs/asura-lib-utils/filesystem/resource_manager.h (limited to 'source/libs/asura-lib-utils/filesystem/resource_manager.h') diff --git a/source/libs/asura-lib-utils/filesystem/resource_manager.h b/source/libs/asura-lib-utils/filesystem/resource_manager.h new file mode 100644 index 0000000..c5d8f06 --- /dev/null +++ b/source/libs/asura-lib-utils/filesystem/resource_manager.h @@ -0,0 +1,44 @@ +#ifndef __ASURA_ENGINE_RESOURCE_MANAGER_H__ +#define __ASURA_ENGINE_RESOURCE_MANAGER_H__ + +#include + +#include "../scripting/portable.hpp" +#include "data_buffer.h" + +namespace AsuraEngine +{ + namespace Filesystem + { + + /// + /// 资源管理,负责加载、存储资源,指定根目录等。 + /// + class ResourceManager ASURA_FINAL + { + public: + + ResourceManager(); + ~ResourceManager(); + + /// + /// 装载根目录 + /// + void Mount(const std::string& root); + + /// + /// 读取文件并返回一个data buffer,注意如果要确保正确回收内存,在调用处使用unique_ptr + /// + DataBuffer* LoadFile(const std::string& path); + + /// + /// 保存data buffer里的数据 + /// + void SaveFile(const std::string& path, const DataBuffer* buffer); + + }; + + } +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0