Integration of OCCT 6.5.0 from SVN
[occt.git] / samples / mfc / standard / 05_ImportExport / src / FSD_Archive.hxx
CommitLineData
7fd59977 1// File generated by CPPExt (Value)
2// Copyright (C) 1991,1995 by
3//
4// MATRA DATAVISION, FRANCE
5//
6// This software is furnished in accordance with the terms and conditions
7// of the contract and with the inclusion of the above copyright notice.
8// This software or any other copy thereof may not be provided or otherwise
9// be made available to any other person. No title to an ownership of the
10// software is hereby transferred.
11//
12// At the termination of the contract, the software and all copies of this
13// software must be deleted.
14
15#ifndef _FSD_Archive_HeaderFile
16#define _FSD_Archive_HeaderFile
17
18#ifndef _FSD_CArchive_HeaderFile
19#include <FSD_CArchive.hxx>
20#endif
21#ifndef _Standard_Address_HeaderFile
22#include <Standard_Address.hxx>
23#endif
24#ifndef _Standard_Boolean_HeaderFile
25#include <Standard_Boolean.hxx>
26#endif
27#ifndef _Storage_BaseDriver_HeaderFile
28#include <Storage_BaseDriver.hxx>
29#endif
30#ifndef _Storage_Error_HeaderFile
31#include <Storage_Error.hxx>
32#endif
33#ifndef _Storage_OpenMode_HeaderFile
34#include <Storage_OpenMode.hxx>
35#endif
36#ifndef _Standard_Integer_HeaderFile
37#include <Standard_Integer.hxx>
38#endif
39#ifndef _Standard_Character_HeaderFile
40#include <Standard_Character.hxx>
41#endif
42#ifndef _Standard_ExtCharacter_HeaderFile
43#include <Standard_ExtCharacter.hxx>
44#endif
45#ifndef _Standard_Real_HeaderFile
46#include <Standard_Real.hxx>
47#endif
48#ifndef _Standard_ShortReal_HeaderFile
49#include <Standard_ShortReal.hxx>
50#endif
51#ifndef _Standard_CString_HeaderFile
52#include <Standard_CString.hxx>
53#endif
54class Storage_StreamTypeMismatchError;
55class Storage_StreamFormatError;
56class Storage_StreamWriteError;
57class Storage_StreamExtCharParityError;
58class TCollection_AsciiString;
59class TCollection_ExtendedString;
60class TColStd_SequenceOfAsciiString;
61class TColStd_SequenceOfExtendedString;
62class Storage_BaseDriver;
63
64
65#ifndef _Standard_HeaderFile
66#include <Standard.hxx>
67#endif
68#ifndef _Standard_Macro_HeaderFile
69#include <Standard_Macro.hxx>
70#endif
71
72class FSD_Archive : public Storage_BaseDriver {
73
74public:
75
76 void* operator new(size_t,void* anAddress)
77 {
78 return anAddress;
79 }
80 void* operator new(size_t size)
81 {
82 return Standard::Allocate(size);
83 }
84 void operator delete(void *anAddress)
85 {
86 if (anAddress) Standard::Free((Standard_Address&)anAddress);
87 }
88 // Methods PUBLIC
89 //
90Standard_EXPORT virtual long Tell();
91
92Standard_EXPORT FSD_Archive();
93Standard_EXPORT FSD_Archive(const FSD_CArchive& anArchive);
94Standard_EXPORT Storage_Error Open(const TCollection_AsciiString& aName,const Storage_OpenMode aMode) ;
95Standard_EXPORT Standard_Boolean IsEnd() ;
96Standard_EXPORT static Storage_Error IsGoodFileType(const TCollection_AsciiString& aName) ;
97Standard_EXPORT Storage_Error BeginWriteInfoSection() ;
98Standard_EXPORT void WriteInfo(const Standard_Integer nbObj,const TCollection_AsciiString& dbVersion,const TCollection_AsciiString& date,const TCollection_AsciiString& schemaName,const TCollection_AsciiString& schemaVersion,const TCollection_ExtendedString& appName,const TCollection_AsciiString& appVersion,const TCollection_ExtendedString& objectType,const TColStd_SequenceOfAsciiString& userInfo) ;
99Standard_EXPORT Storage_Error EndWriteInfoSection() ;
100Standard_EXPORT Storage_Error BeginReadInfoSection() ;
101Standard_EXPORT void ReadInfo(Standard_Integer& nbObj,TCollection_AsciiString& dbVersion,TCollection_AsciiString& date,TCollection_AsciiString& schemaName,TCollection_AsciiString& schemaVersion,TCollection_ExtendedString& appName,TCollection_AsciiString& appVersion,TCollection_ExtendedString& objectType,TColStd_SequenceOfAsciiString& userInfo) ;
102Standard_EXPORT Storage_Error EndReadInfoSection() ;
103Standard_EXPORT Storage_Error BeginWriteCommentSection() ;
104Standard_EXPORT void WriteComment(const TColStd_SequenceOfExtendedString& userComments) ;
105Standard_EXPORT Storage_Error EndWriteCommentSection() ;
106Standard_EXPORT Storage_Error BeginReadCommentSection() ;
107Standard_EXPORT void ReadComment(TColStd_SequenceOfExtendedString& userComments) ;
108Standard_EXPORT Storage_Error EndReadCommentSection() ;
109Standard_EXPORT Storage_Error BeginWriteTypeSection() ;
110Standard_EXPORT void SetTypeSectionSize(const Standard_Integer aSize) ;
111Standard_EXPORT void WriteTypeInformations(const Standard_Integer typeNum,const TCollection_AsciiString& typeName) ;
112Standard_EXPORT Storage_Error EndWriteTypeSection() ;
113Standard_EXPORT Storage_Error BeginReadTypeSection() ;
114Standard_EXPORT Standard_Integer TypeSectionSize() ;
115Standard_EXPORT void ReadTypeInformations(Standard_Integer& typeNum,TCollection_AsciiString& typeName) ;
116Standard_EXPORT Storage_Error EndReadTypeSection() ;
117Standard_EXPORT Storage_Error BeginWriteRootSection() ;
118Standard_EXPORT void SetRootSectionSize(const Standard_Integer aSize) ;
119Standard_EXPORT void WriteRoot(const TCollection_AsciiString& rootName,const Standard_Integer aRef,const TCollection_AsciiString& aType) ;
120Standard_EXPORT Storage_Error EndWriteRootSection() ;
121Standard_EXPORT Storage_Error BeginReadRootSection() ;
122Standard_EXPORT Standard_Integer RootSectionSize() ;
123Standard_EXPORT void ReadRoot(TCollection_AsciiString& rootName,Standard_Integer& aRef,TCollection_AsciiString& aType) ;
124Standard_EXPORT Storage_Error EndReadRootSection() ;
125Standard_EXPORT Storage_Error BeginWriteRefSection() ;
126Standard_EXPORT void SetRefSectionSize(const Standard_Integer aSize) ;
127Standard_EXPORT void WriteReferenceType(const Standard_Integer reference,const Standard_Integer typeNum) ;
128Standard_EXPORT Storage_Error EndWriteRefSection() ;
129Standard_EXPORT Storage_Error BeginReadRefSection() ;
130Standard_EXPORT Standard_Integer RefSectionSize() ;
131Standard_EXPORT void ReadReferenceType(Standard_Integer& reference,Standard_Integer& typeNum) ;
132Standard_EXPORT Storage_Error EndReadRefSection() ;
133Standard_EXPORT Storage_Error BeginWriteDataSection() ;
134Standard_EXPORT void WritePersistentObjectHeader(const Standard_Integer aRef,const Standard_Integer aType) ;
135Standard_EXPORT void BeginWritePersistentObjectData() ;
136Standard_EXPORT void BeginWriteObjectData() ;
137Standard_EXPORT void EndWriteObjectData() ;
138Standard_EXPORT void EndWritePersistentObjectData() ;
139Standard_EXPORT Storage_Error EndWriteDataSection() ;
140Standard_EXPORT Storage_Error BeginReadDataSection() ;
141Standard_EXPORT void ReadPersistentObjectHeader(Standard_Integer& aRef,Standard_Integer& aType) ;
142Standard_EXPORT void BeginReadPersistentObjectData() ;
143Standard_EXPORT void BeginReadObjectData() ;
144Standard_EXPORT void EndReadObjectData() ;
145Standard_EXPORT void EndReadPersistentObjectData() ;
146Standard_EXPORT Storage_Error EndReadDataSection() ;
147Standard_EXPORT void SkipObject() ;
148Standard_EXPORT Storage_BaseDriver& PutReference(const Standard_Integer aValue) ;
149Standard_EXPORT Storage_BaseDriver& PutCharacter(const Standard_Character aValue) ;
150 Storage_BaseDriver& operator <<(const Standard_Character aValue)
151{
152 return PutCharacter(aValue);
153}
154
155Standard_EXPORT Storage_BaseDriver& PutExtCharacter(const Standard_ExtCharacter aValue) ;
156 Storage_BaseDriver& operator <<(const Standard_ExtCharacter aValue)
157{
158 return PutExtCharacter(aValue);
159}
160
161Standard_EXPORT Storage_BaseDriver& PutInteger(const Standard_Integer aValue) ;
162 Storage_BaseDriver& operator <<(const Standard_Integer aValue)
163{
164 return PutInteger(aValue);
165}
166
167Standard_EXPORT Storage_BaseDriver& PutBoolean(const Standard_Boolean aValue) ;
168 Storage_BaseDriver& operator <<(const Standard_Boolean aValue)
169{
170 return PutBoolean(aValue);
171}
172
173Standard_EXPORT Storage_BaseDriver& PutReal(const Standard_Real aValue) ;
174 Storage_BaseDriver& operator <<(const Standard_Real aValue)
175{
176 return PutReal(aValue);
177}
178
179Standard_EXPORT Storage_BaseDriver& PutShortReal(const Standard_ShortReal aValue) ;
180 Storage_BaseDriver& operator <<(const Standard_ShortReal aValue)
181{
182 return PutShortReal(aValue);
183}
184
185Standard_EXPORT Storage_BaseDriver& GetReference(Standard_Integer& aValue) ;
186Standard_EXPORT Storage_BaseDriver& GetCharacter(Standard_Character& aValue) ;
187 Storage_BaseDriver& operator >>(Standard_Character& aValue)
188{
189 return GetCharacter(aValue);
190}
191
192Standard_EXPORT Storage_BaseDriver& GetExtCharacter(Standard_ExtCharacter& aValue) ;
193 Storage_BaseDriver& operator >>(Standard_ExtCharacter& aValue)
194{
195 return GetExtCharacter(aValue);
196}
197
198Standard_EXPORT Storage_BaseDriver& GetInteger(Standard_Integer& aValue) ;
199 Storage_BaseDriver& operator >>(Standard_Integer& aValue)
200{
201 return GetInteger(aValue);
202}
203
204Standard_EXPORT Storage_BaseDriver& GetBoolean(Standard_Boolean& aValue) ;
205 Storage_BaseDriver& operator >>(Standard_Boolean& aValue)
206{
207 return GetBoolean(aValue);
208}
209
210Standard_EXPORT Storage_BaseDriver& GetReal(Standard_Real& aValue) ;
211 Storage_BaseDriver& operator >>(Standard_Real& aValue)
212{
213 return GetReal(aValue);
214}
215
216Standard_EXPORT Storage_BaseDriver& GetShortReal(Standard_ShortReal& aValue) ;
217 Storage_BaseDriver& operator >>(Standard_ShortReal& aValue)
218{
219 return GetShortReal(aValue);
220}
221
222Standard_EXPORT Storage_Error Close() ;
223Standard_EXPORT void Destroy() ;
224~FSD_Archive()
225{
226 Destroy();
227}
228
229
230
231
232
233
234protected:
235
236 // Methods PROTECTED
237 //
238Standard_EXPORT void ReadLine(TCollection_AsciiString& buffer) ;
239Standard_EXPORT void WriteLine(const TCollection_AsciiString& buffer) ;
240Standard_EXPORT void ReadExtendedLine(TCollection_ExtendedString& buffer) ;
241Standard_EXPORT void WriteExtendedLine(const TCollection_ExtendedString& buffer) ;
242Standard_EXPORT void ReadChar(TCollection_AsciiString& buffer,const Standard_Integer rsize) ;
243Standard_EXPORT Storage_Error FindTag(const Standard_CString aTag) ;
244
245
246 // Fields PROTECTED
247 //
248
249
250private:
251
252 // Methods PRIVATE
253 //
254Standard_EXPORT static const Standard_CString MagicNumber() ;
255
256
257 // Fields PRIVATE
258 //
259FSD_CArchive myStream;
260Standard_Address myCFile;
261Standard_Boolean myEof;
262Standard_Boolean myExternFlag;
263Standard_Boolean myFormat;
264
265
266};
267
268
269
270
271
272// other Inline functions and methods (like "C++: function call" methods)
273//
274
275
276#endif