/*! * @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: virtual ~NewResourceManager(); /** @returns a Pointer to the only object of this Class */ inline static NewResourceManager* getInstance() { if (!_singletonRef) _singletonRef = new NewResourceManager(); return _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); 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 verifyDataDir(const std::string& 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(); private: static NewResourceManager* _singletonRef; //!< singleton Reference std::vector _resourceTypes; //! GLOBALS Directory _mainGlobalPath; std::vector _globalPaths; }; #endif /* _RESOURCE_MANAGER_H */