X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangeAPI%2FExchangeAPI_Import.cpp;h=cf8b40089326b9e928d4b4d54051d8b104224de6;hb=268de14fe8b857dd33fafb349386be6e3fb4caf5;hp=76e818ebb511a51c4eff4ee8978879407d1ae05c;hpb=540e8b84d9123ec7b3f0603b38df6ed8f8e86516;p=modules%2Fshaper.git diff --git a/src/ExchangeAPI/ExchangeAPI_Import.cpp b/src/ExchangeAPI/ExchangeAPI_Import.cpp index 76e818ebb..cf8b40089 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Import.cpp @@ -10,6 +10,8 @@ #include #include //-------------------------------------------------------------------------------------- +#include + ExchangeAPI_Import::ExchangeAPI_Import( const std::shared_ptr & theFeature) : ModelHighAPI_Interface(theFeature) @@ -45,8 +47,18 @@ void ExchangeAPI_Import::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); std::string aPartName = theDumper.name(aBase->document()); - theDumper << aBase << " = model.addImport(" << aPartName << ", " - << aBase->string(ExchangePlugin_ImportFeature::FILE_PATH_ID()) << ")" << std::endl; + std::string aFilePath = aBase->string(ExchangePlugin_ImportFeature::FILE_PATH_ID())->value(); + std::string aFrom = "\\"; + std::string aTo = "\\\\"; + for(std::size_t aPos = aFilePath.find(aFrom); + aPos != std::string::npos; + aPos = aFilePath.find(aFrom, aPos)) { + aFilePath.replace(aPos, aFrom.size(), aTo); + aPos += aTo.size(); + } + + theDumper << aBase << " = model.addImport(" << aPartName << ", \"" + << aFilePath << "\")" << std::endl; // to make import have results theDumper << "model.do()" << std::endl;