Salome HOME
Fix for "[CEA]: Windows version: Dump Python: there is an error in the file name...
authorrnv <rnv@opencascade.com>
Mon, 13 May 2019 13:36:02 +0000 (16:36 +0300)
committerrnv <rnv@opencascade.com>
Mon, 13 May 2019 13:36:02 +0000 (16:36 +0300)
src/Basics/Basics_DirUtils.cxx
src/Basics/Basics_DirUtils.hxx

index daa4b8f55567d6ed3cb697e7a232b363b17baedd..8a1974a96f21106736cbf46264a0df20e5d2619e 100644 (file)
@@ -27,6 +27,8 @@
 #include <errno.h>
 #include <stdlib.h>
 
+#include <algorithm>
+
 #ifndef WIN32
 # include <sys/stat.h>
 # include <dirent.h>
@@ -339,4 +341,14 @@ namespace Kernel_Utils
 #endif
     return result;
   }
+
+  //============================================================================
+  // function : BackSlashToSlash  
+  // purpose  : Convert back slash to slash
+  //============================================================================ 
+  std::string BackSlashToSlash(const std::string& path) {
+         std::string res = path;
+         std::replace(res.begin(), res.end(), '\\', '/');
+         return res;
+  }
 }
index fc3e482d0aa24aff8596a2569ffe214997e2f37c..34dbc7a69f0e3f1d467d2a241ba488b97d929495 100644 (file)
@@ -68,6 +68,8 @@ namespace Kernel_Utils
   // Returns True(False) if the path (not) empty
   // Also returns False if the path is not valid
   BASICS_EXPORT bool IsEmptyDir( const std::string& path );
+
+  BASICS_EXPORT std::string BackSlashToSlash( const std::string& path );
 }
 
 #endif