Changeset 6417 for code/trunk/src/libraries/core/Resource.h
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/Resource.h
r5929 r6417 34 34 #include <boost/shared_ptr.hpp> 35 35 #include <OgreDataStream.h> 36 #include <OgreStringVector.h> 36 37 37 38 namespace orxonox … … 40 41 using Ogre::DataStreamList; 41 42 using Ogre::DataStreamListPtr; 43 using Ogre::StringVector; 44 using Ogre::StringVectorPtr; 42 45 43 46 //! Stores basic information about a Resource from Ogre … … 56 59 }; 57 60 58 /** 59 @brief 60 Provides simple functions to easily access the Ogre::ResourceGroupManager 61 /** Provides simple functions to easily access the Ogre::ResourceGroupManager. 62 The wrapper functions also avoid having to deal with resource groups. 61 63 */ 62 64 class _CoreExport Resource … … 72 74 Even if resource locations are added recursively, you 73 75 must provide a fully qualified name to this method. 74 @param groupName75 The name of the resource group; this determines which76 locations are searched.77 @param searchGroupsIfNotFound78 If true, if the resource is not found in79 the group specified, other groups will be searched.80 76 @return 81 77 Shared pointer to data stream containing the data. Will be 82 78 destroyed automatically when no longer referenced. 83 79 */ 84 static DataStreamPtr open(const std::string& name, 85 const std::string& group = Resource::DEFAULT_GROUP, 86 bool bSearchGroupsIfNotFound = false); 80 static DataStreamPtr open(const std::string& name); 81 82 //! Similar to open(string, string, bool), but with a fileInfo struct 83 static DataStreamPtr open(shared_ptr<ResourceInfo> fileInfo) 84 { 85 return open(fileInfo->filename); 86 } 87 87 88 88 /** 89 89 @brief 90 90 Open all resources matching a given pattern (which can contain 91 the character '*' as a wildcard), and return a collection of 91 the character '*' as a wildcard), and return a collection of 92 92 DataStream objects on them. 93 93 @param pattern … … 95 95 added recursively, subdirectories will be searched too so this 96 96 does not need to be fully qualified. 97 @param groupName98 The resource group; this determines which locations99 are searched.100 97 @return 101 98 Shared pointer to a data stream list , will be 102 99 destroyed automatically when no longer referenced 103 100 */ 104 static DataStreamListPtr openMulti(const std::string& pattern , const std::string& group = Resource::DEFAULT_GROUP);101 static DataStreamListPtr openMulti(const std::string& pattern); 105 102 106 103 /** 107 Find out if the named file exists in a group.104 Find out if the named file exists. 108 105 @param filename 109 106 Fully qualified name of the file to test for 110 @param group111 The name of the resource group112 107 */ 113 static bool exists(const std::string& name , const std::string& group = Resource::DEFAULT_GROUP);108 static bool exists(const std::string& name); 114 109 115 110 /** 116 Get struct with information about group,path and size.111 Get struct with information about path and size. 117 112 @param filename 118 113 Fully qualified name of the file to test for 119 @param group120 The name of the resource group121 114 */ 122 static shared_ptr<ResourceInfo> getInfo(const std::string& name, const std::string& group = Resource::DEFAULT_GROUP); 115 static shared_ptr<ResourceInfo> getInfo(const std::string& name); 116 117 /** 118 Retrieves a list with all resources matching a certain pattern. 119 @param pattern 120 The pattern to look for. If resource locations have been 121 added recursively, subdirectories will be searched too so this 122 does not need to be fully qualified. 123 */ 124 static StringVectorPtr findResourceNames(const std::string& pattern); 123 125 124 126 //! Name of the default resource group (usually "General")
Note: See TracChangeset
for help on using the changeset viewer.