File indexing completed on 2026-05-04 08:44:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _BinLDrivers_DocumentStorageDriver_HeaderFile
0017 #define _BinLDrivers_DocumentStorageDriver_HeaderFile
0018
0019 #include <Standard.hxx>
0020
0021 #include <BinObjMgt_Persistent.hxx>
0022 #include <BinObjMgt_SRelocationTable.hxx>
0023 #include <TDF_LabelList.hxx>
0024 #include <TColStd_MapOfTransient.hxx>
0025 #include <TColStd_IndexedMapOfTransient.hxx>
0026 #include <BinLDrivers_VectorOfDocumentSection.hxx>
0027 #include <PCDM_StorageDriver.hxx>
0028 #include <Standard_OStream.hxx>
0029 #include <Standard_Type.hxx>
0030 #include <TDocStd_FormatVersion.hxx>
0031 class BinMDF_ADriverTable;
0032 class Message_Messenger;
0033 class CDM_Document;
0034 class TDF_Label;
0035 class TCollection_AsciiString;
0036 class BinLDrivers_DocumentSection;
0037 class BinObjMgt_Position;
0038
0039 class BinLDrivers_DocumentStorageDriver;
0040 DEFINE_STANDARD_HANDLE(BinLDrivers_DocumentStorageDriver, PCDM_StorageDriver)
0041
0042
0043 class BinLDrivers_DocumentStorageDriver : public PCDM_StorageDriver
0044 {
0045
0046 public:
0047
0048 Standard_EXPORT BinLDrivers_DocumentStorageDriver();
0049
0050
0051 Standard_EXPORT virtual void Write(
0052 const Handle(CDM_Document)& theDocument,
0053 const TCollection_ExtendedString& theFileName,
0054 const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0055
0056
0057 Standard_EXPORT virtual void Write(
0058 const Handle(CDM_Document)& theDocument,
0059 Standard_OStream& theOStream,
0060 const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0061
0062 Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers(
0063 const Handle(Message_Messenger)& theMsgDriver);
0064
0065
0066 Standard_EXPORT void AddSection(const TCollection_AsciiString& theName,
0067 const Standard_Boolean isPostRead = Standard_True);
0068
0069
0070 Standard_EXPORT Standard_Boolean IsQuickPart(const Standard_Integer theVersion) const;
0071
0072 DEFINE_STANDARD_RTTIEXT(BinLDrivers_DocumentStorageDriver, PCDM_StorageDriver)
0073
0074 protected:
0075
0076 Standard_EXPORT void WriteSubTree(
0077 const TDF_Label& theData,
0078 Standard_OStream& theOS,
0079 const Standard_Boolean& theQuickPart,
0080 const Message_ProgressRange& theRange = Message_ProgressRange());
0081
0082
0083 Standard_EXPORT virtual void WriteSection(const TCollection_AsciiString& ,
0084 const Handle(CDM_Document)& ,
0085 Standard_OStream& );
0086
0087
0088 Standard_EXPORT virtual void WriteShapeSection(
0089 BinLDrivers_DocumentSection& theDocSection,
0090 Standard_OStream& theOS,
0091 const TDocStd_FormatVersion theDocVer,
0092 const Message_ProgressRange& theRange = Message_ProgressRange());
0093
0094
0095 Standard_EXPORT virtual void EnableQuickPartWriting(
0096 const Handle(Message_Messenger)& ,
0097 const Standard_Boolean )
0098 {
0099 }
0100
0101
0102 Standard_EXPORT virtual void Clear();
0103
0104 Handle(BinMDF_ADriverTable) myDrivers;
0105 BinObjMgt_SRelocationTable myRelocTable;
0106 Handle(Message_Messenger) myMsgDriver;
0107
0108 private:
0109 Standard_EXPORT void FirstPass(const TDF_Label& theRoot);
0110
0111
0112
0113 Standard_EXPORT Standard_Boolean FirstPassSubTree(const TDF_Label& L,
0114 TDF_LabelList& ListOfEmptyL);
0115
0116
0117 Standard_EXPORT void WriteInfoSection(const Handle(CDM_Document)& theDocument,
0118 Standard_OStream& theOStream);
0119
0120 Standard_EXPORT void UnsupportedAttrMsg(const Handle(Standard_Type)& theType);
0121
0122
0123 Standard_EXPORT void WriteSizes(Standard_OStream& theOS);
0124
0125 BinObjMgt_Persistent myPAtt;
0126 TDF_LabelList myEmptyLabels;
0127 TColStd_MapOfTransient myMapUnsupported;
0128 TColStd_IndexedMapOfTransient myTypesMap;
0129 BinLDrivers_VectorOfDocumentSection mySections;
0130 TCollection_ExtendedString myFileName;
0131
0132 NCollection_List<Handle(BinObjMgt_Position)> mySizesToWrite;
0133 };
0134
0135 #endif