0032402: Coding Rules - eliminate msvc warning C4668 (symbol is not defined as a...
[occt.git] / src / BinLDrivers / BinLDrivers_DocumentStorageDriver.hxx
index 4c4ed4a..e91d56c 100644 (file)
@@ -29,8 +29,9 @@
 #include <Standard_OStream.hxx>
 #include <Standard_Boolean.hxx>
 #include <Standard_Type.hxx>
+#include <TDocStd_FormatVersion.hxx>
 class BinMDF_ADriverTable;
-class CDM_MessageDriver;
+class Message_Messenger;
 class TCollection_ExtendedString;
 class CDM_Document;
 class TDF_Label;
@@ -41,7 +42,7 @@ class BinLDrivers_DocumentSection;
 class BinLDrivers_DocumentStorageDriver;
 DEFINE_STANDARD_HANDLE(BinLDrivers_DocumentStorageDriver, PCDM_StorageDriver)
 
-//! persistent implemention of storage a document in a binary file
+//! persistent implementation of storage a document in a binary file
 class BinLDrivers_DocumentStorageDriver : public PCDM_StorageDriver
 {
 
@@ -50,14 +51,18 @@ public:
   
   //! Constructor
   Standard_EXPORT BinLDrivers_DocumentStorageDriver();
-  
-  //! pure virtual method definition
-  Standard_EXPORT virtual TCollection_ExtendedString SchemaName() const Standard_OVERRIDE;
-  
+    
   //! Write <theDocument> to the binary file <theFileName>
-  Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, const TCollection_ExtendedString& theFileName) Standard_OVERRIDE;
+  Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, 
+                                      const TCollection_ExtendedString& theFileName, 
+                                      const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
+
+  //! Write <theDocument> to theOStream
+  Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, 
+                                      Standard_OStream& theOStream, 
+                                      const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
-  Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(CDM_MessageDriver)& theMsgDriver);
+  Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver);
   
   //! Create a section that should be written after the OCAF data
   Standard_EXPORT void AddSection (const TCollection_AsciiString& theName, const Standard_Boolean isPostRead = Standard_True);
@@ -71,50 +76,45 @@ protected:
 
   
   //! Write the tree under <theLabel> to the stream <theOS>
-  Standard_EXPORT void WriteSubTree (const TDF_Label& theData, Standard_OStream& theOS);
+  Standard_EXPORT void WriteSubTree (const TDF_Label& theData,
+                                     Standard_OStream& theOS, 
+                                     const Message_ProgressRange& theRange = Message_ProgressRange());
   
   //! define the procedure of writing a section to file.
-  Standard_EXPORT virtual void WriteSection (const TCollection_AsciiString& theName, const Handle(CDM_Document)& theDoc, Standard_OStream& theOS);
+  Standard_EXPORT virtual void WriteSection (const TCollection_AsciiString& /*theName*/,
+                                             const Handle(CDM_Document)&    /*theDoc*/, 
+                                             Standard_OStream&              /*theOS*/);
   
   //! defines the procedure of writing a shape  section to file
-  Standard_EXPORT virtual void WriteShapeSection (BinLDrivers_DocumentSection& theDocSection, Standard_OStream& theOS);
-  
-  //! write  theMessage  to  the  MessageDriver  of  the
-  //! Application
-  Standard_EXPORT void WriteMessage (const TCollection_ExtendedString& theMessage);
+  Standard_EXPORT virtual void WriteShapeSection (BinLDrivers_DocumentSection& theDocSection,
+                                                  Standard_OStream& theOS,
+                                                  const TDocStd_FormatVersion theDocVer,
+                                                  const Message_ProgressRange& theRange = Message_ProgressRange());
 
   Handle(BinMDF_ADriverTable) myDrivers;
   BinObjMgt_SRelocationTable myRelocTable;
-
+  Handle(Message_Messenger) myMsgDriver;
 
 private:
 
-  
   Standard_EXPORT void FirstPass (const TDF_Label& theRoot);
   
   //! Returns true if <L> and its sub-labels do not contain
   //! attributes to store
   Standard_EXPORT Standard_Boolean FirstPassSubTree (const TDF_Label& L, TDF_LabelList& ListOfEmptyL);
   
-  //! Write info secton using FSD_BinaryFile driver
-  Standard_EXPORT void WriteInfoSection (const Handle(CDM_Document)& theDocument, const TCollection_AsciiString& theFile);
+  //! Write info section using FSD_BinaryFile driver
+  Standard_EXPORT void WriteInfoSection (const Handle(CDM_Document)& theDocument, Standard_OStream& theOStream);
   
   Standard_EXPORT void UnsupportedAttrMsg (const Handle(Standard_Type)& theType);
 
   BinObjMgt_Persistent myPAtt;
-  Handle(CDM_MessageDriver) myMsgDriver;
   TDF_LabelList myEmptyLabels;
   TColStd_MapOfTransient myMapUnsupported;
   TColStd_IndexedMapOfTransient myTypesMap;
   BinLDrivers_VectorOfDocumentSection mySections;
-
+  TCollection_ExtendedString myFileName;
 
 };
 
-
-
-
-
-
-
 #endif // _BinLDrivers_DocumentStorageDriver_HeaderFile