Changeset 6412 for code/branches/pickup2/src/libraries/core/Loader.cc
- Timestamp:
- Dec 25, 2009, 1:18:03 PM (15 years ago)
- Location:
- code/branches/pickup2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup2
- Property svn:mergeinfo changed
-
code/branches/pickup2/src/libraries/core/Loader.cc
r5929 r6412 80 80 for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it) 81 81 { 82 if ( (*it).first == file)82 if (it->first == file) 83 83 { 84 84 Loader::files_s.erase(it); … … 92 92 bool success = true; 93 93 for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it) 94 if (!Loader::load( (*it).first, (*it).second * mask))94 if (!Loader::load(it->first, it->second * mask)) 95 95 success = false; 96 96 … … 128 128 scoped_ptr<LuaState> luaState(new LuaState()); 129 129 luaState->setIncludeParser(&Loader::replaceLuaTags); 130 luaState->includeFile(file->getFilename() , file->getResourceGroup(), false);130 luaState->includeFile(file->getFilename()); 131 131 xmlInput = luaState->getOutput().str(); 132 132 } 133 133 else 134 134 { 135 shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename() , file->getResourceGroup());135 shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename()); 136 136 if (info == NULL) 137 137 { … … 139 139 return false; 140 140 } 141 xmlInput = Resource::open(file->getFilename() , file->getResourceGroup())->getAsString();141 xmlInput = Resource::open(file->getFilename())->getAsString(); 142 142 } 143 143 … … 165 165 rootNamespace->XMLPort(rootElement, XMLPort::LoadObject); 166 166 167 COUT(0) << "Finished loading " << file->getFilename() << "."<< std::endl;167 COUT(0) << "Finished loading " << file->getFilename() << '.' << std::endl; 168 168 169 169 COUT(4) << "Namespace-tree:" << std::endl << rootNamespace->toString(" ") << std::endl; … … 174 174 { 175 175 COUT(1) << std::endl; 176 COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ":"<< std::endl;176 COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl; 177 177 COUT(1) << ex.what() << std::endl; 178 178 COUT(1) << "Loading aborted." << std::endl; … … 182 182 { 183 183 COUT(1) << std::endl; 184 COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ":"<< std::endl;184 COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl; 185 185 COUT(1) << ex.what() << std::endl; 186 186 COUT(1) << "Loading aborted." << std::endl; … … 190 190 { 191 191 COUT(1) << std::endl; 192 COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ":"<< std::endl;192 COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl; 193 193 COUT(1) << Exception::handleMessage() << std::endl; 194 194 COUT(1) << "Loading aborted." << std::endl; … … 218 218 std::string Loader::replaceLuaTags(const std::string& text) 219 219 { 220 // c hreate map with all Lua tags220 // create map with all Lua tags 221 221 std::map<size_t, bool> luaTags; 222 222 { … … 291 291 { 292 292 if (it != luaTags.end()) 293 end = ( *(it++)).first;293 end = (it++)->first; 294 294 else 295 295 end = std::string::npos; … … 300 300 { 301 301 // count ['='[ and ]'='] and replace tags with print([[ and ]]) 302 std::stringtemp = text.substr(start, end - start);302 const std::string& temp = text.substr(start, end - start); 303 303 { 304 304 size_t pos = 0; … … 345 345 } 346 346 } 347 std::string equalSigns = "";347 std::string equalSigns; 348 348 for(unsigned int i = 0; i < equalSignCounter; i++) 349 349 { 350 equalSigns += "=";350 equalSigns += '='; 351 351 } 352 output << "print([" + equalSigns + "[" + temp + "]"+ equalSigns +"])";352 output << "print([" + equalSigns + '[' + temp + ']' + equalSigns +"])"; 353 353 start = end + 5; 354 354 }
Note: See TracChangeset
for help on using the changeset viewer.