Changeset 11054 for code/branches/cpp11_v3/src/libraries/core/Resource.cc
- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/libraries/core/Resource.cc
r9675 r11054 58 58 DataStreamListPtr resources(new Ogre::DataStreamList()); 59 59 const Ogre::StringVector& groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups(); 60 for ( Ogre::StringVector::const_iterator it = groups.begin(); it != groups.end(); ++it)60 for (const std::string& group : groups) 61 61 { 62 DataStreamListPtr temp = Ogre::ResourceGroupManager::getSingleton().openResources(pattern, *it);62 DataStreamListPtr temp = Ogre::ResourceGroupManager::getSingleton().openResources(pattern, group); 63 63 resources->insert(resources->end(), temp->begin(), temp->end()); 64 64 } … … 79 79 } 80 80 81 s hared_ptr<ResourceInfo> Resource::getInfo(const std::string& name)81 std::shared_ptr<ResourceInfo> Resource::getInfo(const std::string& name) 82 82 { 83 83 std::string group; … … 88 88 catch (const Ogre::Exception&) 89 89 { 90 return s hared_ptr<ResourceInfo>();90 return std::shared_ptr<ResourceInfo>(); 91 91 } 92 92 Ogre::FileInfoListPtr infos = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(group, name); … … 95 95 if (it->filename == name) 96 96 { 97 s hared_ptr<ResourceInfo> ptr(new ResourceInfo());97 std::shared_ptr<ResourceInfo> ptr(std::make_shared<ResourceInfo>()); 98 98 ptr->filename = name; 99 99 ptr->path = it->path; … … 102 102 ptr->size = it->uncompressedSize; 103 103 #if OGRE_VERSION >= 0x010800 104 if (dynamic_cast<const Ogre::FileSystemArchive*>(it->archive) != NULL)104 if (dynamic_cast<const Ogre::FileSystemArchive*>(it->archive) != nullptr) 105 105 #else 106 if (dynamic_cast<Ogre::FileSystemArchive*>(it->archive) != NULL)106 if (dynamic_cast<Ogre::FileSystemArchive*>(it->archive) != nullptr) 107 107 #endif 108 108 { … … 114 114 } 115 115 } 116 return s hared_ptr<ResourceInfo>();116 return std::shared_ptr<ResourceInfo>(); 117 117 } 118 118 … … 121 121 StringVectorPtr resourceNames(new Ogre::StringVector()); 122 122 const Ogre::StringVector& groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups(); 123 for ( Ogre::StringVector::const_iterator it = groups.begin(); it != groups.end(); ++it)123 for (const std::string& group : groups) 124 124 { 125 StringVectorPtr temp = Ogre::ResourceGroupManager::getSingleton().findResourceNames( *it, pattern);125 StringVectorPtr temp = Ogre::ResourceGroupManager::getSingleton().findResourceNames(group, pattern); 126 126 resourceNames->insert(resourceNames->end(), temp->begin(), temp->end()); 127 127 }
Note: See TracChangeset
for help on using the changeset viewer.