0028564: Support of applications using old persistence (ShapeSchema)
[occt.git] / src / StdLPersistent / StdLPersistent_HString.cxx
index 98e5d83..436f1ca 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <StdLPersistent_HString.hxx>
 #include <StdObjMgt_ReadData.hxx>
+#include <StdObjMgt_WriteData.hxx>
 #include <TDF_Label.hxx>
 #include <TDF_Tool.hxx>
 
@@ -39,6 +40,26 @@ void StdLPersistent_HString::instance<StringClass, CharType>::Read
   }
 }
 
+//=======================================================================
+//function : Write
+//purpose  : Write persistent data to a file
+//=======================================================================
+template <class StringClass, typename CharType>
+void StdLPersistent_HString::instance<StringClass, CharType>::Write
+  (StdObjMgt_WriteData& theWriteData) const
+{
+  StdObjMgt_WriteData::Object anObjectData(theWriteData);
+
+  Standard_Integer aSize = myValue->Length();
+  anObjectData << aSize;
+
+  for (Standard_Integer i = 1; i <= aSize; i++)
+  {
+    CharType aChar (0);
+    anObjectData << aChar;
+  }
+}
+
 //=======================================================================
 //function : Label
 //purpose  : Get/create a label defined by referenced string