Changeset 11071 for code/trunk/src/libraries/core/Loader.cc
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/Loader.cc
r10624 r11071 31 31 #include <sstream> 32 32 #include <tinyxml/ticpp.h> 33 #include <boost/scoped_ptr.hpp>34 33 #include <boost/filesystem.hpp> 35 34 #include <boost/filesystem/fstream.hpp> … … 48 47 namespace orxonox 49 48 { 50 Loader* Loader::singletonPtr_s = 0;49 Loader* Loader::singletonPtr_s = nullptr; 51 50 52 51 /** … … 73 72 std::string xmlInput; 74 73 75 s hared_ptr<std::vector<std::vector<std::pair<std::string, size_t> > > > lineTrace(new std::vector<std::vector<std::pair<std::string, size_t> >>());74 std::shared_ptr<std::vector<std::vector<std::pair<std::string, size_t>>>> lineTrace(std::make_shared<std::vector<std::vector<std::pair<std::string, size_t>>>>()); 76 75 lineTrace->reserve(1000); //arbitrary number 77 76 … … 80 79 { 81 80 // Use the LuaState to replace the XML tags (calls our function) 82 scoped_ptr<LuaState> luaState(new LuaState());81 const std::unique_ptr<LuaState> luaState(new LuaState()); 83 82 luaState->setTraceMap(lineTrace); 84 83 luaState->setIncludeParser(&Loader::replaceLuaTags); … … 88 87 else 89 88 { 90 s hared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename());91 if (info == NULL)89 std::shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename()); 90 if (info == nullptr) 92 91 { 93 92 orxout(user_error, context::loader) << "Could not find XML file '" << file->getFilename() << "'." << endl; … … 163 162 if (line <= lineTrace->size()) 164 163 { 165 std::vector<std::pair<std::string, size_t> 164 std::vector<std::pair<std::string, size_t>> linesources = lineTrace->at(line - 1); 166 165 std::ostringstream message; 167 166 message << "Possible sources of error:" << endl; 168 for ( std::vector<std::pair<std::string, size_t> >::iterator it = linesources.begin(); it != linesources.end(); ++it)167 for (const std::pair<std::string, size_t>& pair : linesources) 169 168 { 170 message << it->first << ", Line " << it->second << endl;169 message << pair.first << ", Line " << pair.second << endl; 171 170 } 172 171 orxout(user_error, context::loader) << message.str() << endl; … … 208 207 if (!file) 209 208 return; 210 for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject> ::begin(); it; )209 for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>().begin(); it; ) 211 210 { 212 211 if ((it->getFile() == file) && mask.isIncluded(it->getIdentifier())) … … 262 261 { 263 262 bool expectedValue = true; 264 for ( std::map<size_t, bool>::iterator it = luaTags.begin(); it != luaTags.end(); ++it)265 { 266 if ( it->second == expectedValue)263 for (const auto& mapEntry : luaTags) 264 { 265 if (mapEntry.second == expectedValue) 267 266 expectedValue = !expectedValue; 268 267 else
Note: See TracChangeset
for help on using the changeset viewer.