Changeset 9790 in orxonox.OLD for branches/new_class_id/src/lib/util/loading/resource.h
- Timestamp:
- Sep 23, 2006, 10:34:42 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/loading/resource.h
r9789 r9790 53 53 { 54 54 public: 55 Type(const ClassID& classID) : _id(-1), _classID(classID) { }; 55 Type(const ClassID& classID); 56 bool operator==(const ClassID& classID) const { return this->_classID == classID; }; 57 bool operator==(const std::string& resourceName) const { return this->_classID.name() == resourceName; }; 56 58 57 59 void addExtension(const std::string& extension); 58 60 59 voidaddResourcePath(const std::string& path);60 voidaddResourceSubPath(const std::string& subPath);61 bool addResourcePath(const std::string& path); 62 bool addResourceSubPath(const std::string& subPath); 61 63 62 64 /// Retrieve Functions 63 65 const ClassID& storedClassID() const { return _classID; }; 64 66 int id() const { return _id; }; 65 const std::vector< std::string>& resourcePaths() const { return _resourcePaths; };66 const std::vector< std::string>& resourceSubPaths() const { return _resourceSubPaths; };67 const std::vector<Directory>& resourcePaths() const { return _resourcePaths; }; 68 const std::vector<Directory>& resourceSubPaths() const { return _resourceSubPaths; }; 67 69 const std::vector<NewResource::StorePointer*>& storedResources() const { return _storedResources; }; 68 70 … … 73 75 int _id; 74 76 const ClassID& _classID; 75 std::vector< std::string>_resourcePaths;76 std::vector< std::string>_resourceSubPaths;77 std::vector<Directory> _resourcePaths; 78 std::vector<Directory> _resourceSubPaths; 77 79 std::vector<std::string> _fileExtensions; 78 80 … … 88 90 virtual bool unload() { return false; }; 89 91 90 std::string locateFile(const std::string& fileName) ;92 std::string locateFile(const std::string& fileName) const; 91 93 92 94 … … 95 97 static void addGlobalPath(const Directory& directory); 96 98 99 static bool addResourcePath(const std::string& resourceName, const std::string& pathName); 100 static bool addResourceSubPath(const std::string& resourceName, const std::string& pathName); 97 101 102 static void registerType(NewResource::Type* type); 103 104 static void debug(); 98 105 protected: 99 106 NewResource::StorePointer* acquireResource(const std::string& loadString); … … 101 108 102 109 private: 110 std::string locateFileInSubDir(const Directory& directory, const std::string& fileName) const; 111 112 private: 103 113 NewResource::StorePointer* _pointer; //!< Virtual Pointer to the ResourceData. 104 NewResource::Type* _type; //!< Type of the NewResource.114 NewResource::Type* _type; //!< Type of the NewResource. 105 115 106 116 107 static std::vector<NewResource::Type*> 117 static std::vector<NewResource::Type*> _resourceTypes; 108 118 109 119 //! GLOBALS
Note: See TracChangeset
for help on using the changeset viewer.