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 |
54 | class Storage_StreamTypeMismatchError; |
55 | class Storage_StreamFormatError; |
56 | class Storage_StreamWriteError; |
57 | class Storage_StreamExtCharParityError; |
58 | class TCollection_AsciiString; |
59 | class TCollection_ExtendedString; |
60 | class TColStd_SequenceOfAsciiString; |
61 | class TColStd_SequenceOfExtendedString; |
62 | class 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 | |
72 | class FSD_Archive : public Storage_BaseDriver { |
73 | |
74 | public: |
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 | // |
90 | Standard_EXPORT virtual long Tell(); |
91 | |
92 | Standard_EXPORT FSD_Archive(); |
93 | Standard_EXPORT FSD_Archive(const FSD_CArchive& anArchive); |
94 | Standard_EXPORT Storage_Error Open(const TCollection_AsciiString& aName,const Storage_OpenMode aMode) ; |
95 | Standard_EXPORT Standard_Boolean IsEnd() ; |
96 | Standard_EXPORT static Storage_Error IsGoodFileType(const TCollection_AsciiString& aName) ; |
97 | Standard_EXPORT Storage_Error BeginWriteInfoSection() ; |
98 | Standard_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) ; |
99 | Standard_EXPORT Storage_Error EndWriteInfoSection() ; |
100 | Standard_EXPORT Storage_Error BeginReadInfoSection() ; |
101 | Standard_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) ; |
102 | Standard_EXPORT Storage_Error EndReadInfoSection() ; |
103 | Standard_EXPORT Storage_Error BeginWriteCommentSection() ; |
104 | Standard_EXPORT void WriteComment(const TColStd_SequenceOfExtendedString& userComments) ; |
105 | Standard_EXPORT Storage_Error EndWriteCommentSection() ; |
106 | Standard_EXPORT Storage_Error BeginReadCommentSection() ; |
107 | Standard_EXPORT void ReadComment(TColStd_SequenceOfExtendedString& userComments) ; |
108 | Standard_EXPORT Storage_Error EndReadCommentSection() ; |
109 | Standard_EXPORT Storage_Error BeginWriteTypeSection() ; |
110 | Standard_EXPORT void SetTypeSectionSize(const Standard_Integer aSize) ; |
111 | Standard_EXPORT void WriteTypeInformations(const Standard_Integer typeNum,const TCollection_AsciiString& typeName) ; |
112 | Standard_EXPORT Storage_Error EndWriteTypeSection() ; |
113 | Standard_EXPORT Storage_Error BeginReadTypeSection() ; |
114 | Standard_EXPORT Standard_Integer TypeSectionSize() ; |
115 | Standard_EXPORT void ReadTypeInformations(Standard_Integer& typeNum,TCollection_AsciiString& typeName) ; |
116 | Standard_EXPORT Storage_Error EndReadTypeSection() ; |
117 | Standard_EXPORT Storage_Error BeginWriteRootSection() ; |
118 | Standard_EXPORT void SetRootSectionSize(const Standard_Integer aSize) ; |
119 | Standard_EXPORT void WriteRoot(const TCollection_AsciiString& rootName,const Standard_Integer aRef,const TCollection_AsciiString& aType) ; |
120 | Standard_EXPORT Storage_Error EndWriteRootSection() ; |
121 | Standard_EXPORT Storage_Error BeginReadRootSection() ; |
122 | Standard_EXPORT Standard_Integer RootSectionSize() ; |
123 | Standard_EXPORT void ReadRoot(TCollection_AsciiString& rootName,Standard_Integer& aRef,TCollection_AsciiString& aType) ; |
124 | Standard_EXPORT Storage_Error EndReadRootSection() ; |
125 | Standard_EXPORT Storage_Error BeginWriteRefSection() ; |
126 | Standard_EXPORT void SetRefSectionSize(const Standard_Integer aSize) ; |
127 | Standard_EXPORT void WriteReferenceType(const Standard_Integer reference,const Standard_Integer typeNum) ; |
128 | Standard_EXPORT Storage_Error EndWriteRefSection() ; |
129 | Standard_EXPORT Storage_Error BeginReadRefSection() ; |
130 | Standard_EXPORT Standard_Integer RefSectionSize() ; |
131 | Standard_EXPORT void ReadReferenceType(Standard_Integer& reference,Standard_Integer& typeNum) ; |
132 | Standard_EXPORT Storage_Error EndReadRefSection() ; |
133 | Standard_EXPORT Storage_Error BeginWriteDataSection() ; |
134 | Standard_EXPORT void WritePersistentObjectHeader(const Standard_Integer aRef,const Standard_Integer aType) ; |
135 | Standard_EXPORT void BeginWritePersistentObjectData() ; |
136 | Standard_EXPORT void BeginWriteObjectData() ; |
137 | Standard_EXPORT void EndWriteObjectData() ; |
138 | Standard_EXPORT void EndWritePersistentObjectData() ; |
139 | Standard_EXPORT Storage_Error EndWriteDataSection() ; |
140 | Standard_EXPORT Storage_Error BeginReadDataSection() ; |
141 | Standard_EXPORT void ReadPersistentObjectHeader(Standard_Integer& aRef,Standard_Integer& aType) ; |
142 | Standard_EXPORT void BeginReadPersistentObjectData() ; |
143 | Standard_EXPORT void BeginReadObjectData() ; |
144 | Standard_EXPORT void EndReadObjectData() ; |
145 | Standard_EXPORT void EndReadPersistentObjectData() ; |
146 | Standard_EXPORT Storage_Error EndReadDataSection() ; |
147 | Standard_EXPORT void SkipObject() ; |
148 | Standard_EXPORT Storage_BaseDriver& PutReference(const Standard_Integer aValue) ; |
149 | Standard_EXPORT Storage_BaseDriver& PutCharacter(const Standard_Character aValue) ; |
150 | Storage_BaseDriver& operator <<(const Standard_Character aValue) |
151 | { |
152 | return PutCharacter(aValue); |
153 | } |
154 | |
155 | Standard_EXPORT Storage_BaseDriver& PutExtCharacter(const Standard_ExtCharacter aValue) ; |
156 | Storage_BaseDriver& operator <<(const Standard_ExtCharacter aValue) |
157 | { |
158 | return PutExtCharacter(aValue); |
159 | } |
160 | |
161 | Standard_EXPORT Storage_BaseDriver& PutInteger(const Standard_Integer aValue) ; |
162 | Storage_BaseDriver& operator <<(const Standard_Integer aValue) |
163 | { |
164 | return PutInteger(aValue); |
165 | } |
166 | |
167 | Standard_EXPORT Storage_BaseDriver& PutBoolean(const Standard_Boolean aValue) ; |
168 | Storage_BaseDriver& operator <<(const Standard_Boolean aValue) |
169 | { |
170 | return PutBoolean(aValue); |
171 | } |
172 | |
173 | Standard_EXPORT Storage_BaseDriver& PutReal(const Standard_Real aValue) ; |
174 | Storage_BaseDriver& operator <<(const Standard_Real aValue) |
175 | { |
176 | return PutReal(aValue); |
177 | } |
178 | |
179 | Standard_EXPORT Storage_BaseDriver& PutShortReal(const Standard_ShortReal aValue) ; |
180 | Storage_BaseDriver& operator <<(const Standard_ShortReal aValue) |
181 | { |
182 | return PutShortReal(aValue); |
183 | } |
184 | |
185 | Standard_EXPORT Storage_BaseDriver& GetReference(Standard_Integer& aValue) ; |
186 | Standard_EXPORT Storage_BaseDriver& GetCharacter(Standard_Character& aValue) ; |
187 | Storage_BaseDriver& operator >>(Standard_Character& aValue) |
188 | { |
189 | return GetCharacter(aValue); |
190 | } |
191 | |
192 | Standard_EXPORT Storage_BaseDriver& GetExtCharacter(Standard_ExtCharacter& aValue) ; |
193 | Storage_BaseDriver& operator >>(Standard_ExtCharacter& aValue) |
194 | { |
195 | return GetExtCharacter(aValue); |
196 | } |
197 | |
198 | Standard_EXPORT Storage_BaseDriver& GetInteger(Standard_Integer& aValue) ; |
199 | Storage_BaseDriver& operator >>(Standard_Integer& aValue) |
200 | { |
201 | return GetInteger(aValue); |
202 | } |
203 | |
204 | Standard_EXPORT Storage_BaseDriver& GetBoolean(Standard_Boolean& aValue) ; |
205 | Storage_BaseDriver& operator >>(Standard_Boolean& aValue) |
206 | { |
207 | return GetBoolean(aValue); |
208 | } |
209 | |
210 | Standard_EXPORT Storage_BaseDriver& GetReal(Standard_Real& aValue) ; |
211 | Storage_BaseDriver& operator >>(Standard_Real& aValue) |
212 | { |
213 | return GetReal(aValue); |
214 | } |
215 | |
216 | Standard_EXPORT Storage_BaseDriver& GetShortReal(Standard_ShortReal& aValue) ; |
217 | Storage_BaseDriver& operator >>(Standard_ShortReal& aValue) |
218 | { |
219 | return GetShortReal(aValue); |
220 | } |
221 | |
222 | Standard_EXPORT Storage_Error Close() ; |
223 | Standard_EXPORT void Destroy() ; |
224 | ~FSD_Archive() |
225 | { |
226 | Destroy(); |
227 | } |
228 | |
229 | |
230 | |
231 | |
232 | |
233 | |
234 | protected: |
235 | |
236 | // Methods PROTECTED |
237 | // |
238 | Standard_EXPORT void ReadLine(TCollection_AsciiString& buffer) ; |
239 | Standard_EXPORT void WriteLine(const TCollection_AsciiString& buffer) ; |
240 | Standard_EXPORT void ReadExtendedLine(TCollection_ExtendedString& buffer) ; |
241 | Standard_EXPORT void WriteExtendedLine(const TCollection_ExtendedString& buffer) ; |
242 | Standard_EXPORT void ReadChar(TCollection_AsciiString& buffer,const Standard_Integer rsize) ; |
243 | Standard_EXPORT Storage_Error FindTag(const Standard_CString aTag) ; |
244 | |
245 | |
246 | // Fields PROTECTED |
247 | // |
248 | |
249 | |
250 | private: |
251 | |
252 | // Methods PRIVATE |
253 | // |
254 | Standard_EXPORT static const Standard_CString MagicNumber() ; |
255 | |
256 | |
257 | // Fields PRIVATE |
258 | // |
259 | FSD_CArchive myStream; |
260 | Standard_Address myCFile; |
261 | Standard_Boolean myEof; |
262 | Standard_Boolean myExternFlag; |
263 | Standard_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 |