iFun Engine API  1.0.0-b6053
Great Technology for Great Games
resource_manager.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2020 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 
9 #ifndef INCLUDE_FUNAPI_SYSTEM_RESOURCE_MANAGER_H_
10 #define INCLUDE_FUNAPI_SYSTEM_RESOURCE_MANAGER_H_
11 
12 #include <boost/unordered_map.hpp>
13 #include <funapi/common/json.h>
15 #include <funapi/types.h>
16 
17 namespace fun {
18 
19 FUNAPI_DLL_VISIBILITY const string &GetResRoot();
20 
21 
23 typedef boost::unordered_map<int, Ptr<const Json> > IndexedJsonData;
24 
25 
26 class FUNAPI_DLL_VISIBILITY ResourceManager : public Component {
27  public:
29  static void Reload();
30 
33  static void Reload(const string &filename);
34 
36  //
39  static Ptr<const Json> GetJsonData(const string &filename);
40 
45  static Ptr<const IndexedJsonData> IndexJsonArray(const Json &array,
46  const string &fieldname);
47 
48 
49  // Invoked by Funapi framework.
50  static bool Install(const ArgumentMap &arguments);
51  static bool Uninstall();
52 };
53 
54 } // namespace fun
55 
56 #endif // INCLUDE_FUNAPI_SYSTEM_RESOURCE_MANAGER_H_
ArgumentMap class manages application-specific run-time arguments.
Definition: argument_map.h:23
boost::unordered_map< int, Ptr< const Json > > IndexedJsonData
Indexed JSON data.
Definition: resource_manager.h:23
Base class for any service in Funapi.
Definition: component.h:20
Definition: resource_manager.h:26
Definition: json.h:18
Definition: json.h:27