1 /*
2  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3  * Distributed under the MIT License
4  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5  */
6 
7 #ifndef MYGUI_DATA_MANAGER_H_
8 #define MYGUI_DATA_MANAGER_H_
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_Singleton.h"
12 #include "MyGUI_IDataStream.h"
13 #include "MyGUI_Types.h"
14 
15 namespace MyGUI
16 {
17 
18 	class MYGUI_EXPORT DataManager :
19 		public Singleton<DataManager>
20 	{
21 	public:
22 
23 		/** Get data stream from specified resource name.
24 			@param _name Resource name (usually file name).
25 		*/
26 		virtual IDataStream* getData(const std::string& _name) = 0;
27 
28 		/** Free data stream.
29 			@param _data Data stream.
30 		*/
31 		virtual void freeData(IDataStream* _data) = 0;
32 
33 		/** Is data with specified name exist.
34 			@param _name Resource name.
35 		*/
36 		virtual bool isDataExist(const std::string& _name) = 0;
37 
38 		/** Get all data names with names that matches pattern.
39 			@param _pattern Pattern to match (for example "*.layout").
40 		*/
41 		virtual const VectorString& getDataListNames(const std::string& _pattern) = 0;
42 
43 		/** Get full path to data.
44 			@param _name Resource name.
45 			@return Return full path to specified data.
46 			For example getDataPath("My.layout") might return "C:\path\to\project\data\My.layout"
47 		*/
48 		virtual const std::string& getDataPath(const std::string& _name) = 0;
49 	};
50 
51 } // namespace MyGUI
52 
53 #endif // MYGUI_DATA_MANAGER_H_
54