Revision: 7400
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7400&view=rev
Author:   gerkey
Date:     2009-03-09 07:47:35 +0000 (Mon, 09 Mar 2009)

Log Message:
-----------
Added hack to strip leading xml version tag on factory controller input

Modified Paths:
--------------
    code/branches/federation/gazebo/server/controllers/factory/Factory.cc

Modified: code/branches/federation/gazebo/server/controllers/factory/Factory.cc
===================================================================
--- code/branches/federation/gazebo/server/controllers/factory/Factory.cc       
2009-03-09 07:22:54 UTC (rev 7399)
+++ code/branches/federation/gazebo/server/controllers/factory/Factory.cc       
2009-03-09 07:47:35 UTC (rev 7400)
@@ -87,6 +87,13 @@
   {
     std::string xmlString;
     std::string xmlMiddle = (const char*)(this->factoryIface->data->newModel);
+    
+    // Strip leading <?xml...?> tag, if present, to allow the client to
+    // pass the contents of a valid .model file
+    std::string xmlVersion = "<?xml version=\"1.0\"?>";
+    int i = xmlMiddle.find(xmlVersion);
+    if(i >= 0)
+      xmlMiddle.replace(i, xmlVersion.length(), "");
 
     xmlString = this->xmlPrefix + xmlMiddle + this->xmlSuffix;
 


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

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to