summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-utils/filesystem/resource_manager.h
blob: 36d46cfc427c902fc8e3bbd6f770a87cc904d7ac (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
46
47
48
#ifndef __ASURA_ENGINE_RESOURCE_MANAGER_H__
#define __ASURA_ENGINE_RESOURCE_MANAGER_H__

#include <string>

#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);

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

			LUAX_DECL_SINGLETON(ResourceManager);

		};

	}
}

#endif