0032402: Coding Rules - eliminate msvc warning C4668 (symbol is not defined as a...
[occt.git] / src / BinLDrivers / BinLDrivers_DocumentRetrievalDriver.hxx
CommitLineData
42cf5bc1 1// Created on: 2002-10-31
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_DocumentRetrievalDriver_HeaderFile
17#define _BinLDrivers_DocumentRetrievalDriver_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_Type.hxx>
21
22#include <BinObjMgt_Persistent.hxx>
23#include <BinObjMgt_RRelocationTable.hxx>
24#include <TColStd_MapOfInteger.hxx>
25#include <BinLDrivers_VectorOfDocumentSection.hxx>
26#include <PCDM_RetrievalDriver.hxx>
27#include <Standard_Integer.hxx>
28#include <Standard_IStream.hxx>
29#include <Storage_Position.hxx>
30#include <Standard_Boolean.hxx>
4ff92abe 31#include <Storage_Data.hxx>
32
42cf5bc1 33class BinMDF_ADriverTable;
83ae3591 34class Message_Messenger;
42cf5bc1 35class TCollection_ExtendedString;
36class PCDM_Document;
37class CDM_Document;
38class CDM_Application;
39class TDF_Label;
40class TCollection_AsciiString;
41class Storage_HeaderData;
42class BinLDrivers_DocumentSection;
43
44
45class BinLDrivers_DocumentRetrievalDriver;
46DEFINE_STANDARD_HANDLE(BinLDrivers_DocumentRetrievalDriver, PCDM_RetrievalDriver)
47
48
49class BinLDrivers_DocumentRetrievalDriver : public PCDM_RetrievalDriver
50{
51
52public:
53
54
55 //! Constructor
56 Standard_EXPORT BinLDrivers_DocumentRetrievalDriver();
57
42cf5bc1 58 //! retrieves the content of the file into a new Document.
6d8f9f4a 59 Standard_EXPORT virtual void Read (const TCollection_ExtendedString& theFileName,
60 const Handle(CDM_Document)& theNewDocument,
61 const Handle(CDM_Application)& theApplication,
7e785937 62 const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
4ff92abe 63
64 Standard_EXPORT virtual void Read (Standard_IStream& theIStream,
65 const Handle(Storage_Data)& theStorageData,
66 const Handle(CDM_Document)& theDoc,
6d8f9f4a 67 const Handle(CDM_Application)& theApplication,
7e785937 68 const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
42cf5bc1 69
83ae3591 70 Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver);
42cf5bc1 71
72
73
74
92efcf78 75 DEFINE_STANDARD_RTTIEXT(BinLDrivers_DocumentRetrievalDriver,PCDM_RetrievalDriver)
42cf5bc1 76
77protected:
78
79
80 //! Read the tree from the stream <theIS> to <theLabel>
6d8f9f4a 81 Standard_EXPORT virtual Standard_Integer ReadSubTree
82 (Standard_IStream& theIS,
83 const TDF_Label& theData,
7e785937 84 const Message_ProgressRange& theRanges = Message_ProgressRange());
42cf5bc1 85
42cf5bc1 86
87 //! define the procedure of reading a section to file.
6d8f9f4a 88 Standard_EXPORT virtual void ReadSection
89 (BinLDrivers_DocumentSection& theSection,
90 const Handle(CDM_Document)& theDoc,
91 Standard_IStream& theIS);
42cf5bc1 92
bf954475 93 //! define the procedure of reading a shapes section to file.
6d8f9f4a 94 Standard_EXPORT virtual void ReadShapeSection
95 (BinLDrivers_DocumentSection& theSection,
96 Standard_IStream& theIS,
97 const Standard_Boolean isMess = Standard_False,
7e785937 98 const Message_ProgressRange& theRange = Message_ProgressRange());
42cf5bc1 99
b81b237f 100 //! checks the shapes section can be correctly retrieved.
42cf5bc1 101 Standard_EXPORT virtual void CheckShapeSection (const Storage_Position& thePos, Standard_IStream& theIS);
bf954475 102
103 //! clears the reading-cash data in drivers if any.
104 Standard_EXPORT virtual void Clear();
42cf5bc1 105
106 //! Check a file version(in which file was written) with a current version.
107 //! Redefining this method is a chance for application to read files
108 //! written by newer applications.
109 //! The default implementation: if the version of the file is greater than the
110 //! current or lesser than 2, then return false, else true
111 Standard_EXPORT virtual Standard_Boolean CheckDocumentVersion (const Standard_Integer theFileVersion, const Standard_Integer theCurVersion);
42cf5bc1 112
113 Handle(BinMDF_ADriverTable) myDrivers;
114 BinObjMgt_RRelocationTable myRelocTable;
83ae3591 115 Handle(Message_Messenger) myMsgDriver;
42cf5bc1 116
117private:
118
119
120 BinObjMgt_Persistent myPAtt;
42cf5bc1 121 TColStd_MapOfInteger myMapUnsupported;
122 BinLDrivers_VectorOfDocumentSection mySections;
123
124
125};
126
127
128
129
130
131
132
133#endif // _BinLDrivers_DocumentRetrievalDriver_HeaderFile