1 -- Created on: 1996-11-29
2 -- Created by: Christophe LEYNADIER
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
22 class BinaryFile from FSD
24 inherits BaseDriver from Storage
26 uses Position from Storage,
28 OpenMode from Storage,
29 AsciiString from TCollection,
30 SequenceOfAsciiString from TColStd,
31 SequenceOfExtendedString from TColStd,
32 ExtendedString from TCollection,
36 raises StreamTypeMismatchError from Storage,
37 StreamFormatError from Storage,
38 StreamWriteError from Storage,
39 StreamExtCharParityError from Storage
42 Create returns BinaryFile from FSD;
44 Open(me : in out; aName : AsciiString from TCollection; aMode : OpenMode from Storage) returns Error from Storage;
46 IsEnd(me : in out) returns Boolean from Standard;
48 Tell( me : in out ) returns Position from Storage;
49 ---Purpose: return position in the file. Return -1 upon error.
51 IsGoodFileType(myclass; aName : AsciiString from TCollection)
52 returns Error from Storage;
57 BeginWriteInfoSection(me : in out) returns Error from Storage;
59 WriteInfo(me : in out; nbObj : Integer from Standard;
60 dbVersion : AsciiString from TCollection;
61 date : AsciiString from TCollection;
62 schemaName : AsciiString from TCollection;
63 schemaVersion : AsciiString from TCollection;
64 appName : ExtendedString from TCollection;
65 appVersion : AsciiString from TCollection;
66 objectType : ExtendedString from TCollection;
67 userInfo : SequenceOfAsciiString from TColStd)
68 raises StreamWriteError;
70 EndWriteInfoSection(me : in out) returns Error from Storage;
74 BeginReadInfoSection(me : in out) returns Error from Storage;
76 ReadInfo(me : in out; nbObj : in out Integer from Standard;
77 dbVersion : in out AsciiString from TCollection;
78 date : in out AsciiString from TCollection;
79 schemaName : in out AsciiString from TCollection;
80 schemaVersion : in out AsciiString from TCollection;
81 appName : in out ExtendedString from TCollection;
82 appVersion : in out AsciiString from TCollection;
83 objectType : in out ExtendedString from TCollection;
84 userInfo : in out SequenceOfAsciiString from TColStd)
85 raises StreamTypeMismatchError,StreamExtCharParityError;
87 EndReadInfoSection(me : in out) returns Error from Storage;
92 BeginWriteCommentSection(me : in out) returns Error from Storage;
94 WriteComment(me : in out; userComments : SequenceOfExtendedString from TColStd)
95 raises StreamWriteError;
97 EndWriteCommentSection(me : in out) returns Error from Storage;
101 BeginReadCommentSection(me : in out) returns Error from Storage;
103 ReadComment(me : in out; userComments : in out SequenceOfExtendedString from TColStd)
104 raises StreamTypeMismatchError,StreamExtCharParityError;
106 EndReadCommentSection(me : in out) returns Error from Storage;
111 BeginWriteTypeSection(me : in out) returns Error from Storage;
113 SetTypeSectionSize(me : in out; aSize : Integer from Standard)
114 raises StreamWriteError;
116 WriteTypeInformations(me : in out; typeNum : Integer from Standard; typeName : AsciiString from TCollection)
117 raises StreamWriteError;
119 EndWriteTypeSection(me : in out) returns Error from Storage;
122 BeginReadTypeSection(me : in out) returns Error from Storage;
124 TypeSectionSize(me : in out) returns Integer from Standard
125 raises StreamTypeMismatchError;
127 ReadTypeInformations(me : in out; typeNum : in out Integer from Standard; typeName : in out AsciiString from TCollection)
128 raises StreamTypeMismatchError;
130 EndReadTypeSection(me : in out) returns Error from Storage;
135 BeginWriteRootSection(me : in out) returns Error from Storage;
137 SetRootSectionSize(me : in out; aSize : Integer from Standard)
138 raises StreamWriteError;
140 WriteRoot(me : in out; rootName : AsciiString from TCollection; aRef : Integer from Standard; aType : AsciiString from TCollection)
141 raises StreamWriteError;
143 EndWriteRootSection(me : in out) returns Error from Storage;
147 BeginReadRootSection(me : in out) returns Error from Storage;
149 RootSectionSize(me : in out) returns Integer from Standard
150 raises StreamTypeMismatchError;
152 ReadRoot(me : in out; rootName : in out AsciiString from TCollection; aRef : in out Integer from Standard; aType : in out AsciiString from TCollection)
153 raises StreamTypeMismatchError;
155 EndReadRootSection(me : in out) returns Error from Storage;
160 BeginWriteRefSection(me : in out) returns Error from Storage;
162 SetRefSectionSize(me : in out; aSize : Integer from Standard)
163 raises StreamWriteError;
165 WriteReferenceType(me : in out; reference : Integer from Standard; typeNum : Integer from Standard)
166 raises StreamWriteError;
168 EndWriteRefSection(me : in out) returns Error from Storage;
172 BeginReadRefSection(me : in out) returns Error from Storage;
174 RefSectionSize(me : in out) returns Integer from Standard
175 raises StreamTypeMismatchError;
177 ReadReferenceType(me : in out; reference : in out Integer from Standard; typeNum : in out Integer from Standard)
178 raises StreamTypeMismatchError;
180 EndReadRefSection(me : in out) returns Error from Storage;
185 BeginWriteDataSection(me : in out) returns Error from Storage;
187 WritePersistentObjectHeader(me : in out; aRef : Integer from Standard; aType : Integer from Standard)
188 raises StreamWriteError;
190 BeginWritePersistentObjectData(me : in out)
191 raises StreamWriteError;
193 BeginWriteObjectData(me : in out)
194 raises StreamWriteError;
196 EndWriteObjectData(me : in out)
197 raises StreamWriteError;
199 EndWritePersistentObjectData(me : in out)
200 raises StreamWriteError;
202 EndWriteDataSection(me : in out) returns Error from Storage;
206 BeginReadDataSection(me : in out) returns Error from Storage;
208 ReadPersistentObjectHeader(me : in out; aRef : in out Integer from Standard; aType : in out Integer from Standard)
209 raises StreamTypeMismatchError,StreamFormatError;
211 BeginReadPersistentObjectData(me : in out)
212 raises StreamFormatError;
214 BeginReadObjectData(me : in out)
215 raises StreamFormatError;
217 EndReadObjectData(me : in out)
218 raises StreamFormatError;
220 EndReadPersistentObjectData(me : in out)
221 raises StreamFormatError;
223 EndReadDataSection(me : in out) returns Error from Storage;
226 SkipObject(me : in out);
229 PutReference(me : in out; aValue : Integer from Standard) returns like me
230 raises StreamWriteError;
233 PutCharacter(me : in out; aValue : Character from Standard) returns like me
234 raises StreamWriteError;
235 ---C++: alias operator <<
238 PutExtCharacter(me : in out; aValue : ExtCharacter from Standard) returns like me
239 raises StreamWriteError;
240 ---C++: alias operator <<
243 PutInteger(me : in out; aValue : Integer from Standard) returns like me
244 raises StreamWriteError;
245 ---C++: alias operator <<
248 PutBoolean(me : in out; aValue : Boolean from Standard) returns like me
249 raises StreamWriteError;
250 ---C++: alias operator <<
253 PutReal(me : in out; aValue : Real from Standard) returns like me
254 raises StreamWriteError;
255 ---C++: alias operator <<
258 PutShortReal(me : in out; aValue : ShortReal from Standard) returns like me
259 raises StreamWriteError;
260 ---C++: alias operator <<
263 GetReference(me : in out; aValue : in out Integer from Standard) returns like me
264 raises StreamTypeMismatchError;
267 GetCharacter(me : in out; aValue : in out Character from Standard) returns like me
268 raises StreamTypeMismatchError;
269 ---C++: alias operator >>
272 GetExtCharacter(me : in out; aValue : in out ExtCharacter from Standard) returns like me
273 raises StreamTypeMismatchError;
274 ---C++: alias operator >>
277 GetInteger(me : in out; aValue : in out Integer from Standard) returns like me
278 raises StreamTypeMismatchError;
279 ---C++: alias operator >>
282 GetBoolean(me : in out; aValue : in out Boolean from Standard) returns like me
283 raises StreamTypeMismatchError;
284 ---C++: alias operator >>
287 GetReal(me : in out; aValue :in out Real from Standard) returns like me
288 raises StreamTypeMismatchError;
289 ---C++: alias operator >>
292 GetShortReal(me : in out; aValue : in out ShortReal from Standard) returns like me
293 raises StreamTypeMismatchError;
294 ---C++: alias operator >>
297 Close(me : in out) returns Error from Storage;
299 Destroy(me : in out);
302 WriteHeader(me : in out) is private;
303 ReadHeader(me : in out) is private;
306 returns CString from Standard is private;
309 ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Size from Standard) is protected;
310 ---Purpose: read <rsize> character from the current position.
312 ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected;
313 ---Purpose: read string from the current position.
315 WriteString(me : in out; buffer : AsciiString from TCollection) is protected;
316 ---Purpose: write string at the current position.
318 ReadExtendedString(me : in out; buffer : in out ExtendedString from TCollection) is protected;
319 ---Purpose: read string from the current position.
321 WriteExtendedString(me : in out; buffer : ExtendedString from TCollection) is protected;
322 ---Purpose: write string at the current position.
326 myStream : BStream from FSD;
327 myHeader : FileHeader from FSD;