[Orxonox-commit 45] r2750 - in branches/network/src: core orxonox/gamestates orxonox/gui
rgrieder at orxonox.net
rgrieder at orxonox.net
Thu Mar 5 14:58:42 CET 2009
Author: rgrieder
Date: 2009-03-05 14:58:42 +0100 (Thu, 05 Mar 2009)
New Revision: 2750
Modified:
branches/network/src/core/ArgumentCompletionFunctions.cc
branches/network/src/core/CommandLine.cc
branches/network/src/core/ConfigFileManager.cc
branches/network/src/core/Core.cc
branches/network/src/core/Core.h
branches/network/src/core/Language.cc
branches/network/src/core/LuaBind.cc
branches/network/src/orxonox/gamestates/GSGraphics.cc
branches/network/src/orxonox/gamestates/GSLevel.cc
branches/network/src/orxonox/gamestates/GSRoot.cc
branches/network/src/orxonox/gui/GUIManager.cc
Log:
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.
Modified: branches/network/src/core/ArgumentCompletionFunctions.cc
===================================================================
--- branches/network/src/core/ArgumentCompletionFunctions.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/core/ArgumentCompletionFunctions.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -75,7 +75,7 @@
{
std::string dir = startdirectory.string();
if (dir.size() > 0 && dir[dir.size() - 1] == ':')
- startdirectory = dir + CP_SLASH;
+ startdirectory = dir + '/';
}
#endif
@@ -85,7 +85,7 @@
while (file != end)
{
if (boost::filesystem::is_directory(*file))
- dirlist.push_back(ArgumentCompletionListElement((*file).string() + CP_SLASH, getLowercase((*file).string()) + "/", (*file).BOOST_LEAF_FUNCTION() + "/"));
+ dirlist.push_back(ArgumentCompletionListElement((*file).string() + '/', getLowercase((*file).string()) + '/', (*file).BOOST_LEAF_FUNCTION() + '/'));
else
filelist.push_back(ArgumentCompletionListElement((*file).string(), getLowercase((*file).string()), (*file).BOOST_LEAF_FUNCTION()));
++file;
Modified: branches/network/src/core/CommandLine.cc
===================================================================
--- branches/network/src/core/CommandLine.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/core/CommandLine.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -306,7 +306,7 @@
// look for additional arguments in given file or start.ini as default
// They will not overwrite the arguments given directly
std::ifstream file;
- file.open(filepath.file_string().c_str());
+ file.open(filepath.string().c_str());
args.clear();
if (file)
{
Modified: branches/network/src/core/ConfigFileManager.cc
===================================================================
--- branches/network/src/core/ConfigFileManager.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/core/ConfigFileManager.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -240,7 +240,7 @@
// Open the file
std::ifstream file;
- file.open(filepath.file_string().c_str(), std::fstream::in);
+ file.open(filepath.string().c_str(), std::fstream::in);
if (file.is_open())
{
@@ -346,7 +346,7 @@
boost::filesystem::path filepath(Core::getConfigPath() / this->filename_);
std::ofstream file;
- file.open(filepath.file_string().c_str(), std::fstream::out);
+ file.open(filepath.string().c_str(), std::fstream::out);
file.setf(std::ios::fixed, std::ios::floatfield);
file.precision(6);
Modified: branches/network/src/core/Core.cc
===================================================================
--- branches/network/src/core/Core.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/core/Core.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -259,12 +259,7 @@
}
/*static*/ std::string Core::getMediaPathString()
{
- return mediaPath_g.directory_string() + CP_SLASH;
- }
- /*static*/ std::string Core::getMediaPathPOSIXString()
- {
return mediaPath_g.string() + '/';
-
}
/*static*/ const boost::filesystem::path& Core::getConfigPath()
@@ -273,10 +268,6 @@
}
/*static*/ std::string Core::getConfigPathString()
{
- return configPath_g.directory_string() + CP_SLASH;
- }
- /*static*/ std::string Core::getConfigPathPOSIXString()
- {
return configPath_g.string() + '/';
}
@@ -286,10 +277,6 @@
}
/*static*/ std::string Core::getLogPathString()
{
- return logPath_g.directory_string() + CP_SLASH;
- }
- /*static*/ std::string Core::getLogPathPOSIXString()
- {
return logPath_g.string() + '/';
}
@@ -455,7 +442,7 @@
if (boost::filesystem::exists(it->first) && !boost::filesystem::is_directory(it->first))
{
ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \
- Please remove " + it->first.file_string());
+ Please remove " + it->first.string());
}
if (boost::filesystem::create_directories(it->first)) // function may not return true at all (bug?)
{
Modified: branches/network/src/core/Core.h
===================================================================
--- branches/network/src/core/Core.h 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/core/Core.h 2009-03-05 13:58:42 UTC (rev 2750)
@@ -82,9 +82,6 @@
static std::string getMediaPathString();
static std::string getConfigPathString();
static std::string getLogPathString();
- static std::string getMediaPathPOSIXString();
- static std::string getConfigPathPOSIXString();
- static std::string getLogPathPOSIXString();
// fast access global variables.
static bool showsGraphics() { return bShowsGraphics_s; }
Modified: branches/network/src/core/Language.cc
===================================================================
--- branches/network/src/core/Language.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/core/Language.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -209,12 +209,12 @@
// This creates the file if it's not existing
std::ofstream createFile;
- createFile.open(filepath.file_string().c_str(), std::fstream::app);
+ createFile.open(filepath.string().c_str(), std::fstream::app);
createFile.close();
// Open the file
std::ifstream file;
- file.open(filepath.file_string().c_str(), std::fstream::in);
+ file.open(filepath.string().c_str(), std::fstream::in);
if (!file.is_open())
{
@@ -260,7 +260,7 @@
// Open the file
std::ifstream file;
- file.open(filepath.file_string().c_str(), std::fstream::in);
+ file.open(filepath.string().c_str(), std::fstream::in);
if (!file.is_open())
{
@@ -316,7 +316,7 @@
// Open the file
std::ofstream file;
- file.open(filepath.file_string().c_str(), std::fstream::out);
+ file.open(filepath.string().c_str(), std::fstream::out);
if (!file.is_open())
{
Modified: branches/network/src/core/LuaBind.cc
===================================================================
--- branches/network/src/core/LuaBind.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/core/LuaBind.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -52,7 +52,7 @@
assert(LuaBind::singletonRef_s == 0);
LuaBind::singletonRef_s = this;
- this->includePath_ = Core::getMediaPathPOSIXString();
+ this->includePath_ = Core::getMediaPathString();
luaState_ = lua_open();
luaSource_ = "";
@@ -89,7 +89,7 @@
output_ = "";
std::ifstream file;
- file.open(filepath.file_string().c_str(), std::fstream::in);
+ file.open(filepath.string().c_str(), std::fstream::in);
if (!file.is_open())
{
Modified: branches/network/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- branches/network/src/orxonox/gamestates/GSGraphics.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/orxonox/gamestates/GSGraphics.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -135,7 +135,7 @@
// load debug overlay
COUT(3) << "Loading Debug Overlay..." << std::endl;
- this->debugOverlay_ = new XMLFile((Core::getMediaPath() / "overlay" / "debug.oxo").file_string());
+ this->debugOverlay_ = new XMLFile((Core::getMediaPath() / "overlay" / "debug.oxo").string());
Loader::open(debugOverlay_);
// Calls the InputManager which sets up the input devices.
@@ -303,7 +303,7 @@
// create our own log that we can listen to
Ogre::Log *myLog;
- myLog = ogreLogger_->createLog(ogreLogFilepath.file_string(), true, false, false);
+ myLog = ogreLogger_->createLog(ogreLogFilepath.string(), true, false, false);
COUT(4) << "Ogre Log created" << std::endl;
myLog->setLogDetail(Ogre::LL_BOREME);
@@ -316,12 +316,12 @@
{
// create a zero sized file
std::ofstream creator;
- creator.open(ogreConfigFilepath.file_string().c_str());
+ creator.open(ogreConfigFilepath.string().c_str());
creator.close();
}
// Leave plugins file empty. We're going to do that part manually later
- ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.file_string(), ogreLogFilepath.file_string());
+ ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.string(), ogreLogFilepath.string());
COUT(3) << "Ogre set up done." << std::endl;
}
@@ -335,6 +335,7 @@
boost::filesystem::path folder(ogrePluginsFolder_);
// Do some SubString magic to get the comma separated list of plugins
SubString plugins(ogrePlugins_, ",", " ", false, 92, false, 34, false, 40, 41, false, '\0');
+ // Use backslash paths on Windows! file_string() already does that though.
for (unsigned int i = 0; i < plugins.size(); ++i)
ogreRoot_->loadPlugin((folder / plugins[i]).file_string());
}
@@ -355,7 +356,7 @@
Ogre::ConfigFile cf;
try
{
- cf.load((Core::getMediaPath() / resourceFile_).file_string());
+ cf.load((Core::getMediaPath() / resourceFile_).string());
}
catch (...)
{
@@ -381,7 +382,7 @@
archName = i->second; // name (and location) of archive
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
- (Core::getMediaPath() / archName).directory_string(), typeName, secName);
+ (Core::getMediaPath() / archName).string(), typeName, secName);
}
}
catch (Ogre::Exception& ex)
Modified: branches/network/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- branches/network/src/orxonox/gamestates/GSLevel.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/orxonox/gamestates/GSLevel.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -201,7 +201,7 @@
COUT(0) << "Loading level..." << std::endl;
std::string levelName;
CommandLine::getValue("level", &levelName);
- startFile_ = new XMLFile(Core::getMediaPathString() + "levels" + CP_SLASH + levelName);
+ startFile_ = new XMLFile(Core::getMediaPathString() + "levels" + '/' + levelName);
Loader::open(startFile_);
}
Modified: branches/network/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- branches/network/src/orxonox/gamestates/GSRoot.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/orxonox/gamestates/GSRoot.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -110,7 +110,7 @@
this->luaBind_ = new LuaBind();
// initialise TCL
- this->tclBind_ = new TclBind(Core::getMediaPathPOSIXString());
+ this->tclBind_ = new TclBind(Core::getMediaPathString());
this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter());
// create a shell
Modified: branches/network/src/orxonox/gui/GUIManager.cc
===================================================================
--- branches/network/src/orxonox/gui/GUIManager.cc 2009-03-05 12:54:27 UTC (rev 2749)
+++ branches/network/src/orxonox/gui/GUIManager.cc 2009-03-05 13:58:42 UTC (rev 2750)
@@ -153,7 +153,7 @@
// Create our own logger to specify the filepath
boost::filesystem::path ceguiLogFilepath(Core::getLogPath() / "cegui.log");
this->ceguiLogger_ = new DefaultLogger();
- this->ceguiLogger_->setLogFilename(ceguiLogFilepath.file_string());
+ this->ceguiLogger_->setLogFilename(ceguiLogFilepath.string());
// set the log level according to ours (translate by subtracting 1)
this->ceguiLogger_->setLoggingLevel(
(LoggingLevel)(Core::getSoftDebugLevel(OutputHandler::LD_Logfile) - 1));
More information about the Orxonox-commit
mailing list