7fd59977 |
1 | -- File: FSD_BinaryFile.cdl |
2 | -- Created: Fri Nov 29 13:03:05 1996 |
3 | -- Author: Christophe LEYNADIER |
4 | -- <cle@parigox.paris1.matra-dtv.fr> |
5 | ---Copyright: Matra Datavision 1996 |
6 | |
7 | class BinaryFile from FSD |
8 | |
9 | inherits BaseDriver from Storage |
10 | |
11 | uses Position from Storage, |
12 | Error from Storage, |
13 | OpenMode from Storage, |
14 | AsciiString from TCollection, |
15 | SequenceOfAsciiString from TColStd, |
16 | SequenceOfExtendedString from TColStd, |
17 | ExtendedString from TCollection, |
18 | FileHeader from FSD, |
19 | BStream from FSD |
20 | |
21 | raises StreamTypeMismatchError from Storage, |
22 | StreamFormatError from Storage, |
23 | StreamWriteError from Storage, |
24 | StreamExtCharParityError from Storage |
25 | |
26 | is |
27 | Create returns BinaryFile from FSD; |
28 | |
29 | Open(me : in out; aName : AsciiString from TCollection; aMode : OpenMode from Storage) returns Error from Storage; |
30 | |
31 | IsEnd(me : in out) returns Boolean from Standard; |
32 | |
33 | Tell( me : in out ) returns Position from Storage; |
34 | ---Purpose: return position in the file. Return -1 upon error. |
35 | |
36 | IsGoodFileType(myclass; aName : AsciiString from TCollection) |
37 | returns Error from Storage; |
38 | |
39 | -- INFO SECTION |
40 | -- write |
41 | -- |
42 | BeginWriteInfoSection(me : in out) returns Error from Storage; |
43 | |
44 | WriteInfo(me : in out; nbObj : Integer from Standard; |
45 | dbVersion : AsciiString from TCollection; |
46 | date : AsciiString from TCollection; |
47 | schemaName : AsciiString from TCollection; |
48 | schemaVersion : AsciiString from TCollection; |
49 | appName : ExtendedString from TCollection; |
50 | appVersion : AsciiString from TCollection; |
51 | objectType : ExtendedString from TCollection; |
52 | userInfo : SequenceOfAsciiString from TColStd) |
53 | raises StreamWriteError; |
54 | |
55 | EndWriteInfoSection(me : in out) returns Error from Storage; |
56 | |
57 | -- read |
58 | -- |
59 | BeginReadInfoSection(me : in out) returns Error from Storage; |
60 | |
61 | ReadInfo(me : in out; nbObj : in out Integer from Standard; |
62 | dbVersion : in out AsciiString from TCollection; |
63 | date : in out AsciiString from TCollection; |
64 | schemaName : in out AsciiString from TCollection; |
65 | schemaVersion : in out AsciiString from TCollection; |
66 | appName : in out ExtendedString from TCollection; |
67 | appVersion : in out AsciiString from TCollection; |
68 | objectType : in out ExtendedString from TCollection; |
69 | userInfo : in out SequenceOfAsciiString from TColStd) |
70 | raises StreamTypeMismatchError,StreamExtCharParityError; |
71 | |
72 | EndReadInfoSection(me : in out) returns Error from Storage; |
73 | |
74 | -- COMMENTS SECTION |
75 | -- write |
76 | -- |
77 | BeginWriteCommentSection(me : in out) returns Error from Storage; |
78 | |
79 | WriteComment(me : in out; userComments : SequenceOfExtendedString from TColStd) |
80 | raises StreamWriteError; |
81 | |
82 | EndWriteCommentSection(me : in out) returns Error from Storage; |
83 | |
84 | -- read |
85 | -- |
86 | BeginReadCommentSection(me : in out) returns Error from Storage; |
87 | |
88 | ReadComment(me : in out; userComments : in out SequenceOfExtendedString from TColStd) |
89 | raises StreamTypeMismatchError,StreamExtCharParityError; |
90 | |
91 | EndReadCommentSection(me : in out) returns Error from Storage; |
92 | |
93 | |
94 | -- TYPE SECTION |
95 | -- |
96 | BeginWriteTypeSection(me : in out) returns Error from Storage; |
97 | |
98 | SetTypeSectionSize(me : in out; aSize : Integer from Standard) |
99 | raises StreamWriteError; |
100 | |
101 | WriteTypeInformations(me : in out; typeNum : Integer from Standard; typeName : AsciiString from TCollection) |
102 | raises StreamWriteError; |
103 | |
104 | EndWriteTypeSection(me : in out) returns Error from Storage; |
105 | |
106 | -- read |
107 | BeginReadTypeSection(me : in out) returns Error from Storage; |
108 | |
109 | TypeSectionSize(me : in out) returns Integer from Standard |
110 | raises StreamTypeMismatchError; |
111 | |
112 | ReadTypeInformations(me : in out; typeNum : in out Integer from Standard; typeName : in out AsciiString from TCollection) |
113 | raises StreamTypeMismatchError; |
114 | |
115 | EndReadTypeSection(me : in out) returns Error from Storage; |
116 | |
117 | -- ROOT SECTION |
118 | -- write |
119 | -- |
120 | BeginWriteRootSection(me : in out) returns Error from Storage; |
121 | |
122 | SetRootSectionSize(me : in out; aSize : Integer from Standard) |
123 | raises StreamWriteError; |
124 | |
125 | WriteRoot(me : in out; rootName : AsciiString from TCollection; aRef : Integer from Standard; aType : AsciiString from TCollection) |
126 | raises StreamWriteError; |
127 | |
128 | EndWriteRootSection(me : in out) returns Error from Storage; |
129 | |
130 | -- read |
131 | -- |
132 | BeginReadRootSection(me : in out) returns Error from Storage; |
133 | |
134 | RootSectionSize(me : in out) returns Integer from Standard |
135 | raises StreamTypeMismatchError; |
136 | |
137 | ReadRoot(me : in out; rootName : in out AsciiString from TCollection; aRef : in out Integer from Standard; aType : in out AsciiString from TCollection) |
138 | raises StreamTypeMismatchError; |
139 | |
140 | EndReadRootSection(me : in out) returns Error from Storage; |
141 | |
142 | -- REF SECTION |
143 | -- write |
144 | -- |
145 | BeginWriteRefSection(me : in out) returns Error from Storage; |
146 | |
147 | SetRefSectionSize(me : in out; aSize : Integer from Standard) |
148 | raises StreamWriteError; |
149 | |
150 | WriteReferenceType(me : in out; reference : Integer from Standard; typeNum : Integer from Standard) |
151 | raises StreamWriteError; |
152 | |
153 | EndWriteRefSection(me : in out) returns Error from Storage; |
154 | |
155 | -- read |
156 | -- |
157 | BeginReadRefSection(me : in out) returns Error from Storage; |
158 | |
159 | RefSectionSize(me : in out) returns Integer from Standard |
160 | raises StreamTypeMismatchError; |
161 | |
162 | ReadReferenceType(me : in out; reference : in out Integer from Standard; typeNum : in out Integer from Standard) |
163 | raises StreamTypeMismatchError; |
164 | |
165 | EndReadRefSection(me : in out) returns Error from Storage; |
166 | |
167 | -- DATA SECTION |
168 | -- write |
169 | -- |
170 | BeginWriteDataSection(me : in out) returns Error from Storage; |
171 | |
172 | WritePersistentObjectHeader(me : in out; aRef : Integer from Standard; aType : Integer from Standard) |
173 | raises StreamWriteError; |
174 | |
175 | BeginWritePersistentObjectData(me : in out) |
176 | raises StreamWriteError; |
177 | |
178 | BeginWriteObjectData(me : in out) |
179 | raises StreamWriteError; |
180 | |
181 | EndWriteObjectData(me : in out) |
182 | raises StreamWriteError; |
183 | |
184 | EndWritePersistentObjectData(me : in out) |
185 | raises StreamWriteError; |
186 | |
187 | EndWriteDataSection(me : in out) returns Error from Storage; |
188 | |
189 | -- read |
190 | -- |
191 | BeginReadDataSection(me : in out) returns Error from Storage; |
192 | |
193 | ReadPersistentObjectHeader(me : in out; aRef : in out Integer from Standard; aType : in out Integer from Standard) |
194 | raises StreamTypeMismatchError,StreamFormatError; |
195 | |
196 | BeginReadPersistentObjectData(me : in out) |
197 | raises StreamFormatError; |
198 | |
199 | BeginReadObjectData(me : in out) |
200 | raises StreamFormatError; |
201 | |
202 | EndReadObjectData(me : in out) |
203 | raises StreamFormatError; |
204 | |
205 | EndReadPersistentObjectData(me : in out) |
206 | raises StreamFormatError; |
207 | |
208 | EndReadDataSection(me : in out) returns Error from Storage; |
209 | |
210 | -- |
211 | SkipObject(me : in out); |
212 | -- |
213 | |
214 | PutReference(me : in out; aValue : Integer from Standard) returns like me |
215 | raises StreamWriteError; |
216 | ---C++: return & |
217 | |
218 | PutCharacter(me : in out; aValue : Character from Standard) returns like me |
219 | raises StreamWriteError; |
220 | ---C++: alias operator << |
221 | ---C++: return & |
222 | |
223 | PutExtCharacter(me : in out; aValue : ExtCharacter from Standard) returns like me |
224 | raises StreamWriteError; |
225 | ---C++: alias operator << |
226 | ---C++: return & |
227 | |
228 | PutInteger(me : in out; aValue : Integer from Standard) returns like me |
229 | raises StreamWriteError; |
230 | ---C++: alias operator << |
231 | ---C++: return & |
232 | |
233 | PutBoolean(me : in out; aValue : Boolean from Standard) returns like me |
234 | raises StreamWriteError; |
235 | ---C++: alias operator << |
236 | ---C++: return & |
237 | |
238 | PutReal(me : in out; aValue : Real from Standard) returns like me |
239 | raises StreamWriteError; |
240 | ---C++: alias operator << |
241 | ---C++: return & |
242 | |
243 | PutShortReal(me : in out; aValue : ShortReal from Standard) returns like me |
244 | raises StreamWriteError; |
245 | ---C++: alias operator << |
246 | ---C++: return & |
247 | |
248 | GetReference(me : in out; aValue : in out Integer from Standard) returns like me |
249 | raises StreamTypeMismatchError; |
250 | ---C++: return & |
251 | |
252 | GetCharacter(me : in out; aValue : in out Character from Standard) returns like me |
253 | raises StreamTypeMismatchError; |
254 | ---C++: alias operator >> |
255 | ---C++: return & |
256 | |
257 | GetExtCharacter(me : in out; aValue : in out ExtCharacter from Standard) returns like me |
258 | raises StreamTypeMismatchError; |
259 | ---C++: alias operator >> |
260 | ---C++: return & |
261 | |
262 | GetInteger(me : in out; aValue : in out Integer from Standard) returns like me |
263 | raises StreamTypeMismatchError; |
264 | ---C++: alias operator >> |
265 | ---C++: return & |
266 | |
267 | GetBoolean(me : in out; aValue : in out Boolean from Standard) returns like me |
268 | raises StreamTypeMismatchError; |
269 | ---C++: alias operator >> |
270 | ---C++: return & |
271 | |
272 | GetReal(me : in out; aValue :in out Real from Standard) returns like me |
273 | raises StreamTypeMismatchError; |
274 | ---C++: alias operator >> |
275 | ---C++: return & |
276 | |
277 | GetShortReal(me : in out; aValue : in out ShortReal from Standard) returns like me |
278 | raises StreamTypeMismatchError; |
279 | ---C++: alias operator >> |
280 | ---C++: return & |
281 | |
282 | Close(me : in out) returns Error from Storage; |
283 | |
284 | Destroy(me : in out); |
285 | ---C++: alias ~ |
286 | |
287 | WriteHeader(me : in out) is private; |
288 | ReadHeader(me : in out) is private; |
289 | |
290 | MagicNumber(myclass) |
291 | returns CString from Standard is private; |
292 | ---C++: return const |
293 | |
294 | ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Integer from Standard) is protected; |
295 | ---Purpose: read <rsize> character from the current position. |
296 | |
297 | ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected; |
298 | ---Purpose: read string from the current position. |
299 | |
300 | WriteString(me : in out; buffer : AsciiString from TCollection) is protected; |
301 | ---Purpose: write string at the current position. |
302 | |
303 | ReadExtendedString(me : in out; buffer : in out ExtendedString from TCollection) is protected; |
304 | ---Purpose: read string from the current position. |
305 | |
306 | WriteExtendedString(me : in out; buffer : ExtendedString from TCollection) is protected; |
307 | ---Purpose: write string at the current position. |
308 | |
309 | fields |
310 | |
311 | myStream : BStream from FSD; |
312 | myHeader : FileHeader from FSD; |
313 | end; |