Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2750 for code/branches/network


Ignore:
Timestamp:
Mar 5, 2009, 2:58:42 PM (16 years ago)
Author:
rgrieder
Message:

Using POSIX forward slashes on Windows as well. There is only one exception: Plugin loading in GSGraphics.cc

  • Removed Core::getFooPathPOSIXString()
  • Modified Core::getFooPathString() to return POSIX path strings.

This should problems when exchanging file strings over the network.

Location:
code/branches/network/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/core/ArgumentCompletionFunctions.cc

    r2728 r2750  
    7676                    std::string dir = startdirectory.string();
    7777                    if (dir.size() > 0 && dir[dir.size() - 1] == ':')
    78                         startdirectory = dir + CP_SLASH;
     78                        startdirectory = dir + '/';
    7979                }
    8080#endif
     
    8686                {
    8787                    if (boost::filesystem::is_directory(*file))
    88                         dirlist.push_back(ArgumentCompletionListElement((*file).string() + CP_SLASH, getLowercase((*file).string()) + "/", (*file).BOOST_LEAF_FUNCTION() + "/"));
     88                        dirlist.push_back(ArgumentCompletionListElement((*file).string() + '/', getLowercase((*file).string()) + '/', (*file).BOOST_LEAF_FUNCTION() + '/'));
    8989                    else
    9090                        filelist.push_back(ArgumentCompletionListElement((*file).string(), getLowercase((*file).string()), (*file).BOOST_LEAF_FUNCTION()));
  • code/branches/network/src/core/CommandLine.cc

    r2710 r2750  
    307307        // They will not overwrite the arguments given directly
    308308        std::ifstream file;
    309         file.open(filepath.file_string().c_str());
     309        file.open(filepath.string().c_str());
    310310        args.clear();
    311311        if (file)
  • code/branches/network/src/core/ConfigFileManager.cc

    r2731 r2750  
    241241        // Open the file
    242242        std::ifstream file;
    243         file.open(filepath.file_string().c_str(), std::fstream::in);
     243        file.open(filepath.string().c_str(), std::fstream::in);
    244244        if (file.is_open())
    245245        {
     
    347347
    348348        std::ofstream file;
    349         file.open(filepath.file_string().c_str(), std::fstream::out);
     349        file.open(filepath.string().c_str(), std::fstream::out);
    350350        file.setf(std::ios::fixed, std::ios::floatfield);
    351351        file.precision(6);
  • code/branches/network/src/core/Core.cc

    r2727 r2750  
    260260    /*static*/ std::string Core::getMediaPathString()
    261261    {
    262         return mediaPath_g.directory_string() + CP_SLASH;
    263     }
    264     /*static*/ std::string Core::getMediaPathPOSIXString()
    265     {
    266262        return mediaPath_g.string() + '/';
    267 
    268263    }
    269264
     
    274269    /*static*/ std::string Core::getConfigPathString()
    275270    {
    276         return configPath_g.directory_string() + CP_SLASH;
    277     }
    278     /*static*/ std::string Core::getConfigPathPOSIXString()
    279     {
    280271        return configPath_g.string() + '/';
    281272    }
     
    286277    }
    287278    /*static*/ std::string Core::getLogPathString()
    288     {
    289         return logPath_g.directory_string() + CP_SLASH;
    290     }
    291     /*static*/ std::string Core::getLogPathPOSIXString()
    292279    {
    293280        return logPath_g.string() + '/';
     
    456443            {
    457444                ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \
    458                                          Please remove " + it->first.file_string());
     445                                         Please remove " + it->first.string());
    459446            }
    460447            if (boost::filesystem::create_directories(it->first)) // function may not return true at all (bug?)
  • code/branches/network/src/core/Core.h

    r2710 r2750  
    8383            static std::string getConfigPathString();
    8484            static std::string getLogPathString();
    85             static std::string getMediaPathPOSIXString();
    86             static std::string getConfigPathPOSIXString();
    87             static std::string getLogPathPOSIXString();
    8885
    8986            // fast access global variables.
  • code/branches/network/src/core/Language.cc

    r2710 r2750  
    210210        // This creates the file if it's not existing
    211211        std::ofstream createFile;
    212         createFile.open(filepath.file_string().c_str(), std::fstream::app);
     212        createFile.open(filepath.string().c_str(), std::fstream::app);
    213213        createFile.close();
    214214
    215215        // Open the file
    216216        std::ifstream file;
    217         file.open(filepath.file_string().c_str(), std::fstream::in);
     217        file.open(filepath.string().c_str(), std::fstream::in);
    218218
    219219        if (!file.is_open())
     
    261261        // Open the file
    262262        std::ifstream file;
    263         file.open(filepath.file_string().c_str(), std::fstream::in);
     263        file.open(filepath.string().c_str(), std::fstream::in);
    264264
    265265        if (!file.is_open())
     
    317317        // Open the file
    318318        std::ofstream file;
    319         file.open(filepath.file_string().c_str(), std::fstream::out);
     319        file.open(filepath.string().c_str(), std::fstream::out);
    320320
    321321        if (!file.is_open())
  • code/branches/network/src/core/LuaBind.cc

    r2710 r2750  
    5353    LuaBind::singletonRef_s = this;
    5454
    55     this->includePath_ = Core::getMediaPathPOSIXString();
     55    this->includePath_ = Core::getMediaPathString();
    5656
    5757    luaState_ = lua_open();
     
    9090    output_ = "";
    9191    std::ifstream file;
    92     file.open(filepath.file_string().c_str(), std::fstream::in);
     92    file.open(filepath.string().c_str(), std::fstream::in);
    9393
    9494    if (!file.is_open())
  • code/branches/network/src/orxonox/gamestates/GSGraphics.cc

    r2710 r2750  
    136136        // load debug overlay
    137137        COUT(3) << "Loading Debug Overlay..." << std::endl;
    138         this->debugOverlay_ = new XMLFile((Core::getMediaPath() / "overlay" / "debug.oxo").file_string());
     138        this->debugOverlay_ = new XMLFile((Core::getMediaPath() / "overlay" / "debug.oxo").string());
    139139        Loader::open(debugOverlay_);
    140140
     
    304304        // create our own log that we can listen to
    305305        Ogre::Log *myLog;
    306         myLog = ogreLogger_->createLog(ogreLogFilepath.file_string(), true, false, false);
     306        myLog = ogreLogger_->createLog(ogreLogFilepath.string(), true, false, false);
    307307        COUT(4) << "Ogre Log created" << std::endl;
    308308
     
    317317            // create a zero sized file
    318318            std::ofstream creator;
    319             creator.open(ogreConfigFilepath.file_string().c_str());
     319            creator.open(ogreConfigFilepath.string().c_str());
    320320            creator.close();
    321321        }
    322322
    323323        // Leave plugins file empty. We're going to do that part manually later
    324         ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.file_string(), ogreLogFilepath.file_string());
     324        ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.string(), ogreLogFilepath.string());
    325325
    326326        COUT(3) << "Ogre set up done." << std::endl;
     
    336336        // Do some SubString magic to get the comma separated list of plugins
    337337        SubString plugins(ogrePlugins_, ",", " ", false, 92, false, 34, false, 40, 41, false, '\0');
     338        // Use backslash paths on Windows! file_string() already does that though.
    338339        for (unsigned int i = 0; i < plugins.size(); ++i)
    339340            ogreRoot_->loadPlugin((folder / plugins[i]).file_string());
     
    356357        try
    357358        {
    358             cf.load((Core::getMediaPath() / resourceFile_).file_string());
     359            cf.load((Core::getMediaPath() / resourceFile_).string());
    359360        }
    360361        catch (...)
     
    382383
    383384                    Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
    384                         (Core::getMediaPath() / archName).directory_string(), typeName, secName);
     385                        (Core::getMediaPath() / archName).string(), typeName, secName);
    385386                }
    386387            }
  • code/branches/network/src/orxonox/gamestates/GSLevel.cc

    r2710 r2750  
    202202        std::string levelName;
    203203        CommandLine::getValue("level", &levelName);
    204         startFile_ = new XMLFile(Core::getMediaPathString() + "levels" + CP_SLASH + levelName);
     204        startFile_ = new XMLFile(Core::getMediaPathString() + "levels" + '/' + levelName);
    205205        Loader::open(startFile_);
    206206    }
  • code/branches/network/src/orxonox/gamestates/GSRoot.cc

    r2710 r2750  
    111111
    112112        // initialise TCL
    113         this->tclBind_ = new TclBind(Core::getMediaPathPOSIXString());
     113        this->tclBind_ = new TclBind(Core::getMediaPathString());
    114114        this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter());
    115115
  • code/branches/network/src/orxonox/gui/GUIManager.cc

    r2710 r2750  
    154154                boost::filesystem::path ceguiLogFilepath(Core::getLogPath() / "cegui.log");
    155155                this->ceguiLogger_ = new DefaultLogger();
    156                 this->ceguiLogger_->setLogFilename(ceguiLogFilepath.file_string());
     156                this->ceguiLogger_->setLogFilename(ceguiLogFilepath.string());
    157157                // set the log level according to ours (translate by subtracting 1)
    158158                this->ceguiLogger_->setLoggingLevel(
Note: See TracChangeset for help on using the changeset viewer.