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 CmpFile 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,
35 raises StreamTypeMismatchError from Storage,
36 StreamFormatError from Storage,
37 StreamWriteError from Storage,
38 StreamExtCharParityError from Storage
41 Create returns CmpFile from FSD;
43 Open(me : in out; aName : AsciiString from TCollection; aMode : OpenMode from Storage) returns Error from Storage;
45 IsEnd(me : in out) returns Boolean from Standard;
47 Tell( me : in out ) returns Position from Storage;
48 ---Purpose: return position in the file. Return -1 upon error.
50 IsGoodFileType(myclass; aName : AsciiString from TCollection)
51 returns Error from Storage;
56 BeginWriteInfoSection(me : in out) returns Error from Storage;
58 WriteInfo(me : in out; nbObj : Integer from Standard;
59 dbVersion : AsciiString from TCollection;
60 date : AsciiString from TCollection;
61 schemaName : AsciiString from TCollection;
62 schemaVersion : AsciiString from TCollection;
63 appName : ExtendedString from TCollection;
64 appVersion : AsciiString from TCollection;
65 objectType : ExtendedString from TCollection;
66 userInfo : SequenceOfAsciiString from TColStd)
67 raises StreamWriteError;
69 EndWriteInfoSection(me : in out) returns Error from Storage;
73 BeginReadInfoSection(me : in out) returns Error from Storage;
75 ReadInfo(me : in out; nbObj : in out Integer from Standard;
76 dbVersion : in out AsciiString from TCollection;
77 date : in out AsciiString from TCollection;
78 schemaName : in out AsciiString from TCollection;
79 schemaVersion : in out AsciiString from TCollection;
80 appName : in out ExtendedString from TCollection;
81 appVersion : in out AsciiString from TCollection;
82 objectType : in out ExtendedString from TCollection;
83 userInfo : in out SequenceOfAsciiString from TColStd)
84 raises StreamTypeMismatchError,StreamExtCharParityError;
86 EndReadInfoSection(me : in out) returns Error from Storage;
91 BeginWriteCommentSection(me : in out) returns Error from Storage;
93 WriteComment(me : in out; userComments : SequenceOfExtendedString from TColStd)
94 raises StreamWriteError;
96 EndWriteCommentSection(me : in out) returns Error from Storage;
100 BeginReadCommentSection(me : in out) returns Error from Storage;
102 ReadComment(me : in out; userComments : in out SequenceOfExtendedString from TColStd)
103 raises StreamTypeMismatchError,StreamExtCharParityError;
105 EndReadCommentSection(me : in out) returns Error from Storage;
110 BeginWriteTypeSection(me : in out) returns Error from Storage;
112 SetTypeSectionSize(me : in out; aSize : Integer from Standard)
113 raises StreamWriteError;
115 WriteTypeInformations(me : in out; typeNum : Integer from Standard; typeName : AsciiString from TCollection)
116 raises StreamWriteError;
118 EndWriteTypeSection(me : in out) returns Error from Storage;
121 BeginReadTypeSection(me : in out) returns Error from Storage;
123 TypeSectionSize(me : in out) returns Integer from Standard
124 raises StreamTypeMismatchError;
126 ReadTypeInformations(me : in out; typeNum : in out Integer from Standard; typeName : in out AsciiString from TCollection)
127 raises StreamTypeMismatchError;
129 EndReadTypeSection(me : in out) returns Error from Storage;
134 BeginWriteRootSection(me : in out) returns Error from Storage;
136 SetRootSectionSize(me : in out; aSize : Integer from Standard)
137 raises StreamWriteError;
139 WriteRoot(me : in out; rootName : AsciiString from TCollection; aRef : Integer from Standard; aType : AsciiString from TCollection)
140 raises StreamWriteError;
142 EndWriteRootSection(me : in out) returns Error from Storage;
146 BeginReadRootSection(me : in out) returns Error from Storage;
148 RootSectionSize(me : in out) returns Integer from Standard
149 raises StreamTypeMismatchError;
151 ReadRoot(me : in out; rootName : in out AsciiString from TCollection; aRef : in out Integer from Standard; aType : in out AsciiString from TCollection)
152 raises StreamTypeMismatchError;
154 EndReadRootSection(me : in out) returns Error from Storage;
159 BeginWriteRefSection(me : in out) returns Error from Storage;
161 SetRefSectionSize(me : in out; aSize : Integer from Standard)
162 raises StreamWriteError;
164 WriteReferenceType(me : in out; reference : Integer from Standard; typeNum : Integer from Standard)
165 raises StreamWriteError;
167 EndWriteRefSection(me : in out) returns Error from Storage;
171 BeginReadRefSection(me : in out) returns Error from Storage;
173 RefSectionSize(me : in out) returns Integer from Standard
174 raises StreamTypeMismatchError;
176 ReadReferenceType(me : in out; reference : in out Integer from Standard; typeNum : in out Integer from Standard)
177 raises StreamTypeMismatchError;
179 EndReadRefSection(me : in out) returns Error from Storage;
184 BeginWriteDataSection(me : in out) returns Error from Storage;
186 WritePersistentObjectHeader(me : in out; aRef : Integer from Standard; aType : Integer from Standard)
187 raises StreamWriteError;
189 BeginWritePersistentObjectData(me : in out)
190 raises StreamWriteError;
192 BeginWriteObjectData(me : in out)
193 raises StreamWriteError;
195 EndWriteObjectData(me : in out)
196 raises StreamWriteError;
198 EndWritePersistentObjectData(me : in out)
199 raises StreamWriteError;
201 EndWriteDataSection(me : in out) returns Error from Storage;
205 BeginReadDataSection(me : in out) returns Error from Storage;
207 ReadPersistentObjectHeader(me : in out; aRef : in out Integer from Standard; aType : in out Integer from Standard)
208 raises StreamTypeMismatchError,StreamFormatError;
210 BeginReadPersistentObjectData(me : in out)
211 raises StreamFormatError;
213 BeginReadObjectData(me : in out)
214 raises StreamFormatError;
216 EndReadObjectData(me : in out)
217 raises StreamFormatError;
219 EndReadPersistentObjectData(me : in out)
220 raises StreamFormatError;
222 EndReadDataSection(me : in out) returns Error from Storage;
225 SkipObject(me : in out);
228 PutReference(me : in out; aValue : Integer from Standard) returns like me
229 raises StreamWriteError;
232 PutCharacter(me : in out; aValue : Character from Standard) returns like me
233 raises StreamWriteError;
234 ---C++: alias operator <<
237 PutExtCharacter(me : in out; aValue : ExtCharacter from Standard) returns like me
238 raises StreamWriteError;
239 ---C++: alias operator <<
242 PutInteger(me : in out; aValue : Integer from Standard) returns like me
243 raises StreamWriteError;
244 ---C++: alias operator <<
247 PutBoolean(me : in out; aValue : Boolean from Standard) returns like me
248 raises StreamWriteError;
249 ---C++: alias operator <<
252 PutReal(me : in out; aValue : Real from Standard) returns like me
253 raises StreamWriteError;
254 ---C++: alias operator <<
257 PutShortReal(me : in out; aValue : ShortReal from Standard) returns like me
258 raises StreamWriteError;
259 ---C++: alias operator <<
262 GetReference(me : in out; aValue : in out Integer from Standard) returns like me
263 raises StreamTypeMismatchError;
266 GetCharacter(me : in out; aValue : in out Character from Standard) returns like me
267 raises StreamTypeMismatchError;
268 ---C++: alias operator >>
271 GetExtCharacter(me : in out; aValue : in out ExtCharacter from Standard) returns like me
272 raises StreamTypeMismatchError;
273 ---C++: alias operator >>
276 GetInteger(me : in out; aValue : in out Integer from Standard) returns like me
277 raises StreamTypeMismatchError;
278 ---C++: alias operator >>
281 GetBoolean(me : in out; aValue : in out Boolean from Standard) returns like me
282 raises StreamTypeMismatchError;
283 ---C++: alias operator >>
286 GetReal(me : in out; aValue :in out Real from Standard) returns like me
287 raises StreamTypeMismatchError;
288 ---C++: alias operator >>
291 GetShortReal(me : in out; aValue : in out ShortReal from Standard) returns like me
292 raises StreamTypeMismatchError;
293 ---C++: alias operator >>
296 Close(me : in out) returns Error from Storage;
298 Destroy(me : in out);
301 ReadLine(me : in out; buffer : in out AsciiString from TCollection) is protected;
302 ---Purpose: read from the current position to the end of line.
304 ReadWord(me : in out; buffer : in out AsciiString from TCollection) is protected;
305 ---Purpose: read from the current position to the next white space or end of line.
307 ReadExtendedLine(me : in out; buffer : in out ExtendedString from TCollection)
308 raises StreamExtCharParityError
310 ---Purpose: read extended chars (unicode) from the current position to the end of line.
312 WriteExtendedLine(me : in out; buffer : ExtendedString from TCollection) is protected;
313 ---Purpose: write from the current position to the end of line.
315 ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Size from Standard) is protected;
316 ---Purpose: read <rsize> character from the current position.
318 ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected;
319 ---Purpose: read from the first none space character position to the end of line.
321 FlushEndOfLine(me : in out) is protected;
323 FindTag(me : in out; aTag : CString from Standard) returns Error from Storage is protected;
326 returns CString from Standard is private;
329 RaiseError(me: in out ; theFailure: Type from Standard) is private;
333 myStream : FStream from FSD;