Revision: 7698
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7698&view=rev
Author:   hsujohnhsu
Date:     2009-05-20 03:58:05 +0000 (Wed, 20 May 2009)

Log Message:
-----------
parse GAZEBO_RESOURCE_PATH for multiple paths.

Modified Paths:
--------------
    code/gazebo/trunk/server/GazeboConfig.cc

Modified: code/gazebo/trunk/server/GazeboConfig.cc
===================================================================
--- code/gazebo/trunk/server/GazeboConfig.cc    2009-05-19 21:17:11 UTC (rev 
7697)
+++ code/gazebo/trunk/server/GazeboConfig.cc    2009-05-20 03:58:05 UTC (rev 
7698)
@@ -56,15 +56,35 @@
 
   cfgFile.open(rcFilename.c_str(), std::ios::in);
 
+  std::string delim(":");
+
   char *ogre_resource_path = getenv("OGRE_RESOURCE_PATH");
   if(ogre_resource_path) 
   {
-    this->ogrePaths.push_back(ogre_resource_path);
+    std::string str(ogre_resource_path);
+    int pos1 = 0;
+    int pos2 = str.find(delim);
+    while (pos2 != std::string::npos)
+    {
+      this->ogrePaths.push_back(str.substr(pos1,pos2-pos1+1));
+      pos1 = pos2+1;
+      pos2 = str.find(delim,pos2+1);
+    }
+    this->ogrePaths.push_back(str.substr(pos1,str.size()));
   }
   char *gazebo_resource_path = getenv("GAZEBO_RESOURCE_PATH");
   if(gazebo_resource_path) 
   {
-    this->gazeboPaths.push_back(gazebo_resource_path);
+    std::string str(gazebo_resource_path);
+    int pos1 = 0;
+    int pos2 = str.find(delim);
+    while (pos2 != std::string::npos)
+    {
+      this->gazeboPaths.push_back(str.substr(pos1,pos2-pos1+1));
+      pos1 = pos2+1;
+      pos2 = str.find(delim,pos2+1);
+    }
+    this->gazeboPaths.push_back(str.substr(pos1,str.size()));
   }
 
   if (cfgFile)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to