]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModelHighAPI/ModelHighAPI_Dumper.cpp
Salome HOME
[bos #29612] EDF 25161 - dump with comments
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Dumper.cpp
index 09900d6b8ce84ee5fc33821ba52d8041693bf884..5f9bf3d8dd86e53fa7662472398a5cc8e0c9fb1d 100644 (file)
@@ -1275,13 +1275,25 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
 ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
     const std::shared_ptr<ModelAPI_AttributeString>& theAttrStr)
 {
-  // escaping the quote sign in the string under dumping
+  // escaping the quote signs in the string under dumping
   std::string aStr = theAttrStr->value();
+  /*
   size_t aPos = aStr.find("\"");
   while (aPos != std::string::npos) {
     aStr.insert(aPos, "\\");
     aPos = aStr.find("\"", aPos + 2);
   }
+  aPos = aStr.find("\'");
+  while (aPos != std::string::npos) {
+    aStr.insert(aPos, "\\");
+    aPos = aStr.find("\'", aPos + 2);
+  }
+  */
+  size_t aPos = aStr.find_first_of("\"\'");
+  while (aPos != std::string::npos) {
+    aStr.insert(aPos, "\\");
+    aPos = aStr.find_first_of("\"\'", aPos + 2);
+  }
   *myDumpStorage << "'" << aStr << "'";
   return *this;
 }