0027610: Some spelling mistakes in documentation of "Building with CMake"
[occt.git] / src / BinLDrivers / BinLDrivers_DocumentStorageDriver.hxx
CommitLineData
42cf5bc1 1// Created on: 2002-10-29
2// Created by: Michael SAZONOV
3// Copyright (c) 2002-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _BinLDrivers_DocumentStorageDriver_HeaderFile
17#define _BinLDrivers_DocumentStorageDriver_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_Type.hxx>
21
22#include <BinObjMgt_Persistent.hxx>
23#include <BinObjMgt_SRelocationTable.hxx>
24#include <TDF_LabelList.hxx>
25#include <TColStd_MapOfTransient.hxx>
26#include <TColStd_IndexedMapOfTransient.hxx>
27#include <BinLDrivers_VectorOfDocumentSection.hxx>
28#include <PCDM_StorageDriver.hxx>
29#include <Standard_OStream.hxx>
30#include <Standard_Boolean.hxx>
31#include <Standard_Type.hxx>
32class BinMDF_ADriverTable;
33class CDM_MessageDriver;
34class TCollection_ExtendedString;
35class CDM_Document;
36class TDF_Label;
37class TCollection_AsciiString;
38class BinLDrivers_DocumentSection;
39
40
41class BinLDrivers_DocumentStorageDriver;
42DEFINE_STANDARD_HANDLE(BinLDrivers_DocumentStorageDriver, PCDM_StorageDriver)
43
44//! persistent implemention of storage a document in a binary file
45class BinLDrivers_DocumentStorageDriver : public PCDM_StorageDriver
46{
47
48public:
49
50
51 //! Constructor
52 Standard_EXPORT BinLDrivers_DocumentStorageDriver();
53
54 //! pure virtual method definition
55 Standard_EXPORT virtual TCollection_ExtendedString SchemaName() const Standard_OVERRIDE;
56
57 //! Write <theDocument> to the binary file <theFileName>
58 Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, const TCollection_ExtendedString& theFileName) Standard_OVERRIDE;
4ff92abe 59
60 //! Write <theDocument> to theOStream
61 Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, Standard_OStream& theOStream) Standard_OVERRIDE;
42cf5bc1 62
63 Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(CDM_MessageDriver)& theMsgDriver);
64
65 //! Create a section that should be written after the OCAF data
66 Standard_EXPORT void AddSection (const TCollection_AsciiString& theName, const Standard_Boolean isPostRead = Standard_True);
67
68
69
70
92efcf78 71 DEFINE_STANDARD_RTTIEXT(BinLDrivers_DocumentStorageDriver,PCDM_StorageDriver)
42cf5bc1 72
73protected:
74
75
76 //! Write the tree under <theLabel> to the stream <theOS>
77 Standard_EXPORT void WriteSubTree (const TDF_Label& theData, Standard_OStream& theOS);
78
79 //! define the procedure of writing a section to file.
80 Standard_EXPORT virtual void WriteSection (const TCollection_AsciiString& theName, const Handle(CDM_Document)& theDoc, Standard_OStream& theOS);
81
82 //! defines the procedure of writing a shape section to file
83 Standard_EXPORT virtual void WriteShapeSection (BinLDrivers_DocumentSection& theDocSection, Standard_OStream& theOS);
84
85 //! write theMessage to the MessageDriver of the
86 //! Application
87 Standard_EXPORT void WriteMessage (const TCollection_ExtendedString& theMessage);
88
89 Handle(BinMDF_ADriverTable) myDrivers;
90 BinObjMgt_SRelocationTable myRelocTable;
91
92
93private:
94
95
96 Standard_EXPORT void FirstPass (const TDF_Label& theRoot);
97
98 //! Returns true if <L> and its sub-labels do not contain
99 //! attributes to store
100 Standard_EXPORT Standard_Boolean FirstPassSubTree (const TDF_Label& L, TDF_LabelList& ListOfEmptyL);
101
102 //! Write info secton using FSD_BinaryFile driver
4ff92abe 103 Standard_EXPORT void WriteInfoSection (const Handle(CDM_Document)& theDocument, Standard_OStream& theOStream);
42cf5bc1 104
105 Standard_EXPORT void UnsupportedAttrMsg (const Handle(Standard_Type)& theType);
106
107 BinObjMgt_Persistent myPAtt;
108 Handle(CDM_MessageDriver) myMsgDriver;
109 TDF_LabelList myEmptyLabels;
110 TColStd_MapOfTransient myMapUnsupported;
111 TColStd_IndexedMapOfTransient myTypesMap;
112 BinLDrivers_VectorOfDocumentSection mySections;
4ff92abe 113 TCollection_ExtendedString myFileName;
42cf5bc1 114
115
116};
117
118
119
120
121
122
123
124#endif // _BinLDrivers_DocumentStorageDriver_HeaderFile