Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/Loader.cc

    r10624 r11071  
    3131#include <sstream>
    3232#include <tinyxml/ticpp.h>
    33 #include <boost/scoped_ptr.hpp>
    3433#include <boost/filesystem.hpp>
    3534#include <boost/filesystem/fstream.hpp>
     
    4847namespace orxonox
    4948{
    50     Loader* Loader::singletonPtr_s = 0;
     49    Loader* Loader::singletonPtr_s = nullptr;
    5150
    5251    /**
     
    7372        std::string xmlInput;
    7473
    75         shared_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>>>>());
    7675        lineTrace->reserve(1000); //arbitrary number
    7776
     
    8079        {
    8180            // 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());
    8382            luaState->setTraceMap(lineTrace);
    8483            luaState->setIncludeParser(&Loader::replaceLuaTags);
     
    8887        else
    8988        {
    90             shared_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)
    9291            {
    9392                orxout(user_error, context::loader) << "Could not find XML file '" << file->getFilename() << "'." << endl;
     
    163162                    if (line <= lineTrace->size())
    164163                    {
    165                         std::vector<std::pair<std::string, size_t> > linesources = lineTrace->at(line - 1);
     164                        std::vector<std::pair<std::string, size_t>> linesources = lineTrace->at(line - 1);
    166165                        std::ostringstream message;
    167166                        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)
    169168                        {
    170                             message << it->first << ", Line " << it->second << endl;
     169                            message << pair.first << ", Line " << pair.second << endl;
    171170                        }
    172171                        orxout(user_error, context::loader) << message.str() << endl;
     
    208207        if (!file)
    209208            return;
    210         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; )
     209        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>().begin(); it; )
    211210        {
    212211            if ((it->getFile() == file) && mask.isIncluded(it->getIdentifier()))
     
    262261        {
    263262            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)
    267266                    expectedValue = !expectedValue;
    268267                else
Note: See TracChangeset for help on using the changeset viewer.