/*! * @file new_resource_manager.h */ #ifndef _NEW_RESOURCE_MANAGER_H #define _NEW_RESOURCE_MANAGER_H #include "resource.h" #include "filesys/file.h" #include "filesys/directory.h" class NewResourceManager : public BaseObject { ObjectListDeclaration(NewResourceManager); public: /** @returns a Pointer to the only object of this Class */ inline static NewResourceManager* getInstance() { if (!_singletonRef) _singletonRef = new NewResourceManager(); return _singletonRef; }; inline static void deleteInstance() { if (_singletonRef) delete _singletonRef; }; void setMainGlobalPath(const Directory& directory); void addGlobalPath(const Directory& directory); bool addResourcePath(const std::string& resourceName, const std::string& pathName); bool addResourceSubPath(const std::string& resourceName, const std::string& pathName); void registerType(Resources::Type* type); void unregisterType(Resources::Type* type); unsigned int addKeepLevelName(const std::string& keepLevelName); unsigned int getKeepLevelID(const std::string& keepLevelName) const; const std::string& getKeepLevelName(unsigned int keepLevelID) const; const std::vector resourceTypes() const { return _resourceTypes; }; const Directory& mainGlobalPath() const { return _mainGlobalPath; }; /** @returns all global paths without mainGlobalPath */ const std::vector& globalPaths() const { return _globalPaths; }; bool checkFileInMainPath(const File& fileInside); bool unloadAllByPriority(); void debug() const; // utility functions for handling files in and around the data-directory static std::string getFullName(const std::string& fileName); static bool isInDataDir(const std::string& fileName); private: NewResourceManager(); virtual ~NewResourceManager(); private: static NewResourceManager* _singletonRef; //!< singleton Reference std::vector _resourceTypes; //! GLOBALS Directory _mainGlobalPath; std::vector _globalPaths; std::vector _keepLevelNames; }; #endif /* _RESOURCE_MANAGER_H */