From fe5ea3510b95a62e53548b5f4130d1dc25b9c433 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 13 May 2019 16:36:02 +0300 Subject: [PATCH] Fix for "[CEA]: Windows version: Dump Python: there is an error in the file name generated for geompy.ImportXAO" issue. --- src/Basics/Basics_DirUtils.cxx | 12 ++++++++++++ src/Basics/Basics_DirUtils.hxx | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/Basics/Basics_DirUtils.cxx b/src/Basics/Basics_DirUtils.cxx index daa4b8f55..8a1974a96 100644 --- a/src/Basics/Basics_DirUtils.cxx +++ b/src/Basics/Basics_DirUtils.cxx @@ -27,6 +27,8 @@ #include #include +#include + #ifndef WIN32 # include # include @@ -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; + } } diff --git a/src/Basics/Basics_DirUtils.hxx b/src/Basics/Basics_DirUtils.hxx index fc3e482d0..34dbc7a69 100644 --- a/src/Basics/Basics_DirUtils.hxx +++ b/src/Basics/Basics_DirUtils.hxx @@ -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 -- 2.39.2