[Cmake-commits] [cmake-commits] alex committed cmExtraEclipseCDT4Generator.h 1.4 1.5 cmExtraEclipseCDT4Generator.cxx 1.15 1.16

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jan 8 18:09:52 EST 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv1427

Modified Files:
	cmExtraEclipseCDT4Generator.h cmExtraEclipseCDT4Generator.cxx 
Log Message:
BUG: apply patch from #8205, also fixes #8212: escape characters for XML
when writing the eclipse project files

Alex


Index: cmExtraEclipseCDT4Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExtraEclipseCDT4Generator.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** cmExtraEclipseCDT4Generator.h	19 Feb 2008 21:27:03 -0000	1.4
--- cmExtraEclipseCDT4Generator.h	8 Jan 2009 23:09:49 -0000	1.5
***************
*** 85,88 ****
--- 85,90 ----
                                           const std::string& path);
  
+   static std::string EscapeForXML(const std::string& value);
+ 
    // Helper functions
    static void AppendStorageScanners(cmGeneratedFileStream& fout);

Index: cmExtraEclipseCDT4Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExtraEclipseCDT4Generator.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -C 2 -d -r1.15 -r1.16
*** cmExtraEclipseCDT4Generator.cxx	6 Aug 2008 19:35:52 -0000	1.15
--- cmExtraEclipseCDT4Generator.cxx	8 Jan 2009 23:09:50 -0000	1.16
***************
*** 574,578 ****
            emmited.insert(def);
            fout << "<pathentry kind=\"mac\" name=\"" << def
!                << "\" path=\"\" value=\"" << val << "\"/>\n";
            }
          }
--- 574,579 ----
            emmited.insert(def);
            fout << "<pathentry kind=\"mac\" name=\"" << def
!                << "\" path=\"\" value=\"" << this->EscapeForXML(val) 
!                << "\"/>\n";
            }
          }
***************
*** 793,796 ****
--- 794,810 ----
  }
  
+ std::string cmExtraEclipseCDT4Generator::EscapeForXML(const std::string& value)
+ {
+   std::string str = value;
+   cmSystemTools::ReplaceString(str, "&", "&amp;");
+   cmSystemTools::ReplaceString(str, "<", "&lt;");
+   cmSystemTools::ReplaceString(str, ">", "&gt;");
+   cmSystemTools::ReplaceString(str, "\"", "&quot;");
+   // NOTE: This one is not necessary, since as of Eclipse CDT4 it will
+   //       automatically change this to the original value (').
+   //cmSystemTools::ReplaceString(str, "'", "&apos;");
+   return str;
+ }
+ 
  //----------------------------------------------------------------------------
  // Helper functions



More information about the Cmake-commits mailing list