Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/util/loading/new_resource_manager.h @ 9791

Last change on this file since 9791 was 9791, checked in by bensch, 18 years ago

orxonox/new_class_id: resourceManager splitted away

File size: 1.7 KB
Line 
1/*!
2 * @file new_resource_manager.h
3 */
4
5#ifndef _NEW_RESOURCE_MANAGER_H
6#define _NEW_RESOURCE_MANAGER_H
7
8#include "resource.h"
9#include "filesys/file.h"
10#include "filesys/directory.h"
11
12class NewResourceManager : public BaseObject
13{
14//  ObjectListDeclaration(NewResourceManager);
15public:
16  virtual ~NewResourceManager();
17  /** @returns a Pointer to the only object of this Class */
18  inline static NewResourceManager* getInstance() { if (!_singletonRef) _singletonRef = new NewResourceManager();  return _singletonRef; };
19
20
21  void setMainGlobalPath(const Directory& directory);
22  void addGlobalPath(const Directory& directory);
23
24  bool addResourcePath(const std::string& resourceName, const std::string& pathName);
25  bool addResourceSubPath(const std::string& resourceName, const std::string& pathName);
26  void registerType(Resources::Type* type);
27
28
29  const std::vector<Resources::Type*> resourceTypes() const { return _resourceTypes; };
30  const Directory& mainGlobalPath() const { return _mainGlobalPath; };
31  /** @returns all global paths without mainGlobalPath */
32  const std::vector<Directory>& globalPaths() const { return _globalPaths; };
33
34
35  bool verifyDataDir(const std::string& fileInside);
36
37  bool unloadAllByPriority();
38
39  void debug() const;
40
41  // utility functions for handling files in and around the data-directory
42  static std::string getFullName(const std::string& fileName);
43  static bool isInDataDir(const std::string& fileName);
44private:
45  NewResourceManager();
46
47private:
48  static NewResourceManager*       _singletonRef;       //!< singleton Reference
49
50  std::vector<Resources::Type*>    _resourceTypes;
51  //! GLOBALS
52  Directory                        _mainGlobalPath;
53  std::vector<Directory>           _globalPaths;
54
55
56};
57
58#endif /* _RESOURCE_MANAGER_H */
Note: See TracBrowser for help on using the repository browser.