blob: b56b9b34b58b7fe8cac2361905934810c38bcbc1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<fpdoc-descriptions>
<package name="fcl">
<!--
====================================================================
streamcoll
====================================================================
-->
<module name="streamcoll">
<short>Collection which can stream itself</short>
<descr>
<p>
The <file>streamcoll</file> unit contains the implentation of a collection
(and corresponding collection item) which implements routines for saving or
loading the collection to/from a stream. The collection item should
implement 2 routines to implement the streaming; the streaming itself
is not performed by the <link id="TStreamCollection"/> collection item.
</p>
<p>
The streaming performed here is not compatible with the streaming
implemented in the <var>Classes</var> unit for components. It is independent
of the latter and can be used without a component to hold the collection.
</p>
<p>
The collection item introduces mostly protected methods, and the unit contains
a lot of auxiliary routines which aid in streaming.
</p>
</descr>
<!-- unresolved type reference Visibility: default -->
<element name="Classes">
<short>Collection and stream classes</short>
</element>
<!-- unresolved type reference Visibility: default -->
<element name="SysUtils">
<short>Exception support</short>
</element>
<!--
********************************************************************
#fcl.streamcoll.TStreamCollectionItem
********************************************************************
-->
<!-- object Visibility: default -->
<element name="TStreamCollectionItem">
<short>Collection item with streaming support</short>
<descr>
<p>
<var>TStreamCollectionItem</var> is a <link
id="#rtl.classes.TCollectionItem">TCollectionItem</link> descendent which
implements 2 abstract routines: <var>LoadFromStream</var> and
<var>SaveToStream</var> which must be overridden in a descendent class.
</p>
<p>
These 2 routines will be called by the <link id="TStreamCollection"/> to
save or load the item from the stream.
</p>
</descr>
<seealso>
<link id="TStreamCollection"/>
</seealso>
</element>
<!--
********************************************************************
#fcl.streamcoll.TStreamCollection
********************************************************************
-->
<!-- object Visibility: default -->
<element name="TStreamCollection">
<short>Collection with stream support</short>
<descr>
<p>
<var>TStreamCollection</var> is a <link
id="#rtl.classes.Tcollection">TCollection</link> descendent which implements
2 calls <link id="TStreamCollection.LoadFromStream">LoadFromStream</link>
and <link id="TStreamCollection.SaveToStream">SaveToStream</link> which
load and save the contents of the collection to a stream.
</p>
<p>
The collection items must be descendents of the <link
id="TStreamCollectionItem"/> class for the streaming to work correctly.
</p>
<p>
Note that the stream must be used to load collections of the same type.
</p>
</descr>
<seealso>
<link id="TStreamCollectionItem"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TStreamCollection.LoadFromStream">
<short>Load the collection from a stream</short>
<descr>
<var>LoadFromStream</var> loads the collection from the stream <var>S</var>,
if the collection was saved using <link id="TStreamCollection.SaveToStream">SaveToStream</link>.
It reads the number of items in the collection, and then creates and loads
the items one by one from the stream.
</descr>
<errors>
An exception may be raised if the stream contains invalid data.
</errors>
<seealso>
<link id="TStreamCollection.SaveToStream"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TStreamCollection.LoadFromStream.S">
<short>Stream to load collection from.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TStreamCollection.SaveToStream">
<short>Load the collection from the stream.</short>
<descr>
<var>SaveToStream</var> saves the collection to the stream <var>S</var> so
it can be read from the stream with <link
id="TStreamCollection.LoadFromStream">LoadFromStream</link>. It does this by
writing the number of collection items to the stream, and then streaming all
items in the collection by calling their <var>SaveToStream</var> method.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TStreamCollection.LoadFromStream"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TStreamCollection.SaveToStream.S">
<short>Stream to save collection to</short>
</element>
<!-- property Visibility: public -->
<element name="TStreamCollection.Streaming">
<short>Indicates whether the collection is currently being written to stream</short>
<descr>
<var>Streaming</var> is set to <var>True</var> if the collection is written
to or loaded from stream, and is set again to <var>False</var> if the
streaming process is finished.
</descr>
<seealso>
<link id="TStreamCollection.LoadFromStream"/>
<link id="TStreamCollection.SaveToStream"/>
</seealso>
</element>
<!--
********************************************************************
#fcl.streamcoll.EStreamColl
********************************************************************
-->
<!-- object Visibility: default -->
<element name="EStreamColl">
<short>Exception raised when an error occurs when streaming the collection.</short>
</element>
<!-- procedure Visibility: default -->
<element name="ColWriteInteger">
<short>Write a 32-bit integer to a stream</short>
<descr>
<var>ColWriteInteger</var> writes the 32-bit integer <var>AValue</var> to
the stream <var>S</var>. No endianness is observed.
</descr>
<seealso>
<link id="ColWriteBoolean"/>
<link id="ColWriteString"/>
<link id="ColReadInteger"/>
<link id="ColWriteCurrency"/>
<link id="ColWriteDateTime"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteInteger.S">
<short>Stream to write integer to</short>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteInteger.AValue">
<short>Integer value to write to stream</short>
</element>
<!-- procedure Visibility: default -->
<element name="ColWriteBoolean">
<short>Write a boolean to a stream</short>
<descr>
<var>ColWriteBoolean</var> writes the boolean <var>AValue</var> to the stream.
<var>S</var>.
</descr>
<seealso>
<link id="ColReadBoolean"/>
<link id="ColWriteString"/>
<link id="ColWriteInteger"/>
<link id="ColWriteCurrency"/>
<link id="ColWriteDateTime"/>
<link id="ColWriteFloat"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteBoolean.S">
<short>Stream to write value to</short>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteBoolean.AValue">
<short>Boolean value to write to stream</short>
</element>
<!-- procedure Visibility: default -->
<element name="ColWriteString">
<short>Write a string value to the stream</short>
<descr>
<var>ColWriteString</var> writes the string value <var>AValue</var> to the
stream <var>S</var>.
</descr>
<seealso>
<link id="ColWriteBoolean"/>
<link id="ColReadString"/>
<link id="ColWriteInteger"/>
<link id="ColWriteCurrency"/>
<link id="ColWriteDateTime"/>
<link id="ColWriteFloat"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteString.S">
<short>Stream to write string value to</short>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteString.AValue">
<short>String value to write to stream</short>
</element>
<!-- procedure Visibility: default -->
<element name="ColWriteCurrency">
<short>Write a currency value to stream</short>
<descr>
<var>ColWriteCurrency</var> writes the currency <var>AValue</var> to the
stream <var>S</var>.
</descr>
<seealso>
<link id="ColWriteBoolean"/>
<link id="ColWriteString"/>
<link id="ColWriteInteger"/>
<link id="ColWriteDateTime"/>
<link id="ColWriteFloat"/>
<link id="ColReadCurrency"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteCurrency.S">
<short>Stream to write currency to</short>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteCurrency.AValue">
<short>Currency value to write to stream</short>
</element>
<!-- procedure Visibility: default -->
<element name="ColWriteDateTime">
<short>Write a <var>TDateTime</var> value to stream</short>
<descr>
<var>ColWriteDateTime</var> writes the <var>TDateTime</var>
<var>AValue</var> to the stream <var>S</var>.
</descr>
<seealso>
<link id="ColReadDateTime"/>
<link id="ColWriteBoolean"/>
<link id="ColWriteString"/>
<link id="ColWriteInteger"/>
<link id="ColWriteFloat"/>
<link id="ColWriteCurrency"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteDateTime.S">
<short>Stream to write datetime value to</short>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteDateTime.AValue">
<short>DateTime value to write to stream</short>
</element>
<!-- procedure Visibility: default -->
<element name="ColWriteFloat">
<short>Write floating point value to stream</short>
<descr>
<var>ColWriteFloat</var> writes the double <var>AValue</var> to the stream
<var>S</var>.
</descr>
<seealso>
<link id="ColWriteDateTime"/>
<link id="ColWriteBoolean"/>
<link id="ColWriteString"/>
<link id="ColWriteInteger"/>
<link id="ColReadFloat"/>
<link id="ColWriteCurrency"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteFloat.S">
<short>Stream to write float value to</short>
</element>
<!-- argument Visibility: default -->
<element name="ColWriteFloat.AValue">
<short>Double value to write to the stream</short>
</element>
<!-- function Visibility: default -->
<element name="ColReadInteger">
<short>Read a 32-bit integer from a stream.</short>
<descr>
<var>ColReadInteger</var> reads a 32-bit integer from the stream
<var>S</var> as it was written by <link id="ColWriteInteger"/>
and returns the read value. The value cannot be read and written
across systems that have different endian values.
</descr>
<seealso>
<link id="ColReadDateTime"/>
<link id="ColReadBoolean"/>
<link id="ColReadString"/>
<link id="ColWriteInteger"/>
<link id="ColReadFloat"/>
<link id="ColReadCurrency"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="ColReadInteger.Result">
<short>Integer value read from stream <var>S</var></short>
</element>
<!-- argument Visibility: default -->
<element name="ColReadInteger.S">
<short>Stream to read integer value from</short>
</element>
<!-- function Visibility: default -->
<element name="ColReadBoolean">
<short>Read a boolean value from a stream</short>
<descr>
<var>ColReadBoolean</var> reads a boolean from the stream
<var>S</var> as it was written by <link id="ColWriteBoolean"/>
and returns the read value. The value cannot be read and written
across systems that have different endian values.
</descr>
<seealso>
<link id="ColReadDateTime"/>
<link id="ColWriteBoolean"/>
<link id="ColReadString"/>
<link id="ColReadInteger"/>
<link id="ColReadFloat"/>
<link id="ColReadCurrency"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="ColReadBoolean.Result">
<short>Boolean value read from the stream</short>
</element>
<!-- argument Visibility: default -->
<element name="ColReadBoolean.S">
<short>Stream to read boolean value from</short>
</element>
<!-- function Visibility: default -->
<element name="ColReadString">
<short>Read a string from a stream</short>
<descr>
<var>ColReadStream</var> reads a string value from the stream
<var>S</var> as it was written by <link id="ColWriteString"/>
and returns the read value. The value cannot be read and written
across systems that have different endian values.
</descr>
<seealso>
<link id="ColReadDateTime"/>
<link id="ColReadBoolean"/>
<link id="ColWriteString"/>
<link id="ColReadInteger"/>
<link id="ColReadFloat"/>
<link id="ColReadCurrency"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="ColReadString.Result">
<short>String value read from the stream</short>
</element>
<!-- argument Visibility: default -->
<element name="ColReadString.S">
<short>Stream to read string value from</short>
</element>
<!-- function Visibility: default -->
<element name="ColReadCurrency">
<short>Read a currency value from the stream</short>
<descr>
<var>ColReadCurrency</var> reads a currency value from the stream
<var>S</var> as it was written by <link id="ColWriteCurrency"/>
and returns the read value. The value cannot be read and written
across systems that have different endian values.
</descr>
<seealso>
<link id="ColReadDateTime"/>
<link id="ColReadBoolean"/>
<link id="ColReadString"/>
<link id="ColReadInteger"/>
<link id="ColReadFloat"/>
<link id="ColWriteCurrency"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="ColReadCurrency.Result">
<short>Currency value read from the stream</short>
</element>
<!-- argument Visibility: default -->
<element name="ColReadCurrency.S">
<short>Stream to read currency value from</short>
</element>
<!-- function Visibility: default -->
<element name="ColReadDateTime">
<short>Read a <var>TDateTime</var> value from a stream</short>
<descr>
<var>ColReadDateTime</var> reads a currency value from the stream
<var>S</var> as it was written by <link id="ColWriteDateTime"/>
and returns the read value. The value cannot be read and written
across systems that have different endian values.
</descr>
<seealso>
<link id="ColWriteDateTime"/>
<link id="ColReadBoolean"/>
<link id="ColReadString"/>
<link id="ColReadInteger"/>
<link id="ColReadFloat"/>
<link id="ColReadCurrency"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="ColReadDateTime.Result">
<short><var>TDateTime</var> value read from the stream</short>
</element>
<!-- argument Visibility: default -->
<element name="ColReadDateTime.S">
<short>Stream to read <var>TDateTime</var> value from</short>
</element>
<!-- function Visibility: default -->
<element name="ColReadFloat">
<short>Read a floating point value from a stream</short>
<descr>
<var>ColReadFloat</var> reads a double value from the stream
<var>S</var> as it was written by <link id="ColWriteFloat"/>
and returns the read value. The value cannot be read and written
across systems that have different endian values.
</descr>
<seealso>
<link id="ColReadDateTime"/>
<link id="ColReadBoolean"/>
<link id="ColReadString"/>
<link id="ColReadInteger"/>
<link id="ColWriteFloat"/>
<link id="ColReadCurrency"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="ColReadFloat.Result">
<short>Float value read from the stream</short>
</element>
<!-- argument Visibility: default -->
<element name="ColReadFloat.S">
<short>Stream to read float value from.</short>
</element>
</module> <!-- streamcoll -->
</package>
</fpdoc-descriptions>
|