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.
24 inherits BaseDriver from Storage
26 -- A general driver which defines as a file, the
27 -- physical container for data to be stored or retrieved.
28 uses Position from Storage,
30 OpenMode from Storage,
31 AsciiString from TCollection,
32 SequenceOfAsciiString from TColStd,
33 SequenceOfExtendedString from TColStd,
34 ExtendedString from TCollection,
37 raises StreamTypeMismatchError from Storage,
38 StreamFormatError from Storage,
39 StreamWriteError from Storage,
40 StreamExtCharParityError from Storage
43 Create returns File from FSD;
45 -- Constructs a driver defining as a file, the physical
46 -- container for data to be stored or retrieved.
47 -- Use the function Open to give the name of the driven file.
48 Open(me : in out; aName : AsciiString from TCollection; aMode : OpenMode from Storage) returns Error from Storage;
50 -- Assigns as aName the name of the file to be
51 -- driven by this driver. aMode precises if the file is
52 -- opened in read or write mode.
53 -- The function returns Storage_VSOk if the file
54 -- is opened correctly, or any other value of the
55 -- Storage_Error enumeration which specifies the problem encountered.
56 IsEnd(me : in out) returns Boolean from Standard;
58 Tell( me : in out ) returns Position from Storage;
59 ---Purpose: return position in the file. Return -1 upon error.
61 IsGoodFileType(myclass; aName : AsciiString from TCollection)
62 returns Error from Storage;
67 BeginWriteInfoSection(me : in out) returns Error from Storage;
69 WriteInfo(me : in out; nbObj : Integer from Standard;
70 dbVersion : AsciiString from TCollection;
71 date : AsciiString from TCollection;
72 schemaName : AsciiString from TCollection;
73 schemaVersion : AsciiString from TCollection;
74 appName : ExtendedString from TCollection;
75 appVersion : AsciiString from TCollection;
76 objectType : ExtendedString from TCollection;
77 userInfo : SequenceOfAsciiString from TColStd)
78 raises StreamWriteError;
80 EndWriteInfoSection(me : in out) returns Error from Storage;
84 BeginReadInfoSection(me : in out) returns Error from Storage;
86 ReadInfo(me : in out; nbObj : in out Integer from Standard;
87 dbVersion : in out AsciiString from TCollection;
88 date : in out AsciiString from TCollection;
89 schemaName : in out AsciiString from TCollection;
90 schemaVersion : in out AsciiString from TCollection;
91 appName : in out ExtendedString from TCollection;
92 appVersion : in out AsciiString from TCollection;
93 objectType : in out ExtendedString from TCollection;
94 userInfo : in out SequenceOfAsciiString from TColStd)
95 raises StreamTypeMismatchError,StreamExtCharParityError;
97 EndReadInfoSection(me : in out) returns Error from Storage;
102 BeginWriteCommentSection(me : in out) returns Error from Storage;
104 WriteComment(me : in out; userComments : SequenceOfExtendedString from TColStd)
105 raises StreamWriteError;
107 EndWriteCommentSection(me : in out) returns Error from Storage;
111 BeginReadCommentSection(me : in out) returns Error from Storage;
113 ReadComment(me : in out; userComments : in out SequenceOfExtendedString from TColStd)
114 raises StreamTypeMismatchError,StreamExtCharParityError;
116 EndReadCommentSection(me : in out) returns Error from Storage;
121 BeginWriteTypeSection(me : in out) returns Error from Storage;
123 SetTypeSectionSize(me : in out; aSize : Integer from Standard)
124 raises StreamWriteError;
126 WriteTypeInformations(me : in out; typeNum : Integer from Standard; typeName : AsciiString from TCollection)
127 raises StreamWriteError;
129 EndWriteTypeSection(me : in out) returns Error from Storage;
132 BeginReadTypeSection(me : in out) returns Error from Storage;
134 TypeSectionSize(me : in out) returns Integer from Standard
135 raises StreamTypeMismatchError;
137 ReadTypeInformations(me : in out; typeNum : in out Integer from Standard; typeName : in out AsciiString from TCollection)
138 raises StreamTypeMismatchError;
140 EndReadTypeSection(me : in out) returns Error from Storage;
145 BeginWriteRootSection(me : in out) returns Error from Storage;
147 SetRootSectionSize(me : in out; aSize : Integer from Standard)
148 raises StreamWriteError;
150 WriteRoot(me : in out; rootName : AsciiString from TCollection; aRef : Integer from Standard; aType : AsciiString from TCollection)
151 raises StreamWriteError;
153 EndWriteRootSection(me : in out) returns Error from Storage;
157 BeginReadRootSection(me : in out) returns Error from Storage;
159 RootSectionSize(me : in out) returns Integer from Standard
160 raises StreamTypeMismatchError;
162 ReadRoot(me : in out; rootName : in out AsciiString from TCollection; aRef : in out Integer from Standard; aType : in out AsciiString from TCollection)
163 raises StreamTypeMismatchError;
165 EndReadRootSection(me : in out) returns Error from Storage;
170 BeginWriteRefSection(me : in out) returns Error from Storage;
172 SetRefSectionSize(me : in out; aSize : Integer from Standard)
173 raises StreamWriteError;
175 WriteReferenceType(me : in out; reference : Integer from Standard; typeNum : Integer from Standard)
176 raises StreamWriteError;
178 EndWriteRefSection(me : in out) returns Error from Storage;
182 BeginReadRefSection(me : in out) returns Error from Storage;
184 RefSectionSize(me : in out) returns Integer from Standard
185 raises StreamTypeMismatchError;
187 ReadReferenceType(me : in out; reference : in out Integer from Standard; typeNum : in out Integer from Standard)
188 raises StreamTypeMismatchError;
190 EndReadRefSection(me : in out) returns Error from Storage;
195 BeginWriteDataSection(me : in out) returns Error from Storage;
197 WritePersistentObjectHeader(me : in out; aRef : Integer from Standard; aType : Integer from Standard)
198 raises StreamWriteError;
200 BeginWritePersistentObjectData(me : in out)
201 raises StreamWriteError;
203 BeginWriteObjectData(me : in out)
204 raises StreamWriteError;
206 EndWriteObjectData(me : in out)
207 raises StreamWriteError;
209 EndWritePersistentObjectData(me : in out)
210 raises StreamWriteError;
212 EndWriteDataSection(me : in out) returns Error from Storage;
216 BeginReadDataSection(me : in out) returns Error from Storage;
218 ReadPersistentObjectHeader(me : in out; aRef : in out Integer from Standard; aType : in out Integer from Standard)
219 raises StreamTypeMismatchError,StreamFormatError;
221 BeginReadPersistentObjectData(me : in out)
222 raises StreamFormatError;
224 BeginReadObjectData(me : in out)
225 raises StreamFormatError;
227 EndReadObjectData(me : in out)
228 raises StreamFormatError;
230 EndReadPersistentObjectData(me : in out)
231 raises StreamFormatError;
233 EndReadDataSection(me : in out) returns Error from Storage;
236 SkipObject(me : in out);
239 PutReference(me : in out; aValue : Integer from Standard) returns like me
240 raises StreamWriteError;
243 PutCharacter(me : in out; aValue : Character from Standard) returns like me
244 raises StreamWriteError;
245 ---C++: alias operator <<
248 PutExtCharacter(me : in out; aValue : ExtCharacter from Standard) returns like me
249 raises StreamWriteError;
250 ---C++: alias operator <<
253 PutInteger(me : in out; aValue : Integer from Standard) returns like me
254 raises StreamWriteError;
255 ---C++: alias operator <<
258 PutBoolean(me : in out; aValue : Boolean from Standard) returns like me
259 raises StreamWriteError;
260 ---C++: alias operator <<
263 PutReal(me : in out; aValue : Real from Standard) returns like me
264 raises StreamWriteError;
265 ---C++: alias operator <<
268 PutShortReal(me : in out; aValue : ShortReal from Standard) returns like me
269 raises StreamWriteError;
270 ---C++: alias operator <<
273 GetReference(me : in out; aValue : in out Integer from Standard) returns like me
274 raises StreamTypeMismatchError;
277 GetCharacter(me : in out; aValue : in out Character from Standard) returns like me
278 raises StreamTypeMismatchError;
279 ---C++: alias operator >>
282 GetExtCharacter(me : in out; aValue : in out ExtCharacter from Standard) returns like me
283 raises StreamTypeMismatchError;
284 ---C++: alias operator >>
287 GetInteger(me : in out; aValue : in out Integer from Standard) returns like me
288 raises StreamTypeMismatchError;
289 ---C++: alias operator >>
292 GetBoolean(me : in out; aValue : in out Boolean from Standard) returns like me
293 raises StreamTypeMismatchError;
294 ---C++: alias operator >>
297 GetReal(me : in out; aValue :in out Real from Standard) returns like me
298 raises StreamTypeMismatchError;
299 ---C++: alias operator >>
302 GetShortReal(me : in out; aValue : in out ShortReal from Standard) returns like me
303 raises StreamTypeMismatchError;
304 ---C++: alias operator >>
307 Close(me : in out) returns Error from Storage;
309 -- Closes the file driven by this driver. This file was
310 -- opened by the last call to the function Open.
311 -- The function returns Storage_VSOk if the
312 -- closure is correctly done, or any other value of
313 -- the Storage_Error enumeration which specifies the problem encountered.
314 Destroy(me : in out);
317 ReadLine(me : in out; buffer : in out AsciiString from TCollection) is protected;
318 ---Purpose: read from the current position to the end of line.
320 ReadWord(me : in out; buffer : in out AsciiString from TCollection) is protected;
321 ---Purpose: read from the current position to the next white space or end of line.
323 ReadExtendedLine(me : in out; buffer : in out ExtendedString from TCollection)
324 raises StreamExtCharParityError
326 ---Purpose: read extended chars (unicode) from the current position to the end of line.
328 WriteExtendedLine(me : in out; buffer : ExtendedString from TCollection) is protected;
329 ---Purpose: write from the current position to the end of line.
331 ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Integer from Standard) is protected;
332 ---Purpose: read <rsize> character from the current position.
334 ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected;
335 ---Purpose: read from the first none space character position to the end of line.
337 FlushEndOfLine(me : in out) is protected;
339 FindTag(me : in out; aTag : CString from Standard) returns Error from Storage is protected;
342 returns CString from Standard is private;
347 myStream : FStream from FSD;