Salome HOME
PR: manual correction while merge PAL_OCC to HEAD
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_TableOfStringAttribute.cxx
index 9221e9a80b821e935d54a2de77105c5354954f26..d3a3ab2e51b180b1bc80ae8bf23cb43b99a47a9a 100644 (file)
@@ -8,17 +8,17 @@
 //  Author : Sergey Ruin
 //  Module : SALOME
 
+using namespace std;
 #include <SALOMEDS_TableOfStringAttribute.ixx>
 #include <Standard_Failure.hxx>
 #include <SALOMEDS_DataMapIteratorOfDataMapOfIntegerString.hxx>
 
 #include <string>
 #include <stdio.h>
-using namespace std;
 
 const Standard_GUID& SALOMEDS_TableOfStringAttribute::GetID() 
 {
-  static Standard_GUID SALOMEDS_TableOfStringAttributeID ("128371A2-8F52-11d6-A8A3-0001021E8C7F");
+  static Standard_GUID SALOMEDS_TableOfStringAttributeID ("128371A4-8F52-11d6-A8A3-0001021E8C7F");
   return SALOMEDS_TableOfStringAttributeID;
 }
 
@@ -332,8 +332,9 @@ void SALOMEDS_TableOfStringAttribute::ConvertToString(ostrstream& theStream)
     if (anIterator.Value().Length()) { // check empty string in the value table
       theStream << anIterator.Key() << "\n";
       unsigned long aValueSize = anIterator.Value().Length();
-      theStream.write((char*)&aValueSize, sizeof(unsigned long));
+      theStream<<aValueSize << "\n";
       theStream.write((TCollection_AsciiString(anIterator.Value()).ToCString()),aValueSize);
+      theStream<<"\n";
     } else { // write index only of kind: "0key"; "05", for an example
       theStream << "0" << anIterator.Key() << "\n";
     }
@@ -409,8 +410,10 @@ bool SALOMEDS_TableOfStringAttribute::RestoreFromString(istrstream& theStream)
       aValue = "";
     else {
       unsigned long aValueSize;
-      theStream.read((char*)&aValueSize, sizeof(unsigned long));
+      theStream >> aValueSize;
+      theStream.read(aValueString, 1); // an '\n' omitting
       theStream.read(aValueString, aValueSize);
+      theStream.read(aValueString, 1); // an '\n' omitting
       aValue = aValueString;
     }
     myTable.Bind(aKey, aValue);