[cmake-commits] king committed cmSystemTools.cxx 1.336 1.337 cmSystemTools.h 1.137 1.138

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Mar 8 11:49:29 EST 2007


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

Modified Files:
	cmSystemTools.cxx cmSystemTools.h 
Log Message:
ENH: Added ConvertToOutputSlashes method to convert slashes with the same policy as ConvertToOutputPath but without escaping.


Index: cmSystemTools.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.h,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- cmSystemTools.h	8 Mar 2007 14:48:17 -0000	1.137
+++ cmSystemTools.h	8 Mar 2007 16:49:26 -0000	1.138
@@ -289,6 +289,8 @@
 
   // ConvertToOutputPath use s_ForceUnixPaths
   static std::string ConvertToOutputPath(const char* path);
+  static void ConvertToOutputSlashes(std::string& path);
+
   // ConvertToRunCommandPath does not use s_ForceUnixPaths and should
   // be used when RunCommand is called from cmake, because the 
   // running cmake needs paths to be in its format

Index: cmSystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v
retrieving revision 1.336
retrieving revision 1.337
diff -u -d -r1.336 -r1.337
--- cmSystemTools.cxx	8 Mar 2007 14:48:17 -0000	1.336
+++ cmSystemTools.cxx	8 Mar 2007 16:49:25 -0000	1.337
@@ -1341,6 +1341,23 @@
 #endif
 }
 
+void cmSystemTools::ConvertToOutputSlashes(std::string& path)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+  if(!s_ForceUnixPaths)
+    {
+    // Convert to windows slashes.
+    std::string::size_type pos = 0;
+    while((pos = path.find('/', pos)) != std::string::npos)
+      {
+      path[pos++] = '\\';
+      }
+    }
+#else
+  static_cast<void>(path);
+#endif
+}
+
 std::string cmSystemTools::ConvertToRunCommandPath(const char* path)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)



More information about the Cmake-commits mailing list