~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to docs/objects.xml

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="ISO8859-1"?>
2
 
<fpdoc-descriptions>
3
 
<!--
4
 
 
5
 
   $Id: objects.xml,v 1.5 2005/05/05 13:11:50 peter Exp $
6
 
   This file is part of the FPC documentation.
7
 
   Copyright (C) 1997, by Michael Van Canneyt
8
 
 
9
 
   The FPC documentation is free text; you can redistribute it and/or
10
 
   modify it under the terms of the GNU Library General Public License as
11
 
   published by the Free Software Foundation; either version 2 of the
12
 
   License, or (at your option) any later version.
13
 
 
14
 
   The FPC Documentation is distributed in the hope that it will be useful,
15
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 
   Library General Public License for more details.
18
 
 
19
 
   You should have received a copy of the GNU Library General Public
20
 
   License along with the FPC documentation; see the file COPYING.LIB.  If not,
21
 
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22
 
   Boston, MA 02111-1307, USA.
23
 
 -->
24
 
<package name="rtl">
25
 
<module name="objects">
26
 
<short>TP-Compatible basic Objects.</short>
27
 
<!-- \FPCexampledir{objectex} -->
28
 
<descr>
29
 
<p>
30
 
This document documents the <file>objects</file> unit. The unit was implemented by
31
 
many people, and was mainly taken from the FreeVision sources. It has been
32
 
ported to all supported platforms.
33
 
</p>
34
 
<p>
35
 
The methods and fields that are in a <var>Private</var> part of an object
36
 
declaration have been left out of this documentation.
37
 
</p>
38
 
</descr>
39
 
 
40
 
<element name="stOk">
41
 
<short>Stream error codes: No error</short>
42
 
</element>
43
 
 
44
 
<element name="stError">
45
 
<short>Stream error codes: Access error</short>
46
 
</element>
47
 
 
48
 
<element name="stInitError">
49
 
<short>Stream error codes: Initialize error</short>
50
 
</element>
51
 
 
52
 
<element name="stReadError">
53
 
<short>Stream error codes: Stream read error</short>
54
 
</element>
55
 
 
56
 
<element name="stWriteError">
57
 
<short>Stream error codes: Stream write error</short>
58
 
</element>
59
 
 
60
 
<element name="stGetError">
61
 
<short>Stream error codes: Get object error</short>
62
 
</element>
63
 
 
64
 
<element name="stPutError">
65
 
<short>Stream error codes: Put object error</short>
66
 
</element>
67
 
 
68
 
<element name="stSeekError">
69
 
<short>Stream error codes: Seek error in stream</short>
70
 
</element>
71
 
 
72
 
<element name="stOpenError">
73
 
<short>Stream error codes: Error opening stream</short>
74
 
</element>
75
 
 
76
 
<element name="stCreate">
77
 
<short>Stream initialization mode: Create new file</short>
78
 
</element>
79
 
 
80
 
<element name="stOpenRead">
81
 
<short>Stream initialization mode: Read access only</short>
82
 
</element>
83
 
 
84
 
<element name="stOpenWrite">
85
 
<short>Stream initialization mode: Write access only</short>
86
 
</element>
87
 
 
88
 
<element name="stOpen">
89
 
<short>Stream initialization mode: Read/write access</short>
90
 
</element>
91
 
 
92
 
<element name="coIndexError">
93
 
<short>Collection list error: Index out of range</short>
94
 
</element>
95
 
 
96
 
<element name="coOverflow">
97
 
<short>Collection list error: Overflow</short>
98
 
</element>
99
 
 
100
 
<element name="MaxBytes">
101
 
<short>Maximum data size (in bytes)</short>
102
 
</element>
103
 
 
104
 
<element name="MaxWords">
105
 
<short>Maximum data size (in words)</short>
106
 
</element>
107
 
 
108
 
<element name="MaxPtrs">
109
 
<short>Maximum data size (in pointers)</short>
110
 
</element>
111
 
 
112
 
<element name="MaxReadBytes">
113
 
<short>Maximum data that can be read from a stream (not used)</short>
114
 
</element>
115
 
 
116
 
<element name="MaxCollectionSize">
117
 
<short>Maximum collection size (in items)</short>
118
 
</element>
119
 
 
120
 
<element name="DefaulTPCompatible">
121
 
<short>Is the default stream content TP compatible</short>
122
 
<descr>
123
 
This variable determines whether the default stream is filled or read in a
124
 
TP compatible way. The <var>TPCompatible</var> field can be set on a
125
 
per-stream basis, and is initialized with the <var>DefaulTPCompatible</var>
126
 
value.
127
 
</descr>
128
 
</element>
129
 
 
130
 
<element name="RCollection">
131
 
<short>Default stream record for the <link id="TCollection"/> object.</short>
132
 
</element>
133
 
 
134
 
<element name="RStrCollection">
135
 
<short>Default stream record for the <link id="TStrCollection"/> object.</short>
136
 
</element>
137
 
 
138
 
<element name="RStringCollection">
139
 
<short>Default stream record for the <link id="TStringCollection"/> object.</short>
140
 
</element>
141
 
 
142
 
<element name="RStringList">
143
 
<short>Default stream record for the <link id="TStringList"/> object.</short>
144
 
</element>
145
 
 
146
 
<element name="RStrListMaker">
147
 
<short>Default stream record for the <link id="TStrListMaker"/> object.</short>
148
 
</element>
149
 
 
150
 
<element name="StreamError">
151
 
<short>Pointer to default stream error handler.</short>
152
 
</element>
153
 
 
154
 
<element name="vmtHeaderSize">
155
 
<short>Size of the VMT header in an object (not used).</short>
156
 
</element>
157
 
 
158
 
 
159
 
<element name="MaxTPCompatibleCollectionSize">
160
 
<short>Maximum collection size (in items, same value as in TP)</short>
161
 
</element>
162
 
 
163
 
 
164
 
<element name="TCharSet">
165
 
<short>Generic set of characters type.</short>
166
 
</element>
167
 
 
168
 
<element name="PCharSet">
169
 
<short>Pointer to <link id="TCharSet"/>.</short>
170
 
</element>
171
 
 
172
 
<element name="TByteArray">
173
 
<short>Array with maxmimum allowed number of bytes.</short>
174
 
</element>
175
 
 
176
 
<element name="PByteArray">
177
 
<short>Pointer to <link id="TByteArray"/></short>
178
 
</element>
179
 
 
180
 
<element name="TWordArray">
181
 
<short>Array with maxmimum allowed number of words.</short>
182
 
</element>
183
 
 
184
 
<element name="PWordArray">
185
 
<short>Pointer to <link id="TWordArray"/></short>
186
 
</element>
187
 
 
188
 
<element name="TPointerArray">
189
 
<short>Array with maxmimum allowed number of pointers</short>
190
 
</element>
191
 
 
192
 
<element name="PPointerArray">
193
 
<short>Pointer to <link id="TPointerArray"/></short>
194
 
</element>
195
 
 
196
 
<element name="PString">
197
 
<short>Pointer to a shortstring.</short>
198
 
</element>
199
 
 
200
 
<element name="AsciiZ">
201
 
<short>Filename - null terminated array of characters.</short>
202
 
</element>
203
 
 
204
 
<element name="FNameStr">
205
 
<short>Filename - shortstring version.</short>
206
 
</element>
207
 
 
208
 
<element name="Sw_Word">
209
 
<short>Alias for Cardinal</short>
210
 
</element>
211
 
 
212
 
<element name="Sw_Integer">
213
 
<short>Alias for longint</short>
214
 
</element>
215
 
 
216
 
<element name="WordRec">
217
 
<short>Record describing a Word (in bytes)</short>
218
 
</element>
219
 
 
220
 
<element name="WordRec.Hi">
221
 
<short>High byte of a word</short>
222
 
</element>
223
 
 
224
 
<element name="WordRec.Lo">
225
 
<short>Low byte of a word</short>
226
 
</element>
227
 
 
228
 
<element name="LongRec">
229
 
<short>Record describing a longint (in Words)</short>
230
 
</element>
231
 
 
232
 
<element name="LongRec.Lo">
233
 
<short>Lower word of longint</short>
234
 
</element>
235
 
 
236
 
<element name="LongRec.Hi">
237
 
<short>High word of longint</short>
238
 
</element>
239
 
 
240
 
<element name="PtrRec">
241
 
<short>Record describing a pointer to a memory location.</short>
242
 
</element>
243
 
 
244
 
<element name="PtrRec.Ofs">
245
 
<short>Pointer offset</short>
246
 
</element>
247
 
 
248
 
<element name="PtrRec.Seg">
249
 
<short>Pointer segment</short>
250
 
</element>
251
 
 
252
 
<element name="PStreamRec">
253
 
<short>Pointer to <link id="TStreamRec"/></short>
254
 
</element>
255
 
 
256
 
<element name="TStreamRec">
257
 
<short>Record used in streaming mechanism. </short>
258
 
<descr>
259
 
<var>TSreamRec</var> is used by the <file>Objects</file> unit streaming
260
 
mechanism: when an object is registered, a <var>TStreamRec</var> record is
261
 
added to a list of records. This list is used when objects need to be
262
 
streamed from/streamed to a stream. It contains all the information needed
263
 
to stream the object.
264
 
</descr>
265
 
</element>
266
 
 
267
 
<element name="TStreamRec.ObjType">
268
 
<short>Unique identifier for this object type.</short>
269
 
</element>
270
 
 
271
 
<element name="TStreamRec.VmtLink">
272
 
<short>Pointer to object VMT</short>
273
 
</element>
274
 
 
275
 
<element name="TStreamRec.Load">
276
 
<short>Procedure to call when object must be loaded from a stream</short>
277
 
</element>
278
 
 
279
 
<element name="TStreamRec.Store">
280
 
<short>Procedure to call when object must be stored in a stream.</short>
281
 
</element>
282
 
 
283
 
<element name="TStreamRec.Next">
284
 
<short>Next item in list</short>
285
 
</element>
286
 
 
287
 
<element name="PPoint">
288
 
<short>Pointer to <link id="TPoint"/> record.</short>
289
 
</element>
290
 
 
291
 
<element name="TPoint">
292
 
<short>Record describing a point in a 2 dimensional plane.</short>
293
 
</element>
294
 
 
295
 
<element name="TPoint.X">
296
 
<short>X coordinate</short>
297
 
</element>
298
 
 
299
 
<element name="TPoint.Y">
300
 
<short>Y coordinate</short>
301
 
</element>
302
 
 
303
 
<element name="TItemList">
304
 
<short>Pointer array type used in a <link id="TCollection"/></short>
305
 
</element>
306
 
 
307
 
<element name="TStrIndex">
308
 
<short>Pointer array type used in a <link id="TStringList"/></short>
309
 
</element>
310
 
 
311
 
<element name="TStrIndexRec">
312
 
<short>Record type used in a <link id="TStringList"/> to store the strings</short>
313
 
</element>
314
 
 
315
 
<element name="TStrIndexRec.Key">
316
 
<short>String key value</short>
317
 
</element>
318
 
 
319
 
<element name="TStrIndexRec.Count">
320
 
<short>String character count</short>
321
 
</element>
322
 
 
323
 
<element name="TStrIndexRec.Offset">
324
 
<short>String offset in stream</short>
325
 
</element>
326
 
 
327
 
<element name="NewStr">
328
 
<short>Allocate a copy of a shortstring on the heap.</short>
329
 
<descr>
330
 
<p>
331
 
<var>NewStr</var> makes a copy of the string <var>S</var> on the heap,
332
 
and returns a pointer to this copy. If the string is empty then
333
 
<var>Nil</var> is returned.
334
 
</p>
335
 
<p>
336
 
The allocated memory is not based on the declared size of the string passed
337
 
to <var>NewStr</var>, but is baed on the actual length of the string.
338
 
</p>
339
 
</descr>
340
 
<errors>
341
 
If not enough memory is available, an 'out of memory' error will occur.
342
 
</errors>
343
 
<seealso>
344
 
<link id="DisposeStr"/>
345
 
<link id="SetStr"/>
346
 
</seealso>
347
 
<example file="objectex/ex40"/>
348
 
</element>
349
 
 
350
 
<element name="SetStr">
351
 
<short>Allocate a copy of a shortstring on the heap.</short>
352
 
<descr>
353
 
<p>
354
 
<var>SetStr</var> makes a copy of the string <var>S</var> on the heap and
355
 
returns the pointer to this copy in <var>P</var>. If <var>P</var> pointed to
356
 
another string (i.e. was not <var>Nil</var>, the memory is released first.
357
 
Contrary to <link id="NewStr"/>, if the string is empty then a pointer to 
358
 
an empty string is returned.
359
 
</p>
360
 
<p>
361
 
The allocated memory is not based on the declared size of the string passed
362
 
to <var>NewStr</var>, but is based on the actual length of the string.
363
 
</p>
364
 
</descr>
365
 
<errors>
366
 
If not enough memory is available, an 'out of memory' error will occur.
367
 
</errors>
368
 
<seealso>
369
 
<link id="DisposeStr"/>
370
 
<link id="NewStr"/>
371
 
</seealso>
372
 
</element>
373
 
 
374
 
 
375
 
 
376
 
<element name="DisposeStr">
377
 
<short>Dispose of a shortstring which was allocated on the heap.</short>
378
 
<descr>
379
 
<p>
380
 
<var>DisposeStr</var> removes a dynamically allocated string from the heap.
381
 
</p>
382
 
<p>
383
 
For an example, see <link id="NewStr"/>.
384
 
</p>
385
 
</descr>
386
 
<errors>
387
 
None.
388
 
</errors>
389
 
<seealso>
390
 
<link id="NewStr"/>
391
 
<link id="SetStr"/>
392
 
</seealso>
393
 
</element>
394
 
 
395
 
 
396
 
<element name="Abstract">
397
 
<short>Abstract error handler.</short>
398
 
<descr>
399
 
<p>
400
 
When implementing abstract methods, do not declare them as <var>abstract</var>.
401
 
Instead, define them simply as <var>virtual</var>. In the implementation of such
402
 
abstract methods, call the <var>Abstract</var> procedure. This allows explicit
403
 
control of what happens when an abstract method is called.
404
 
</p>
405
 
<p>
406
 
The current implementation of <var>Abstract</var> terminates the program with
407
 
a run-time error 211.
408
 
</p>
409
 
</descr>
410
 
<errors>
411
 
None.
412
 
</errors>
413
 
</element>
414
 
 
415
 
<element name="RegisterObjects">
416
 
<short>Register standard objects.</short>
417
 
<descr>
418
 
<p>
419
 
<var>RegisterObjects</var> registers the following objects for streaming:
420
 
</p>
421
 
<ol>
422
 
<li> <var>TCollection</var>, see <link id="TCollection"/>.</li>
423
 
<li> <var>TStringCollection</var>, see <link id="TStringCollection"/>.</li>
424
 
<li> <var>TStrCollection</var>, see <link id="TStrCollection"/>.</li>
425
 
</ol>
426
 
</descr>
427
 
<errors>
428
 
None.
429
 
</errors>
430
 
<seealso>
431
 
<link id="RegisterType"/>
432
 
</seealso>
433
 
</element>
434
 
 
435
 
<element name="RegisterType">
436
 
<short>Register new object for streaming.</short>
437
 
<descr>
438
 
<p>
439
 
<var>RegisterType</var> registers a new type for streaming. An object cannot
440
 
be streamed unless it has been registered first.
441
 
The stream record <var>S</var> needs to have the following fields set:
442
 
</p>
443
 
<dl>
444
 
<dt>ObjType: Sw_Word</dt>
445
 
<dd> This should be a unique identifier. Each possible
446
 
type should have it's own identifier.
447
 
</dd>
448
 
<dt>VmtLink: pointer</dt>
449
 
<dd>This should contain a pointer to the VMT (Virtual
450
 
Method Table) of the object you try to register.
451
 
</dd>
452
 
<dt>Load : Pointer</dt>
453
 
<dd> is a pointer to a method that initializes an instance
454
 
of that object, and reads the initial values from a stream. This method
455
 
should accept as it's sole argument a <var>PStream</var> type variable.
456
 
</dd>
457
 
<dt>Store: Pointer</dt>
458
 
<dd>is a pointer to a method that stores an instance of the
459
 
object to a stream. This method should accept as it's sole argument
460
 
 a <var>PStream</var> type variable.
461
 
</dd>
462
 
</dl>
463
 
<p>
464
 
The VMT of the object can be retrieved with the
465
 
following expression:
466
 
</p>
467
 
<code>
468
 
  VmtLink: Ofs(TypeOf(MyType)^);
469
 
</code>
470
 
</descr>
471
 
<errors>
472
 
In case of error (if a object with the same <var>ObjType</var>) is already
473
 
registered), run-time error 212 occurs.
474
 
</errors>
475
 
<example file="objectex/myobject"/>
476
 
</element>
477
 
 
478
 
 
479
 
<element name="LongMul">
480
 
<short>Overflow safe multiply.</short>
481
 
<descr>
482
 
<var>LongMul</var> multiplies <var>X</var> with <var>Y</var>. The result is of
483
 
type <var>Longint</var>. This avoids possible overflow errors you would normally
484
 
get when multiplying <var>X</var> and <var>Y</var> that are too big.
485
 
</descr>
486
 
<errors>
487
 
None.
488
 
</errors>
489
 
<seealso>
490
 
<link id="LongDiv"/>
491
 
</seealso>
492
 
</element>
493
 
 
494
 
<element name="LongDiv">
495
 
<short>Overflow safe divide</short>
496
 
<descr>
497
 
<var>LongDiv</var> divides <var>X</var> by <var>Y</var>. The result is of
498
 
type <var>Integer</var> instead of type <var>Longint</var>, as you would get 
499
 
normally. 
500
 
</descr>
501
 
<errors>
502
 
If Y is zero, a run-time error will be generated.
503
 
</errors>
504
 
<seealso>
505
 
<link id="LongMul"/>
506
 
</seealso>
507
 
</element>
508
 
 
509
 
<element name="TRect">
510
 
<short>Describes a rectangular region in a plane.</short>
511
 
</element>
512
 
 
513
 
<element name="TRect.A">
514
 
<short>Top left corner of rectangle</short>
515
 
</element>
516
 
 
517
 
<element name="TRect.B">
518
 
<short>Bottom right corner of rectangle</short>
519
 
</element>
520
 
 
521
 
<element name="TRect.Empty">
522
 
<short>Is the surface of the rectangle zero</short>
523
 
<descr>
524
 
<var>Empty</var> returns <var>True</var> if the rectangle defined by the corner points
525
 
<var>A</var>, <var>B</var> has zero or negative surface.
526
 
</descr>
527
 
<errors>
528
 
None.
529
 
</errors>
530
 
<seealso>
531
 
<link id="TRect.Equals"/>
532
 
<link id="TRect.Contains"/>
533
 
</seealso>
534
 
<example file="objectex/ex1"/>
535
 
</element>
536
 
 
537
 
 
538
 
<element name="TRect.Equals">
539
 
<short>Do the corners of the rectangles match</short>
540
 
<descr>
541
 
<p>
542
 
<var>Equals</var> returns <var>True</var> if the rectangle has the 
543
 
same corner points <var>A,B</var> as the rectangle R, and <var>False</var>
544
 
otherwise.
545
 
</p>
546
 
<p>
547
 
For an example, see <link id="TRect.Empty"/>
548
 
</p>
549
 
</descr>
550
 
<errors>
551
 
None.
552
 
</errors>
553
 
<seealso>
554
 
<link id="TRect.Empty"/>
555
 
<link id="TRect.Contains"/>
556
 
</seealso>
557
 
</element>
558
 
 
559
 
 
560
 
<element name="TRect.Contains">
561
 
<short>Determine if a point is inside the rectangle</short>
562
 
<descr>
563
 
<var>Contains</var> returns <var>True</var> if the point <var>P</var> is contained
564
 
in the rectangle (including borders), <var>False</var> otherwise.
565
 
</descr>
566
 
<errors>
567
 
None.
568
 
</errors>
569
 
<seealso>
570
 
<link id="TRect.Intersect"/>
571
 
<link id="TRect.Equals"/>
572
 
</seealso>
573
 
</element>
574
 
 
575
 
<element name="TRect.Copy">
576
 
<short>Copy cornerpoints from another rectangle.</short>
577
 
<descr>
578
 
Assigns the rectangle R to the object. After the call to <var>Copy</var>, the
579
 
rectangle R has been copied to the object that invoked <var>Copy</var>.
580
 
</descr>
581
 
<errors>
582
 
None.
583
 
</errors>
584
 
<seealso>
585
 
<link id="TRect.Assign"/>
586
 
</seealso>
587
 
<example file="objectex/ex2"/>
588
 
</element>
589
 
 
590
 
 
591
 
<element name="TRect.Union">
592
 
<short>Enlarges rectangle to encompas another rectangle.</short>
593
 
<descr>
594
 
<var>Union</var> enlarges the current rectangle so that it becomes the union
595
 
of the current rectangle with the rectangle <var>R</var>.
596
 
</descr>
597
 
<errors>
598
 
None.
599
 
</errors>
600
 
<seealso>
601
 
<link id="TRect.Intersect"/>
602
 
</seealso>
603
 
<example file="objectex/ex3"/>
604
 
</element>
605
 
 
606
 
 
607
 
<element name="TRect.Intersect">
608
 
<short>Reduce rectangle to intersection with another rectangle</short>
609
 
<descr>
610
 
<var>Intersect</var> makes the intersection of the current rectangle with
611
 
<var>R</var>. If the intersection is empty, then the rectangle is set to the empty
612
 
rectangle at coordinate (0,0).
613
 
</descr>
614
 
<errors>
615
 
None.
616
 
</errors>
617
 
<seealso>
618
 
<link id="TRect.Union"/>
619
 
</seealso>
620
 
<example file="objectex/ex4"/>
621
 
</element>
622
 
 
623
 
<element name="TRect.Move">
624
 
<short>Move rectangle along a vector.</short>
625
 
<descr>
626
 
<var>Move</var> moves the current rectangle along a vector with components
627
 
<var>(ADX,ADY)</var>. It adds <var>ADX</var> to the X-coordinate of both corner
628
 
points, and <var>ADY</var> to both end points.
629
 
</descr>
630
 
<errors>
631
 
None.
632
 
</errors>
633
 
<seealso>
634
 
<link id="TRect.Grow"/>
635
 
</seealso>
636
 
<example file="objectex/ex5"/>
637
 
</element>
638
 
 
639
 
 
640
 
<element name="TRect.Grow">
641
 
<short>Expand rectangle with certain size.</short>
642
 
<descr>
643
 
<p>
644
 
<var>Grow</var> expands the rectangle with an amount <var>ADX</var> in the <var>X</var>
645
 
direction (both on the left and right side of the rectangle, thus adding a 
646
 
length 2*ADX to the width of the rectangle), and an amount <var>ADY</var> in 
647
 
the <var>Y</var> direction (both on the top and the bottom side of the rectangle,
648
 
adding a length 2*ADY to the height of the rectangle. 
649
 
</p>
650
 
<p>
651
 
<var>ADX</var> and <var>ADY</var> can be negative. If the resulting rectangle is empty, it is set 
652
 
to the empty rectangle at <var>(0,0)</var>.
653
 
</p>
654
 
</descr>
655
 
<errors>
656
 
None.
657
 
</errors>
658
 
<seealso>
659
 
<link id="TRect.Move"/>
660
 
</seealso>
661
 
<example file="objectex/ex6"/>
662
 
</element>
663
 
 
664
 
<element name="TRect.Assign">
665
 
<short>Set rectangle corners.</short>
666
 
<descr>
667
 
<p>
668
 
<var>Assign</var> sets the corner points of the rectangle to <var>(XA,YA)</var> and
669
 
<var>(Xb,Yb)</var>.
670
 
</p>
671
 
<p>
672
 
For an example, see <link id="TRect.Copy"/>.
673
 
</p>
674
 
</descr>
675
 
<errors>
676
 
None.
677
 
</errors>
678
 
<seealso>
679
 
<link id="TRect.Copy"/>
680
 
</seealso>
681
 
</element>
682
 
 
683
 
<element name="TObject">
684
 
<short>Basis of all objects</short>
685
 
<descr>
686
 
This type serves as the basic object for all other objects in the
687
 
<file>Objects</file> unit.
688
 
</descr>
689
 
</element>
690
 
 
691
 
<element name="TObject.Init">
692
 
<short>Construct (initialize) a new object</short>
693
 
<descr>
694
 
<p>
695
 
Instantiates a new object of type <var>TObject</var>. It fills the instance up
696
 
with Zero bytes.
697
 
</p>
698
 
<p>
699
 
For an example, see <link id="TObject.Free">Free</link>
700
 
</p>
701
 
</descr>
702
 
<errors>
703
 
None.
704
 
</errors>
705
 
<seealso>
706
 
<link id="TObject.Free"/>
707
 
<link id="TObject.Done"/>
708
 
</seealso>
709
 
</element>
710
 
 
711
 
 
712
 
<element name="TObject.Free">
713
 
<short>Destroy an object and release all memory.</short>
714
 
<descr>
715
 
<var>Free</var> calls the destructor of the object, and releases the memory
716
 
occupied by the instance of the object.
717
 
</descr>
718
 
<errors>
719
 
No checking is performed to see whether <var>self</var> is <var>nil</var> and whether
720
 
the object is indeed allocated on the heap.
721
 
</errors>
722
 
<seealso>
723
 
<link id="TObject.Init"/>
724
 
<link id="TObject.Done"/>
725
 
</seealso>
726
 
<example file="objectex/ex7"/>
727
 
</element>
728
 
 
729
 
 
730
 
<element name="TObject.Done">
731
 
<short>Destroy an object.</short>
732
 
<descr>
733
 
<p>
734
 
<var>Done</var>, the destructor of <var>TObject</var> does nothing. It is mainly
735
 
intended to be used in the <link id="TObject.Free"/> method.
736
 
</p>
737
 
<p>
738
 
The destructore Done does not free the memory occupied by the object.
739
 
</p>
740
 
</descr>
741
 
<errors>
742
 
None.
743
 
</errors>
744
 
<seealso>
745
 
<link id="TObject.Free"/>
746
 
<link id="TObject.Init"/>
747
 
</seealso>
748
 
<example file="objectex/ex8"/>
749
 
</element>
750
 
 
751
 
<element name="TObject.Is_Object">
752
 
<short>Check whether a pointer points to an object.</short>
753
 
<descr>
754
 
<var>Is_Object</var> returns <var>True</var> if the pointer <var>P</var>
755
 
points to an instance of a <var>TObject</var> descendent, it returns 
756
 
<var>false</var> otherwise.
757
 
</descr>
758
 
</element>
759
 
 
760
 
 
761
 
<element name="TStream">
762
 
<short>Base stream class</short>
763
 
<descr>
764
 
<p>
765
 
The <var>TStream</var> object is the ancestor for all streaming objects, i.e.
766
 
objects that have the capability to store and retrieve data.
767
 
</p>
768
 
<p>
769
 
It defines a number of methods that are common to all objects that implement
770
 
streaming, many of them are virtual, and are only implemented in the
771
 
descendent types.
772
 
</p>
773
 
<p>
774
 
Programs should not instantiate objects of type TStream directly, but
775
 
instead instantiate a descendant type, such as <var>TDosStream</var>,
776
 
<var>TMemoryStream</var>.
777
 
</p>
778
 
</descr>
779
 
<seealso>
780
 
<link id="PStream"/>
781
 
<link id="TDosStream"/>
782
 
<link id="TMemoryStream"/>
783
 
</seealso>
784
 
</element>
785
 
 
786
 
<element name="PStream">
787
 
<short>Pointer type to <link id="TStream"/></short>
788
 
</element>
789
 
 
790
 
<element name="TStream.Init">
791
 
<short>Constructor for TStream instance</short>
792
 
<descr>
793
 
<var>Init</var> initializes a TStream instance. Descendent streams should
794
 
always call the inherited <var>Init</var>.
795
 
</descr>
796
 
</element>
797
 
 
798
 
<element name="TStream.Status">
799
 
<short>Current stream status</short>
800
 
</element>
801
 
 
802
 
<element name="TStream.ErrorInfo">
803
 
<short>Additional error info when there is an error.</short>
804
 
</element>
805
 
 
806
 
<element name="TStream.StreamSize">
807
 
<short>Current size of the stream</short>
808
 
</element>
809
 
 
810
 
<element name="TStream.Position">
811
 
<short>Current Stream position</short>
812
 
</element>
813
 
 
814
 
<element name="TStream.TPCompatible">
815
 
<short>If set to <var>True</var> streamed data is written in a TP compatible format.</short>
816
 
</element>
817
 
 
818
 
<element name="TStream.Get">
819
 
<short>Read an object definition from the stream.</short>
820
 
<descr>
821
 
<var>Get</var> reads an object definition  from a stream, and returns
822
 
a pointer to an instance of this object.
823
 
</descr>
824
 
<errors>
825
 
On error, <link id="TStream.Status"/> is set, and <var>NIL</var> is returned.
826
 
</errors>
827
 
<seealso> 
828
 
<link id="TStream.Put"/>
829
 
</seealso>
830
 
<example file="objectex/ex9"/>
831
 
</element>
832
 
 
833
 
 
834
 
<element name="TStream.StrRead">
835
 
<short>Read a null-terminated string from the stream.</short>
836
 
<descr>
837
 
<var>StrRead</var> reads a string from the stream, allocates memory
838
 
for it, and returns a pointer to a null-terminated copy of the string
839
 
on the heap.
840
 
</descr>
841
 
<errors>
842
 
On error, <var>Nil</var> is returned.
843
 
</errors>
844
 
<seealso>
845
 
<link id="TStream.StrWrite"/>
846
 
<link id="TStream.ReadStr"/>
847
 
</seealso>
848
 
<example file="objectex/ex10"/>
849
 
</element>
850
 
 
851
 
 
852
 
 
853
 
<element name="TStream.GetPos">
854
 
<short>Return current position in the stream</short>
855
 
<descr>
856
 
If the stream's status is <var>stOk</var>, <var>GetPos</var> returns the current 
857
 
position in the stream. Otherwise it returns <var>-1</var>
858
 
</descr>
859
 
<errors>
860
 
<var>-1</var> is returned if the status is an error condition.
861
 
</errors>
862
 
<seealso>
863
 
<link id="TStream.Seek"/>
864
 
<link id="TStream.GetSize"/>
865
 
</seealso>
866
 
<example file="objectex/ex11"/>
867
 
</element>
868
 
 
869
 
 
870
 
 
871
 
<element name="TStream.GetSize">
872
 
<short>Return the size of the stream.</short>
873
 
<descr>
874
 
If the stream's status is <var>stOk</var> then <var>GetSize</var> returns
875
 
the size of the stream, otherwise it returns <var>-1</var>.
876
 
</descr>
877
 
<errors>
878
 
<var>-1</var> is returned if the status is an error condition.
879
 
</errors>
880
 
<seealso>
881
 
<link id="TStream.Seek"/>
882
 
<link id="TStream.GetPos"/>
883
 
</seealso>
884
 
<example file="objectex/ex12"/>
885
 
</element>
886
 
 
887
 
<element name="TStream.ReadStr">
888
 
<short>Read a shortstring from the stream.</short>
889
 
<descr>
890
 
<var>ReadStr</var> reads a string from the stream, copies it to the heap
891
 
and returns a pointer to this copy. The string is saved as a pascal
892
 
string, and hence is NOT null terminated.
893
 
</descr>
894
 
<errors>
895
 
On error (e.g. not enough memory), <var>Nil</var> is returned.
896
 
</errors>
897
 
<seealso>
898
 
<link id="TStream.StrRead"/>
899
 
</seealso>
900
 
<example file="objectex/ex13"/>
901
 
</element>
902
 
 
903
 
<element name="TStream.Open">
904
 
<short>Open the stream</short>
905
 
<descr>
906
 
<p>
907
 
<var>Open</var> is an abstract method, that should be overridden by descendent
908
 
objects. Since opening a stream depends on the stream's type this is not
909
 
surprising.
910
 
</p>
911
 
<p>
912
 
For an example, see <link id="TDosStream.Open"/>.
913
 
</p>
914
 
</descr>
915
 
<errors>
916
 
None.
917
 
</errors>
918
 
<seealso>
919
 
<link id="TStream.Close"/>
920
 
<link id="TStream.Reset"/>
921
 
</seealso>
922
 
</element>
923
 
 
924
 
 
925
 
<element name="TStream.Close">
926
 
<short>Close the stream</short>
927
 
<descr>
928
 
<p>
929
 
<var>Close</var> is an abstract method, that should be overridden by descendent
930
 
objects. Since Closing a stream depends on the stream's type this is not
931
 
surprising.
932
 
</p>
933
 
<p>
934
 
for an example, see <link id="TDosStream.Open"/>.
935
 
</p>
936
 
</descr>
937
 
<errors>
938
 
None.
939
 
</errors>
940
 
<seealso>
941
 
<link id="TStream.Open"/>
942
 
<link id="TStream.Reset"/>
943
 
</seealso>
944
 
</element>
945
 
 
946
 
<element name="TStream.Reset">
947
 
<short>Reset the stream</short>
948
 
<descr>
949
 
<var>Reset</var> sets the stream's status to <var>0</var>, as well as the ErrorInfo
950
 
</descr>
951
 
<errors>
952
 
None.
953
 
</errors>
954
 
<seealso>
955
 
<link id="TStream.Open"/>
956
 
<link id="TStream.Close"/>
957
 
</seealso>
958
 
</element>
959
 
 
960
 
<element name="TStream.Flush">
961
 
<short>Flush the stream data from the buffer, if any.</short>
962
 
<descr>
963
 
<p>
964
 
<var>Flush</var> is an abstract method that should be overridden by descendent
965
 
objects. It serves to enable the programmer to tell streams that implement 
966
 
a buffer to clear the buffer.
967
 
</p>
968
 
<p>
969
 
for an example, see <link id="TBufStream.Flush"/>.
970
 
</p>
971
 
</descr>
972
 
<errors>
973
 
None.
974
 
</errors>
975
 
<seealso>
976
 
<link id="TStream.Truncate"/>
977
 
</seealso>
978
 
</element>
979
 
 
980
 
 
981
 
<element name="TStream.Truncate">
982
 
<short>Truncate the stream size on current position.</short>
983
 
<descr>
984
 
<p>
985
 
<var>Truncate</var> is an abstract procedure that should be overridden by
986
 
descendent objects. It serves to enable the programmer to truncate the
987
 
size of the stream to the current file position.
988
 
</p>
989
 
<p>
990
 
For an example, see <link id="TDosStream.Truncate"/>.
991
 
</p>
992
 
</descr>
993
 
<errors>
994
 
None.
995
 
</errors>
996
 
<seealso>
997
 
<link id="TStream.Seek"/>
998
 
</seealso>
999
 
</element>
1000
 
 
1001
 
 
1002
 
<element name="TStream.Put">
1003
 
<short>Write an object to the stream.</short>
1004
 
<descr>
1005
 
<p>
1006
 
<var>Put</var> writes the object pointed to by <var>P</var>. <var>P</var> should be
1007
 
non-nil. The object type must have been registered with <link id="RegisterType"/>.
1008
 
</p>
1009
 
<p>
1010
 
After the object has been written, it can be read again with <link id="TStream.Get">Get</link>.
1011
 
</p>
1012
 
<p>
1013
 
For an example, see <link id="TStream.Get"/>;
1014
 
</p>
1015
 
</descr>
1016
 
<errors>
1017
 
No check is done whether P is <var>Nil</var> or not. Passing <var>Nil</var> will cause
1018
 
a run-time error 216 to be generated. If the object has not been registered,
1019
 
the status of the stream will be set to <var>stPutError</var>.
1020
 
</errors>
1021
 
<seealso>
1022
 
<link id="TStream.Get"/>
1023
 
</seealso>
1024
 
</element>
1025
 
 
1026
 
 
1027
 
<element name="TStream.StrWrite">
1028
 
<short>Write a null-terminated string to the stream.</short>
1029
 
<descr>
1030
 
<p>
1031
 
<var>StrWrite</var> writes the null-terminated string <var>P</var> to the stream.
1032
 
<var>P</var> can only be 65355 bytes long.
1033
 
</p>
1034
 
<p>
1035
 
For an example, see <link id="TStream.StrRead"/>.
1036
 
</p>
1037
 
</descr>
1038
 
<errors>
1039
 
None.
1040
 
</errors>
1041
 
<seealso>
1042
 
<link id="TStream.WriteStr"/>
1043
 
<link id="TStream.StrRead"/>
1044
 
<link id="TStream.ReadStr"/>
1045
 
</seealso>
1046
 
</element>
1047
 
 
1048
 
 
1049
 
<element name="TStream.WriteStr">
1050
 
<short>Write a pascal string to the stream.</short>
1051
 
<descr>
1052
 
<p>
1053
 
<var>StrWrite</var> writes the pascal string pointed to by <var>P</var> to the stream.
1054
 
</p>
1055
 
<p>
1056
 
For an example, see <link id="TStream.ReadStr"/>.
1057
 
</p>
1058
 
</descr>
1059
 
<errors>
1060
 
None.
1061
 
</errors>
1062
 
<seealso>
1063
 
<link id="TStream.StrWrite"/>
1064
 
<link id="TStream.StrRead"/>
1065
 
<link id="TStream.ReadStr"/>
1066
 
</seealso>
1067
 
</element>
1068
 
 
1069
 
<element name="TStream.Seek">
1070
 
<short>Set stream position.</short>
1071
 
<descr>
1072
 
<p>
1073
 
Seek sets the position to <var>Pos</var>. This position is counted
1074
 
from the beginning, and is zero based. (i.e. seeek(0) sets the position
1075
 
pointer on the first byte of the stream)
1076
 
</p>
1077
 
<p>
1078
 
For an example, see <link id="TDosStream.Seek"/>.
1079
 
</p>
1080
 
</descr>
1081
 
<errors>
1082
 
If <var>Pos</var> is larger than the stream size, <var>Status</var> is set to
1083
 
<var>StSeekError</var>.
1084
 
</errors>
1085
 
<seealso>
1086
 
<link id="TStream.GetPos"/>
1087
 
<link id="TStream.GetSize"/>
1088
 
</seealso>
1089
 
</element>
1090
 
 
1091
 
 
1092
 
 
1093
 
<element name="TStream.Error">
1094
 
<short>Set stream status</short>
1095
 
<descr>
1096
 
<p>
1097
 
<var>Error</var> sets the stream's status to <var>Code</var> and <var>ErrorInfo</var>
1098
 
to <var>Info</var>. If the <var>StreamError</var> procedural variable is set,
1099
 
<var>Error</var> executes it, passing <var>Self</var> as an argument.
1100
 
</p>
1101
 
<p>
1102
 
This method should not be called directly from a program. It is intended to
1103
 
be used in descendent objects.
1104
 
</p>
1105
 
</descr>
1106
 
<errors>
1107
 
None.
1108
 
</errors>
1109
 
</element>
1110
 
 
1111
 
<element name="TStream.Read">
1112
 
<short>Read data from stream to buffer.</short>
1113
 
<descr>
1114
 
<p>
1115
 
<var>Read</var> is an abstract method that should be overridden by descendent
1116
 
objects.
1117
 
</p>
1118
 
<p>
1119
 
<var>Read</var> reads <var>Count</var> bytes from the stream into <var>Buf</var>.
1120
 
It updates the position pointer, increasing it's value with <var>Count</var>. 
1121
 
<var>Buf</var> must be large enough to contain <var>Count</var> bytes.
1122
 
</p>
1123
 
</descr>
1124
 
<errors>
1125
 
No checking is done to see if <var>Buf</var> is large enough to contain
1126
 
<var>Count</var> bytes. 
1127
 
</errors>
1128
 
<seealso>
1129
 
<link id="TStream.Write"/>
1130
 
<link id="TStream.ReadStr"/>
1131
 
<link id="TStream.StrRead"/>
1132
 
</seealso>
1133
 
<example file="objectex/ex18"/>
1134
 
</element>
1135
 
 
1136
 
 
1137
 
 
1138
 
<element name="TStream.Write">
1139
 
<short>Write a number of bytes to the stream.</short>
1140
 
<descr>
1141
 
<p>
1142
 
<var>Write</var> is an abstract method that should be overridden by descendent
1143
 
objects.
1144
 
</p>
1145
 
<p>
1146
 
<var>Write</var> writes <var>Count</var> bytes to the stream from <var>Buf</var>.
1147
 
It updates the position pointer, increasing it's value with <var>Count</var>.
1148
 
</p>
1149
 
<p>
1150
 
For an example, see <link id="TStream.Read"/>.
1151
 
</p>
1152
 
</descr>
1153
 
<errors>
1154
 
No checking is done to see if <var>Buf</var> actually contains <var>Count</var> bytes.
1155
 
</errors>
1156
 
<seealso>
1157
 
<link id="TStream.Read"/>
1158
 
<link id="TStream.WriteStr"/>
1159
 
<link id="TStream.StrWrite"/>
1160
 
</seealso>
1161
 
</element>
1162
 
 
1163
 
 
1164
 
<element name="TStream.CopyFrom">
1165
 
<short>Copy data from another stream. </short>
1166
 
<descr>
1167
 
<var>CopyFrom</var> reads Count bytes from stream <var>S</var> and stores them
1168
 
in the current stream. It uses the <link id="TStream.Read">Read</link> method
1169
 
to read the data, and the <link id="TStream.Write">Write</link> method to
1170
 
write in the current stream.
1171
 
</descr>
1172
 
<errors>
1173
 
None.
1174
 
</errors>
1175
 
<seealso>
1176
 
<link id="TStream.Read">Read</link>
1177
 
<link id="TStream.Write">Write</link>
1178
 
</seealso>
1179
 
<example file="objectex/ex19"/>
1180
 
</element>
1181
 
 
1182
 
 
1183
 
 
1184
 
<element name="TDosStream">
1185
 
<short>DOS file stream</short>
1186
 
<descr>
1187
 
<p>
1188
 
<var>TDosStream</var> is a stream that stores it's contents in a file.
1189
 
it overrides a couple of methods of <link id="TStream"/> for this.
1190
 
</p>
1191
 
<p>
1192
 
In addition to the fields inherited from <var>TStream</var> (see <link id="TStream"/>),
1193
 
there are some extra fields, that describe the file. (mainly the name and
1194
 
the OS file handle)
1195
 
</p>
1196
 
<p>
1197
 
No buffering in memory is done when using <var>TDosStream</var>.
1198
 
All data are written directly to the file. For a stream that buffers
1199
 
in memory, see <link id="TBufStream"/>.
1200
 
</p>
1201
 
</descr>
1202
 
</element>
1203
 
 
1204
 
<element name="TDosStream.Handle">
1205
 
<short>OS file handle for stream</short>
1206
 
</element>
1207
 
 
1208
 
<element name="TDosStream.FName">
1209
 
<short>File name</short>
1210
 
</element>
1211
 
 
1212
 
<element name="TDosStream.Init">
1213
 
<short>Instantiate a new instance of TDosStream.</short>
1214
 
<descr>
1215
 
<p>
1216
 
<var>Init</var> instantiates an instance of <var>TDosStream</var>. The name of the
1217
 
file that contains (or will contain) the data of the stream is given in
1218
 
<var>FileName</var>. The <var>Mode</var> parameter determines whether a new file 
1219
 
should be created and what access rights you have on the file. 
1220
 
It can be one of the following constants:
1221
 
</p>
1222
 
<dl>
1223
 
<dt>stCreate</dt><dd> Creates a new file.</dd>
1224
 
<dt>stOpenRead</dt><dd> Read access only.</dd>
1225
 
<dt>stOpenWrite</dt><dd> Write access only.</dd>
1226
 
<dt>stOpen</dt><dd> Read and write access.</dd>
1227
 
</dl>
1228
 
<p>
1229
 
For an example, see <link id="TDosStream.Truncate"/>.
1230
 
</p>
1231
 
</descr>
1232
 
<errors>
1233
 
On error, <link id="TStream.Status">Status</link> is set to <var>stInitError</var>, and <var>ErrorInfo</var>
1234
 
is set to the dos error code.
1235
 
</errors>
1236
 
<seealso>
1237
 
<link id="TDosStream.Done"/>
1238
 
</seealso>
1239
 
</element>
1240
 
 
1241
 
 
1242
 
<element name="TDosStream.Done">
1243
 
<short>Closes the file and cleans up the instance.</short>
1244
 
<descr>
1245
 
<p>
1246
 
<var>Done</var> closes the file if it was open and cleans up the 
1247
 
instance of <var>TDosStream</var>. 
1248
 
</p>
1249
 
<p>
1250
 
for an example, see e.g. <link id="TDosStream.Truncate"/>.
1251
 
</p>
1252
 
</descr>
1253
 
<errors>
1254
 
None.
1255
 
</errors>
1256
 
<seealso>
1257
 
<link id="TDosStream.Init"/>
1258
 
<link id="TDosStream.Close"/>
1259
 
</seealso>
1260
 
</element>
1261
 
 
1262
 
 
1263
 
<element name="TDosStream.Close">
1264
 
<short>Close the file.</short>
1265
 
<descr>
1266
 
<p>
1267
 
<var>Close</var> closes the file if it was open, and sets <var>Handle</var> to -1. 
1268
 
Contrary to <link id="TDosStream.Done">Done</link> it does not clean up the instance
1269
 
of <var>TDosStream</var>
1270
 
</p>
1271
 
<p>
1272
 
For an example, see <link id="TDosStream.Open"/>.
1273
 
</p>
1274
 
</descr>
1275
 
<errors>
1276
 
None.
1277
 
</errors>
1278
 
<seealso>
1279
 
<link id="TStream.Close"/>
1280
 
<link id="TDosStream.Init"/>
1281
 
<link id="TDosStream.Done"/>
1282
 
</seealso>
1283
 
</element>
1284
 
 
1285
 
 
1286
 
<element name="TDosStream.Truncate">
1287
 
<short>Truncate the file on the current position.</short>
1288
 
<descr>
1289
 
If the status of the stream is <var>stOK</var>, then <var>Truncate</var> tries to
1290
 
truncate the stream size to the current file position.
1291
 
</descr>
1292
 
<errors>
1293
 
If an error occurs, the stream's status is set to <var>stError</var> and
1294
 
<var>ErrorInfo</var> is set to the OS error code.
1295
 
</errors>
1296
 
<seealso>
1297
 
<link id="TStream.Truncate"/>
1298
 
<link id="TStream.GetSize"/>
1299
 
</seealso>
1300
 
<example file="objectex/ex16"/>
1301
 
</element>
1302
 
 
1303
 
 
1304
 
 
1305
 
<element name="TDosStream.Seek">
1306
 
<short>Set file position.</short>
1307
 
<descr>
1308
 
If the stream's status is <var>stOK</var>, then <var>Seek</var> sets the 
1309
 
file position to <var>Pos</var>. <var>Pos</var> is a zero-based offset, counted from
1310
 
the beginning of the file.
1311
 
</descr>
1312
 
<errors>
1313
 
In case an error occurs, the stream's status is set to <var>stSeekError</var>,
1314
 
and the OS error code is stored in <var>ErrorInfo</var>.
1315
 
</errors>
1316
 
<seealso>
1317
 
<link id="TStream.Seek"/>
1318
 
<link id="TStream.GetPos"/>
1319
 
</seealso>
1320
 
<example file="objectex/ex17"/>
1321
 
</element>
1322
 
 
1323
 
 
1324
 
 
1325
 
<element name="TDosStream.Open">
1326
 
<short>Open the file stream</short>
1327
 
<descr>
1328
 
If the stream's status is <var>stOK</var>, and the stream is closed then
1329
 
<var>Open</var> re-opens the file stream with mode <var>OpenMode</var>.
1330
 
This call can be used after a <link id="TDosStream.Close">Close</link> call.
1331
 
</descr>
1332
 
<errors>
1333
 
If an error occurs when re-opening the file, then <var>Status</var> is set
1334
 
to <var>stOpenError</var>, and the OS error code is stored in <var>ErrorInfo</var>
1335
 
</errors>
1336
 
<seealso>
1337
 
<link id="TStream.Open"/>
1338
 
<link id="TDosStream.Close"/>
1339
 
</seealso>
1340
 
<example file="objectex/ex14"/>
1341
 
</element>
1342
 
 
1343
 
<element name="TDosStream.Read">
1344
 
<short>Read data from the stream to a buffer.</short>
1345
 
<descr>
1346
 
<p>
1347
 
If the Stream is open and the stream status is <var>stOK</var> then 
1348
 
<var>Read</var> will read <var>Count</var> bytes from the stream and place them
1349
 
in  <var>Buf</var>.
1350
 
</p>
1351
 
<p>
1352
 
For an example, see <link id="TStream.Read"/>.
1353
 
</p>
1354
 
</descr>
1355
 
<errors>
1356
 
In case of an error, <var>Status</var> is set to <var>StReadError</var>, and
1357
 
<var>ErrorInfo</var> gets the OS specific error, or 0 when an attempt was
1358
 
made to read beyond the end of the stream.
1359
 
</errors>
1360
 
<seealso>
1361
 
<link id="TStream.Read"/>
1362
 
<link id="TDosStream.Write"/>
1363
 
</seealso>
1364
 
</element>
1365
 
 
1366
 
<element name="TDosStream.Write">
1367
 
<short>Write data from a buffer to the stream.</short>
1368
 
<descr>
1369
 
<p>
1370
 
If the Stream is open and the stream status is <var>stOK</var> then 
1371
 
<var>Write</var> will write <var>Count</var> bytes from <var>Buf</var> and place them
1372
 
in the stream.
1373
 
</p>
1374
 
<p>
1375
 
For an example, see <link id="TStream.Read"/>.
1376
 
</p>
1377
 
</descr>
1378
 
<errors>
1379
 
In case of an error, <var>Status</var> is set to <var>StWriteError</var>, and
1380
 
<var>ErrorInfo</var> gets the OS specific error.
1381
 
</errors>
1382
 
<seealso>
1383
 
<link id="TStream.Write"/>
1384
 
<link id="TDosStream.Read"/>
1385
 
</seealso>
1386
 
</element>
1387
 
 
1388
 
 
1389
 
<element name="PBufStream">
1390
 
<short>Pointer to <link id="TBufStream"/> object.</short>
1391
 
</element>
1392
 
 
1393
 
<element name="PDosStream">
1394
 
<short>Pointer to <link id="TDosStream"/> object.</short>
1395
 
</element>
1396
 
 
1397
 
<element name="PMemoryStream">
1398
 
<short>Pointer to <link id="TMemoryStream"/> object.</short>
1399
 
</element>
1400
 
 
1401
 
 
1402
 
<element name="PCollection">
1403
 
<short>Pointer to <link id="TCollection"/> object.</short>
1404
 
</element>
1405
 
 
1406
 
 
1407
 
<element name="PItemList">
1408
 
<short>Pointer to <link id="TItemList"/> object.</short>
1409
 
</element>
1410
 
 
1411
 
 
1412
 
<element name="PObject">
1413
 
<short>Pointer to <link id="TObject"/> object.</short>
1414
 
</element>
1415
 
 
1416
 
<element name="PRect">
1417
 
<short>Pointer to <link id="TRect"/> object.</short>
1418
 
</element>
1419
 
 
1420
 
<element name="PResourceCollection">
1421
 
<short>Pointer to <link id="TResourceCollection"/> object.</short>
1422
 
</element>
1423
 
 
1424
 
<element name="PSortedCollection">
1425
 
<short>Pointer to <link id="TSortedCollection"/> object.</short>
1426
 
</element>
1427
 
 
1428
 
<element name="PSTrCollection">
1429
 
<short>Pointer to <link id="TStrCollection"/> object.</short>
1430
 
</element>
1431
 
 
1432
 
<element name="PSTrListMaker">
1433
 
<short>Pointer to <link id="TStrListMaker"/> object.</short>
1434
 
</element>
1435
 
 
1436
 
<element name="PStringCollection">
1437
 
<short>Pointer to <link id="TStringCollection"/> object.</short>
1438
 
</element>
1439
 
 
1440
 
<element name="PStringList">
1441
 
<short>Pointer to <link id="TStringList"/> object.</short>
1442
 
</element>
1443
 
 
1444
 
<element name="PUnsortedStrCollection">
1445
 
<short>Pointer to <link id="TUnsortedStrCollection"/> object.</short>
1446
 
</element>
1447
 
 
1448
 
 
1449
 
<element name="PResourceFile">
1450
 
<short>Pointer to <link id="TResourceFile"/> object.</short>
1451
 
</element>
1452
 
 
1453
 
 
1454
 
<element name="PStrIndex">
1455
 
<short>Pointer to <link id="TStrIndex"/> array.</short>
1456
 
</element>
1457
 
 
1458
 
 
1459
 
 
1460
 
<element name="PObject">
1461
 
<short>Pointer to <link id="TObject"/> object.</short>
1462
 
</element>
1463
 
 
1464
 
 
1465
 
<element name="TBufStream">
1466
 
<short>Buffered file stream</short>
1467
 
<descr>
1468
 
<p>
1469
 
<var>Bufstream</var> implements a buffered file stream. That is, all data written
1470
 
to the stream is written to memory first. Only when the buffer is full, or
1471
 
on explicit request, the data is written to disk.
1472
 
</p>
1473
 
<p>
1474
 
Also, when reading from the stream, first the buffer is checked if there is
1475
 
any unread data in it. If so, this is read first. If not the buffer is
1476
 
filled again, and then the data is read from the buffer.
1477
 
</p>
1478
 
<p>
1479
 
The size of the buffer is fixed and is set when constructing the file.
1480
 
</p>
1481
 
<p>
1482
 
This is useful if you need heavy throughput for your stream, because it
1483
 
speeds up operations.
1484
 
</p>
1485
 
</descr>
1486
 
<seealso>
1487
 
link id
1488
 
</seealso>
1489
 
</element>
1490
 
 
1491
 
<element name="TBufStream.LastMode">
1492
 
<short>Last file open mode</short>
1493
 
</element>
1494
 
 
1495
 
<element name="TBufStream.BufSize">
1496
 
<short>Size of buffer</short>
1497
 
</element>
1498
 
 
1499
 
<element name="TBufStream.BufPtr">
1500
 
<short>Pointer to current position in buffer</short>
1501
 
</element>
1502
 
 
1503
 
<element name="TBufStream.Bufend">
1504
 
<short>End of data in buffer.</short>
1505
 
</element>
1506
 
 
1507
 
<element name="TBufStream.Buffer">
1508
 
<short>Actual buffer</short>
1509
 
</element>
1510
 
 
1511
 
<element name="TBufStream.Init">
1512
 
<short>Initialize an instance of <var>TBufStream</var> and open the file.</short>
1513
 
<descr>
1514
 
<p>
1515
 
<var>Init</var> instantiates an instance of <var>TBufStream</var>. The name of the 
1516
 
file that contains (or will contain) the data of the stream is given in
1517
 
<var>FileName</var>. The <var>Mode</var> parameter determines whether a new file 
1518
 
should be created and what access rights you have on the file. 
1519
 
It can be one of the following constants:
1520
 
</p>
1521
 
<dl>
1522
 
<dt>stCreate</dt><dd> Creates a new file.</dd>
1523
 
<dt>stOpenRead</dt><dd> Read access only.</dd>
1524
 
<dt>stOpenWrite</dt><dd> Write access only.</dd>
1525
 
<dt>stOpen</dt><dd> Read and write access.</dd>
1526
 
</dl>
1527
 
<p>
1528
 
The <var>Size</var> parameter determines the size of the buffer that will be
1529
 
created. It should be different from zero.
1530
 
</p>
1531
 
<p>
1532
 
For an example see <link id="TBufStream.Flush"/>.
1533
 
</p>
1534
 
</descr>
1535
 
<errors>
1536
 
On error, <var>Status</var> is set to <var>stInitError</var>, and <var>ErrorInfo</var>
1537
 
is set to the dos error code.
1538
 
</errors>
1539
 
<seealso>
1540
 
<link id="TDosStream.Init"/>
1541
 
<link id="TBufStream.Done"/>
1542
 
</seealso>
1543
 
</element>
1544
 
 
1545
 
 
1546
 
<element name="TBufStream.Done">
1547
 
<short>Close the file and cleans up the instance.</short>
1548
 
<descr>
1549
 
<p>
1550
 
<var>Done</var> flushes and closes the file if it was open and cleans up the 
1551
 
instance of <var>TBufStream</var>. 
1552
 
</p>
1553
 
<p>
1554
 
For an example see <link id="TBufStream.Flush"/>.
1555
 
</p>
1556
 
</descr>
1557
 
<errors>
1558
 
None.
1559
 
</errors>
1560
 
<seealso>
1561
 
<link id="TDosStream.Done"/>
1562
 
<link id="TBufStream.Init"/>
1563
 
<link id="TBufStream.Close"/>
1564
 
</seealso>
1565
 
</element>
1566
 
 
1567
 
 
1568
 
<element name="TBufStream.Close">
1569
 
<short>Flush data and Close the file.</short>
1570
 
<descr>
1571
 
<p>
1572
 
<var>Close</var> flushes and closes the file if it was open, and sets <var>Handle</var> to -1. 
1573
 
Contrary to <link id="TBufStream.Done">Done</link> it does not clean up the instance
1574
 
of <var>TBufStream</var>
1575
 
</p>
1576
 
<p>
1577
 
For an example see <link id="TBufStream.Flush"/>.
1578
 
</p>
1579
 
</descr>
1580
 
<errors>
1581
 
None.
1582
 
</errors>
1583
 
<seealso>
1584
 
<link id="TStream.Close"/>
1585
 
<link id="TBufStream.Init"/>
1586
 
<link id="TBufStream.Done"/>
1587
 
</seealso>
1588
 
</element>
1589
 
 
1590
 
 
1591
 
<element name="TBufStream.Flush">
1592
 
<short>FLush data from buffer, and write it to stream.</short>
1593
 
<descr>
1594
 
When the stream is in write mode, the contents of the buffer are written to
1595
 
disk, and the buffer position is set to zero.
1596
 
 
1597
 
When the stream is in read mode, the buffer position is set to zero.
1598
 
</descr>
1599
 
<errors>
1600
 
Write errors may occur if the file was in write mode.
1601
 
see <link id="TBufStream.Write">Write</link> for more info on the errors.
1602
 
</errors>
1603
 
<seealso>
1604
 
<link id="TStream.Close"/>
1605
 
<link id="TBufStream.Init"/>
1606
 
<link id="TBufStream.Done"/>
1607
 
</seealso>
1608
 
<example file="objectex/ex15"/>
1609
 
</element>
1610
 
 
1611
 
 
1612
 
 
1613
 
<element name="TBufStream.Truncate">
1614
 
<short>Flush buffer, and truncate the file at current position.</short>
1615
 
<descr>
1616
 
<p>
1617
 
If the status of the stream is <var>stOK</var>, then <var>Truncate</var> tries to
1618
 
flush the buffer, and then truncates the stream size to the current 
1619
 
file position.
1620
 
</p>
1621
 
<p>
1622
 
For an example, see <link id="TDosStream.Truncate"/>.
1623
 
</p>
1624
 
</descr>
1625
 
<errors>
1626
 
Errors can be those of <link id="TBufStream.Flush">Flush</link> or
1627
 
<link id="TDosStream.Truncate"/>.
1628
 
</errors>
1629
 
<seealso>
1630
 
<link id="TStream.Truncate"/>
1631
 
<link id="TDosStream.Truncate"/>
1632
 
<link id="TStream.GetSize"/>
1633
 
</seealso>
1634
 
</element>
1635
 
 
1636
 
 
1637
 
<element name="TBufStream.Seek">
1638
 
<short>Set current position in file.</short>
1639
 
<descr>
1640
 
<p>
1641
 
If the stream's status is <var>stOK</var>, then <var>Seek</var> sets the 
1642
 
file position to <var>Pos</var>. <var>Pos</var> is a zero-based offset, counted from
1643
 
the beginning of the file.
1644
 
</p>
1645
 
<p>
1646
 
For an example, see <link id="TStream.Seek"/>;
1647
 
</p>
1648
 
</descr>
1649
 
<errors>
1650
 
In case an error occurs, the stream's status is set to <var>stSeekError</var>,
1651
 
and the OS error code is stored in <var>ErrorInfo</var>.
1652
 
</errors>
1653
 
<seealso>
1654
 
<link id="TStream.Seek"/>
1655
 
<link id="TStream.GetPos"/>
1656
 
</seealso>
1657
 
</element>
1658
 
 
1659
 
 
1660
 
<element name="TBufStream.Open">
1661
 
<short>Open the file if it is closed.</short>
1662
 
<descr>
1663
 
<p>
1664
 
If the stream's status is <var>stOK</var>, and the stream is closed then
1665
 
<var>Open</var> re-opens the file stream with mode <var>OpenMode</var>.
1666
 
This call can be used after a <link id="TBufStream.Close">Close</link> call.
1667
 
</p>
1668
 
<p>
1669
 
For an example, see <link id="TDosStream.Open"/>.
1670
 
</p>
1671
 
</descr>
1672
 
<errors>
1673
 
If an error occurs when re-opening the file, then <var>Status</var> is set
1674
 
to <var>stOpenError</var>, and the OS error code is stored in <var>ErrorInfo</var>
1675
 
</errors>
1676
 
<seealso>
1677
 
<link id="TStream.Open"/>
1678
 
<link id="TBufStream.Close"/>
1679
 
</seealso>
1680
 
</element>
1681
 
 
1682
 
 
1683
 
<element name="TBufStream.Read">
1684
 
<short>Read data from the file to a buffer in memory.</short>
1685
 
<descr>
1686
 
<p>
1687
 
If the Stream is open and the stream status is <var>stOK</var> then 
1688
 
<var>Read</var> will read <var>Count</var> bytes from the stream and place them
1689
 
in  <var>Buf</var>.
1690
 
</p>
1691
 
<p>
1692
 
<var>Read</var> will first try to read the data from the stream's internal
1693
 
buffer. If insufficient data is available, the buffer will be filled before
1694
 
contiunuing to read. This process is repeated until all needed data
1695
 
has been read.
1696
 
</p>
1697
 
<p>
1698
 
For an example, see <link id="TStream.Read"/>.
1699
 
</p>
1700
 
</descr>
1701
 
<errors>
1702
 
In case of an error, <var>Status</var> is set to <var>StReadError</var>, and
1703
 
<var>ErrorInfo</var> gets the OS specific error, or 0 when an attempt was
1704
 
made to read beyond the end of the stream.
1705
 
</errors>
1706
 
<seealso>
1707
 
<link id="TStream.Read"/>
1708
 
<link id="TBufStream.Write"/>
1709
 
</seealso>
1710
 
</element>
1711
 
 
1712
 
 
1713
 
<element name="TBufStream.Write">
1714
 
<short>Write data to the file from a buffer in memory.</short>
1715
 
<descr>
1716
 
<p>
1717
 
If the Stream is open and the stream status is <var>stOK</var> then 
1718
 
<var>Write</var> will write <var>Count</var> bytes from <var>Buf</var> and place them
1719
 
in the stream.
1720
 
</p>
1721
 
<p>
1722
 
<var>Write</var> will first try to write the data to the stream's internal
1723
 
buffer. When the internal buffer is full, then the contents will be written
1724
 
to disk. This process is repeated until all data has been written.
1725
 
</p>
1726
 
<p>
1727
 
For an example, see <link id="TStream.Read"/>.
1728
 
</p>
1729
 
</descr>
1730
 
<errors>
1731
 
In case of an error, <var>Status</var> is set to <var>StWriteError</var>, and
1732
 
<var>ErrorInfo</var> gets the OS specific error.
1733
 
</errors>
1734
 
<seealso>
1735
 
<link id="TStream.Write"/>
1736
 
<link id="TBufStream.Read"/>
1737
 
</seealso>
1738
 
</element>
1739
 
 
1740
 
 
1741
 
<element name="TMemoryStream">
1742
 
<short>Stream which keeps data in memory.</short>
1743
 
<descr>
1744
 
<p>
1745
 
The <var>TMemoryStream</var> object implements a stream that stores it's data
1746
 
in memory. The data is stored on the heap, with the possibility to specify
1747
 
the maximum amout of data, and the the size of the memory blocks being used.
1748
 
</p>
1749
 
</descr>
1750
 
<seealso>
1751
 
<link id="TStream"/>
1752
 
</seealso>
1753
 
</element>
1754
 
 
1755
 
<element name="TMemoryStream.BlkCount">
1756
 
<short>Number of allocated memory blocks</short>
1757
 
</element>
1758
 
 
1759
 
<element name="TMemoryStream.BlkSize">
1760
 
<short>Size of one memory block</short>
1761
 
</element>
1762
 
 
1763
 
<element name="TMemoryStream.MemSize">
1764
 
<short>Total memory size</short>
1765
 
</element>
1766
 
 
1767
 
<element name="TMemoryStream.BlkList">
1768
 
<short>Pointer to list of allocated blocks.</short>
1769
 
</element>
1770
 
 
1771
 
<element name="TMemoryStream.Init">
1772
 
<short>Initialize memory stream, reserves memory for stream data.</short>
1773
 
<descr>
1774
 
<p>
1775
 
<var>Init</var> instantiates a new <var>TMemoryStream</var> object. The
1776
 
memorystreamobject will initially allocate at least <var>ALimit</var> bytes memory, 
1777
 
divided into memory blocks of size <var>ABlockSize</var>. 
1778
 
The number of blocks needed to get to <var>ALimit</var> bytes is rounded up.
1779
 
</p>
1780
 
<p>
1781
 
By default, the number of blocks is 1, and the size of a block is 8192. This
1782
 
is selected if you specify 0 as the blocksize.
1783
 
</p>
1784
 
<p>
1785
 
For an example, see e.g <link id="TStream.CopyFrom"/>.
1786
 
</p>
1787
 
</descr>
1788
 
<errors>
1789
 
If the stream cannot allocate the initial memory needed for the memory blocks, then
1790
 
the stream's status is set to <var>stInitError</var>.
1791
 
</errors>
1792
 
<seealso>
1793
 
<link id="TMemoryStream.Done"/>
1794
 
</seealso>
1795
 
</element>
1796
 
 
1797
 
 
1798
 
<element name="TMemoryStream.Done">
1799
 
<short>Clean up memory and destroy the object instance.</short>
1800
 
<descr>
1801
 
<p>
1802
 
<var>Done</var> releases the memory blocks used by the stream, and then cleans up
1803
 
the memory used by the stream object itself.
1804
 
</p>
1805
 
<p>
1806
 
For an example, see e.g <link id="TStream.CopyFrom"/>.
1807
 
</p>
1808
 
</descr>
1809
 
<errors>
1810
 
None.
1811
 
</errors>
1812
 
<seealso>
1813
 
<link id="TMemoryStream.Init"/>
1814
 
</seealso>
1815
 
</element>
1816
 
 
1817
 
 
1818
 
<element name="TMemoryStream.Truncate">
1819
 
<short>Set the stream size to the current position.</short>
1820
 
<descr>
1821
 
<var>Truncate</var> sets the size of the memory stream equal to the current
1822
 
position. It de-allocates any memory-blocks that are no longer needed, so
1823
 
that the new size of the stream is the current position in the stream,
1824
 
rounded up to the first multiple of the stream blocksize.
1825
 
</descr>
1826
 
<errors> 
1827
 
If an error occurs during memory de-allocation, the stream's status is set
1828
 
to <var>stError</var>
1829
 
</errors>
1830
 
<seealso>
1831
 
<link id="TStream.Truncate"/>
1832
 
</seealso>
1833
 
<example file="objectex/ex20"/>
1834
 
</element>
1835
 
 
1836
 
 
1837
 
 
1838
 
<element name="TMemoryStream.Read">
1839
 
<short>Read data from the stream to a location in memory.</short>
1840
 
<descr>
1841
 
<p>
1842
 
<var>Read</var> reads <var>Count</var> bytes from the stream to <var>Buf</var>. It updates
1843
 
the position of the stream.
1844
 
</p>
1845
 
<p>
1846
 
For an example, see <link id="TStream.Read"/>.
1847
 
</p>
1848
 
</descr>
1849
 
<errors>
1850
 
If there is not enough data available, no data is read, and the stream's
1851
 
status is set to <var>stReadError</var>.
1852
 
</errors>
1853
 
<seealso>
1854
 
<link id="TStream.Read"/>
1855
 
<link id="TMemoryStream.Write"/>
1856
 
</seealso>
1857
 
</element>
1858
 
 
1859
 
 
1860
 
<element name="TMemoryStream.Write">
1861
 
<short>Write data to the stream.</short>
1862
 
<descr>
1863
 
<p>
1864
 
<var>Write</var> copies <var>Count</var> bytes from <var>Buf</var> to the stream. It
1865
 
updates the position of the stream. 
1866
 
</p>
1867
 
<p>
1868
 
If not enough memory is available to hold the extra <var>Count</var> bytes, 
1869
 
then the stream will try to expand, by allocating as much blocks with 
1870
 
size <var>BlkSize</var> (as specified in the constuctor call
1871
 
<link id="TMemoryStream.Init">Init</link>) as needed. 
1872
 
</p>
1873
 
<p>
1874
 
For an example, see <link id="TStream.Read"/>.
1875
 
</p>
1876
 
</descr>
1877
 
<errors>
1878
 
If the stream cannot allocate more memory, then the status is set to
1879
 
<var>stWriteError</var>
1880
 
</errors>
1881
 
<seealso>
1882
 
<link id="TStream.Write"/>
1883
 
<link id="TMemoryStream.Read"/>
1884
 
</seealso>
1885
 
</element>
1886
 
 
1887
 
 
1888
 
<element name="TCollection">
1889
 
<short>Manage a collection of pointers of objects</short>
1890
 
<descr>
1891
 
<p>
1892
 
The <var>TCollection</var> object manages a collection of pointers or objects.
1893
 
It also provides a series of methods to manipulate these pointers or
1894
 
objects.
1895
 
</p>
1896
 
<p>
1897
 
Whether or not objects are used depends on the kind of calls you use.
1898
 
All kinds come in 2 flavors, one for objects, one for pointers.
1899
 
</p>
1900
 
</descr>
1901
 
</element>
1902
 
 
1903
 
<element name="TCollection.Items">
1904
 
<short>Pointer to list of items.</short>
1905
 
</element>
1906
 
 
1907
 
<element name="TCollection.Count">
1908
 
<short>Current count of items</short>
1909
 
</element>
1910
 
 
1911
 
<element name="TCollection.Limit">
1912
 
<short>Max number of items</short>
1913
 
</element>
1914
 
 
1915
 
<element name="TCollection.Delta">
1916
 
<short>Number of pointers to allocate when adding items.</short>
1917
 
</element>
1918
 
 
1919
 
<element name="TCollection.Init">
1920
 
<short>Instantiate a new collection.</short>
1921
 
<descr>
1922
 
<p>
1923
 
<var>Init</var> initializes a new instance of a collection. It sets the (initial) maximum number
1924
 
of items in the collection to <var>ALimit</var>. <var>ADelta</var> is the increase
1925
 
size : The number of memory places that will be allocatiod in case <var>ALimit</var> is reached,
1926
 
and another element is added to the collection.
1927
 
</p>
1928
 
<p>
1929
 
For an example, see <link id="TCollection.ForEach"/>.
1930
 
</p>
1931
 
</descr>
1932
 
<errors>
1933
 
None.
1934
 
</errors>
1935
 
<seealso>
1936
 
<link id="TCollection.Load"/>
1937
 
<link id="TCollection.Done"/>
1938
 
</seealso>
1939
 
</element>
1940
 
 
1941
 
 
1942
 
<element name="TCollection.Load">
1943
 
<short>Initialize a new collection and load collection from a stream.</short>
1944
 
<descr>
1945
 
<var>Load</var> initializes a new instance of a collection. It reads from stream
1946
 
<var>S</var> the item count, the item limit count, and the increase size. After
1947
 
that, it reads the specified number of items from the stream. 
1948
 
<!--  Do not call this method if you intend to use only pointers in your collection. -->
1949
 
</descr>
1950
 
<errors>
1951
 
Errors returned can be those of <link id="TCollection.GetItem">GetItem</link>.
1952
 
</errors>
1953
 
<seealso>
1954
 
<link id="TCollection.Init"/>
1955
 
<link id="TCollection.GetItem"/>
1956
 
<link id="TCollection.Done"/>
1957
 
</seealso>
1958
 
<example file="objectex/ex22"/>
1959
 
</element>
1960
 
 
1961
 
 
1962
 
 
1963
 
<element name="TCollection.Done">
1964
 
<short>Clean up collection, release all memory.</short>
1965
 
<descr>
1966
 
<p>
1967
 
<var>Done</var> frees all objects in the collection, and then releases all memory
1968
 
occupied by the instance.
1969
 
</p>
1970
 
<p>
1971
 
For an example, see <link id="TCollection.ForEach"/>.
1972
 
</p>
1973
 
<!--  Do not call this method if you intend to use only pointers in your collection. -->
1974
 
</descr>
1975
 
<errors>
1976
 
None.
1977
 
</errors>
1978
 
<seealso>
1979
 
<link id="TCollection.Init"/>
1980
 
<link id="TCollection.FreeAll"/>
1981
 
</seealso>
1982
 
</element>
1983
 
 
1984
 
 
1985
 
<element name="TCollection.At">
1986
 
<short>Return the item at a certain index.</short>
1987
 
<descr>
1988
 
<var>At</var> returns the item at position <var>Index</var>.
1989
 
</descr>
1990
 
<errors>
1991
 
If <var>Index</var> is less than zero or larger than the number of items
1992
 
in the collection, seepl{Error}{TCollection.Error} is called with
1993
 
<var>coIndexError</var> and <var>Index</var> as arguments, resulting in a run-time
1994
 
error.
1995
 
</errors>
1996
 
<seealso>
1997
 
<link id="TCollection.Insert"/>
1998
 
</seealso>
1999
 
<example file="objectex/ex23"/>
2000
 
</element>
2001
 
 
2002
 
 
2003
 
 
2004
 
<element name="TCollection.IndexOf">
2005
 
<short>Find the position of a certain item.</short>
2006
 
<descr>
2007
 
<var>IndexOf</var> returns the index of <var>Item</var> in the collection.
2008
 
If <var>Item</var> isn't present in the collection, -1 is returned.
2009
 
</descr>
2010
 
<errors>
2011
 
If the item is not present, -1 is returned.
2012
 
</errors>
2013
 
<seealso>
2014
 
<link id="TCollection.At"/>
2015
 
<link id="TCollection.GetItem"/>
2016
 
<link id="TCollection.Insert"/>
2017
 
</seealso>
2018
 
<example file="objectex/ex24"/>
2019
 
</element>
2020
 
 
2021
 
 
2022
 
 
2023
 
<element name="TCollection.GetItem">
2024
 
<short>Read one item off the stream.</short>
2025
 
<descr>
2026
 
<var>GetItem</var> reads a single item off the stream <var>S</var>, and
2027
 
returns a pointer to this item. This method is used internally by the Load
2028
 
method, and should not be used directly.
2029
 
</descr>
2030
 
<errors>
2031
 
Possible errors are the ones from <link id="TStream.Get"/>.
2032
 
</errors>
2033
 
<seealso>
2034
 
<link id="TStream.Get"/>, 
2035
 
<link id="TCollection.Store"/>
2036
 
</seealso>
2037
 
</element>
2038
 
 
2039
 
<element name="TCollection.LastThat">
2040
 
<short>Return last item which matches a test.</short>
2041
 
<descr>
2042
 
This function returns the last item in the collection for which <var>Test</var>
2043
 
returns a non-nil result. <var>Test</var> is a function that accepts 1 argument:
2044
 
a pointer to an object, and that returns a pointer as a result.
2045
 
</descr>
2046
 
<errors>
2047
 
None.
2048
 
</errors>
2049
 
<seealso>
2050
 
<link id="TCollection.FirstThat"/>
2051
 
</seealso>
2052
 
<example file="objectex/ex25"/>
2053
 
</element>
2054
 
 
2055
 
 
2056
 
 
2057
 
<element name="TCollection.FirstThat">
2058
 
<short>Return first item which matches a test.</short>
2059
 
<descr>
2060
 
This function returns the first item in the collection for which <var>Test</var>
2061
 
returns a non-nil result. <var>Test</var> is a function that accepts 1 argument:
2062
 
a pointer to an object, and that returns a pointer as a result.
2063
 
</descr>
2064
 
<errors>
2065
 
None.
2066
 
</errors>
2067
 
<seealso>
2068
 
<link id="TCollection.LastThat"/>
2069
 
</seealso>
2070
 
<example file="objectex/ex26"/>
2071
 
</element>
2072
 
 
2073
 
 
2074
 
 
2075
 
<element name="TCollection.Pack">
2076
 
<short>Remove all <var>>Nil</var> pointers from the collection.</short>
2077
 
<descr>
2078
 
<var>Pack</var> removes all <var>Nil</var> pointers from the collection, and adjusts
2079
 
<var>Count</var> to reflect this change. No memory is freed as a result of this
2080
 
call. In order to free any memory, you can call <var>SetLimit</var> with an
2081
 
argument of <var>Count</var> after a call to <var>Pack</var>.
2082
 
</descr>
2083
 
<errors>
2084
 
None.
2085
 
</errors>
2086
 
<seealso>
2087
 
<link id="TCollection.SetLimit"/>
2088
 
</seealso>
2089
 
<example file="objectex/ex26"/>
2090
 
</element>
2091
 
 
2092
 
 
2093
 
 
2094
 
<element name="TCollection.FreeAll">
2095
 
<short>Release all objects from the collection.</short>
2096
 
<descr>
2097
 
<var>FreeAll</var> calls the destructor of each object in the collection.
2098
 
It doesn't release any memory occumpied by the collection itself, but it
2099
 
does set <var>Count</var> to zero.
2100
 
</descr>
2101
 
<errors>
2102
 
</errors>
2103
 
<seealso>
2104
 
<link id="TCollection.DeleteAll"/>
2105
 
<link id="TCollection.FreeItem"/>
2106
 
</seealso>
2107
 
<example file="objectex/ex28"/>
2108
 
</element>
2109
 
 
2110
 
<element name="TCollection.DeleteAll">
2111
 
<short>Delete all elements from the collection. Objects are not destroyed.</short>
2112
 
<descr>
2113
 
<var>DeleteAll</var> deletes all elements from the collection. It just sets 
2114
 
the <var>Count</var> variable to zero. Contrary to
2115
 
<link id="TCollection.FreeAll">FreeAll</link>, <var>DeletAll</var> doesn't call the
2116
 
destructor of the objects.
2117
 
</descr>
2118
 
<errors>
2119
 
None.
2120
 
</errors>
2121
 
<seealso>
2122
 
<link id="TCollection.FreeAll"/>
2123
 
<link id="TCollection.Delete"/>
2124
 
</seealso>
2125
 
<example file="objectex/ex29"/>
2126
 
</element>
2127
 
 
2128
 
 
2129
 
 
2130
 
<element name="TCollection.Free">
2131
 
<short>Free item from collection, calling it's destructor.</short>
2132
 
<descr>
2133
 
<var>Free</var> Deletes <var>Item</var> from the collection, and calls the destructor
2134
 
<var>Done</var> of the object.
2135
 
</descr>
2136
 
<errors>
2137
 
If the <var>Item</var> is not in the collection, <var>Error</var> will be called with
2138
 
<var>coIndexError</var>.
2139
 
</errors>
2140
 
<seealso>
2141
 
<link id="TCollection.FreeItem"/>
2142
 
</seealso>
2143
 
<example file="objectex/ex30"/>
2144
 
</element>
2145
 
 
2146
 
 
2147
 
 
2148
 
<element name="TCollection.Insert">
2149
 
<short>Insert a new item in the collection at the end.</short>
2150
 
<descr>
2151
 
<var>Insert</var> inserts <var>Item</var> in the collection. <var>TCollection</var>
2152
 
inserts this item at the end, but descendent objects may insert it at
2153
 
another place.
2154
 
</descr>
2155
 
<errors>
2156
 
None.
2157
 
</errors>
2158
 
<seealso>
2159
 
<link id="TCollection.AtInsert"/>
2160
 
<link id="TCollection.AtPut"/>
2161
 
</seealso>
2162
 
</element>
2163
 
 
2164
 
 
2165
 
<element name="TCollection.Delete">
2166
 
<short>Delete an item from the collection, but does not destroy it.</short>
2167
 
<descr>
2168
 
<var>Delete</var> deletes <var>Item</var> from the collection. It doesn't call the
2169
 
item's destructor, though. For this the <link id="TCollection.Free">Free</link>
2170
 
call is provided.
2171
 
</descr>
2172
 
<errors>
2173
 
If the <var>Item</var> is not in the collection, <var>Error</var> will be called with
2174
 
<var>coIndexError</var>.
2175
 
</errors>
2176
 
<seealso>
2177
 
<link id="TCollection.AtDelete"/>
2178
 
<link id="TCollection.Free"/>
2179
 
</seealso>
2180
 
<example file="objectex/ex31"/>
2181
 
</element>
2182
 
 
2183
 
 
2184
 
 
2185
 
<element name="TCollection.AtFree">
2186
 
<short>Free an item at the indicates position, calling it's destructor.</short>
2187
 
<descr>
2188
 
<var>AtFree</var> deletes the item at position <var>Index</var> in the collection,
2189
 
and calls the item's destructor if it is not <var>Nil</var>. 
2190
 
</descr>
2191
 
<errors>
2192
 
If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
2193
 
with <var>CoIndexError</var>.
2194
 
</errors>
2195
 
<seealso>
2196
 
<link id="TCollection.Free"/>
2197
 
<link id="TCollection.AtDelete"/>
2198
 
</seealso>
2199
 
<example file="objectex/ex32"/>
2200
 
</element>
2201
 
 
2202
 
 
2203
 
<element name="TCollection.FreeItem">
2204
 
<short>Destroy a non-nil item.</short>
2205
 
<descr>
2206
 
<p>
2207
 
<var>FreeItem</var> calls the destructor of <var>Item</var> if it is not
2208
 
nil.
2209
 
</p>
2210
 
<remark>
2211
 
This function is used internally by the TCollection object, and should not be
2212
 
called directly.
2213
 
</remark>
2214
 
</descr>
2215
 
<errors>
2216
 
None.
2217
 
</errors>
2218
 
<seealso>
2219
 
<link id="TCollection.Free"/>
2220
 
<link id="TCollection.AtFree"/>
2221
 
</seealso>
2222
 
</element>
2223
 
 
2224
 
 
2225
 
<element name="TCollection.AtDelete">
2226
 
<short>Delete item at certain position.</short>
2227
 
<descr>
2228
 
<var>AtDelete</var> deletes the pointer at position <var>Index</var> in the
2229
 
collection. It doesn't call the object's destructor.
2230
 
</descr>
2231
 
<errors>
2232
 
If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
2233
 
with <var>CoIndexError</var>.
2234
 
</errors>
2235
 
<seealso>
2236
 
<link id="TCollection.Delete"/>
2237
 
</seealso>
2238
 
<example file="objectex/ex33"/>
2239
 
</element>
2240
 
 
2241
 
 
2242
 
<element name="TCollection.ForEach">
2243
 
<short>Execute procedure for each item in the list.</short>
2244
 
<descr>
2245
 
<p>
2246
 
<var>ForEach</var> calls <var>Action</var> for each element in the collection,
2247
 
and passes the element as an argument to <var>Action</var>.
2248
 
</p>
2249
 
<p>
2250
 
<var>Action</var> is a procedural type variable that accepts a pointer as an 
2251
 
argument.
2252
 
</p>
2253
 
</descr>
2254
 
<errors>
2255
 
None.
2256
 
</errors>
2257
 
<seealso>
2258
 
<link id="TCollection.FirstThat"/>
2259
 
<link id="TCollection.LastThat"/>
2260
 
</seealso>
2261
 
<example file="objectex/ex21"/>
2262
 
</element>
2263
 
 
2264
 
 
2265
 
 
2266
 
<element name="TCollection.SetLimit">
2267
 
<short>Set maximum number of elements in the collection.</short>
2268
 
<descr>
2269
 
<p>
2270
 
<var>SetLimit</var> sets the maximum number of elements in the collection.
2271
 
<var>ALimit</var> must not be less than <var>Count</var>, and should not be larger
2272
 
than <var>MaxCollectionSize</var>
2273
 
</p>
2274
 
<p>
2275
 
For an example, see <link id="TCollection.Pack">Pack</link>.
2276
 
</p>
2277
 
</descr>
2278
 
<errors>
2279
 
None.
2280
 
</errors>
2281
 
<seealso>
2282
 
<link id="TCollection.Init"/>
2283
 
</seealso>
2284
 
</element>
2285
 
 
2286
 
 
2287
 
<element name="TCollection.Error">
2288
 
<short>Set error code.</short>
2289
 
<descr>
2290
 
<p>
2291
 
<var>Error</var> is called by the various <var>TCollection</var> methods
2292
 
in case of an error condition. The default behaviour is to make
2293
 
a call to <var>RunError</var> with an error of <var>212-Code</var>.
2294
 
</p>
2295
 
<p>
2296
 
This method can be overridden by descendent objects to implement
2297
 
a different error-handling.
2298
 
</p>
2299
 
</descr>
2300
 
<errors>
2301
 
</errors>
2302
 
<seealso>
2303
 
<link id="Abstract"/>
2304
 
</seealso>
2305
 
</element>
2306
 
 
2307
 
<element name="TCollection.AtPut">
2308
 
<short>Set collection item, overwriting an existing value.</short>
2309
 
<descr>
2310
 
<p>
2311
 
<var>AtPut</var> sets the element at position <var>Index</var> in the collection
2312
 
to <var>Item</var>. Any previous value is overwritten.
2313
 
</p>
2314
 
<p>
2315
 
For an example, see <link id="TCollection.Pack">Pack</link>.
2316
 
</p>
2317
 
</descr>
2318
 
<errors>
2319
 
If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
2320
 
with <var>CoIndexError</var>.
2321
 
</errors>
2322
 
<seealso>
2323
 
</seealso>
2324
 
</element>
2325
 
 
2326
 
 
2327
 
<element name="TCollection.AtInsert">
2328
 
<short>Insert an element at a certain position in the collection.</short>
2329
 
<descr>
2330
 
<var>AtInsert</var> inserts <var>Item</var> in the collection at position <var>Index</var>,
2331
 
shifting all elements by one position. In case the current limit is reached,
2332
 
the collection will try to expand with a call to <var>SetLimit</var>
2333
 
</descr>
2334
 
<errors>
2335
 
If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
2336
 
with <var>CoIndexError</var>. If the collection fails to expand, then
2337
 
<var>coOverFlow</var> is passd to <var>Error</var>.
2338
 
</errors>
2339
 
<seealso>
2340
 
<link id="TCollection.Insert"/>
2341
 
</seealso>
2342
 
<example file="objectex/ex34"/>
2343
 
</element>
2344
 
 
2345
 
 
2346
 
 
2347
 
<element name="TCollection.Store">
2348
 
<short>Write collection to a stream.</short>
2349
 
<descr>
2350
 
<p>
2351
 
<var>Store</var> writes the collection to the stream <var>S</var>. It does
2352
 
this by writeing the current <var>Count</var>, <var>Limit</var> and <var>Delta</var>
2353
 
to the stream, and then writing each item to the stream.
2354
 
</p>
2355
 
<p>
2356
 
The contents of the stream are then suitable for instantiating another
2357
 
collection with <link id="TCollection.Load">Load</link>.
2358
 
</p>
2359
 
<p>
2360
 
For an example, see <link id="TCollection.Load"/>.
2361
 
</p>
2362
 
</descr>
2363
 
<errors>
2364
 
Errors returned are those by <link id="TStream.Put"/>.
2365
 
</errors>
2366
 
<seealso>
2367
 
<link id="TCollection.Load"/>
2368
 
<link id="TCollection.PutItem"/>
2369
 
</seealso>
2370
 
</element>
2371
 
 
2372
 
 
2373
 
<element name="TCollection.PutItem">
2374
 
<short>Put one item on the stream</short>
2375
 
<descr>
2376
 
<var>PutItem</var> writes <var>Item</var> to stream <var>S</var>. This method is used
2377
 
internaly by the <var>TCollection</var> object, and should not be called
2378
 
directly.
2379
 
</descr>
2380
 
<errors>
2381
 
Errors are those returned by <link id="TStream.Put"/>.
2382
 
</errors>
2383
 
<seealso>
2384
 
<link id="TCollection.Store">Store</link>
2385
 
<link id="TCollection.GetItem">GetItem</link>
2386
 
</seealso>
2387
 
</element>
2388
 
 
2389
 
<element name="TSortedCollection">
2390
 
<short>Abstract sorted collection.</short>
2391
 
<descr>
2392
 
<p>
2393
 
<var>TSortedCollection</var> is an abstract class, implementing a sorted
2394
 
collection. You should never use an instance of <var>TSortedCollection</var>
2395
 
directly, instead you should declare a descendent type, and override the
2396
 
<link id="TSortedCollection.Compare">Compare</link> method.
2397
 
</p>
2398
 
<p>
2399
 
Because the collection is ordered, <var>TSortedCollection</var> overrides some
2400
 
<var>TCollection</var> methods, to provide faster routines for lookup.
2401
 
</p>
2402
 
<p>
2403
 
The <link id="TSortedCollection.Compare">Compare</link> method decides how elements
2404
 
in the collection should be ordered. Since <var>TCollection</var> has no way
2405
 
of knowing how to order pointers, you must override the compare method.
2406
 
</p>
2407
 
<p>
2408
 
Additionally, <var>TCollection</var> provides a means to filter out duplicates.
2409
 
if you set <var>Duplicates</var> to <var>False</var> (the default) then duplicates
2410
 
will not be allowed.
2411
 
</p>
2412
 
<p>
2413
 
The example below defines a descendent of <var>TSortedCollection</var> which
2414
 
is used in the examples.
2415
 
</p>
2416
 
</descr>
2417
 
<example file="objectex/mysortc"/>
2418
 
</element>
2419
 
 
2420
 
<element name="TSortedCollection.Duplicates">
2421
 
<short>If <var>True</var> duplicate strings are allowed in the collection.</short>
2422
 
</element>
2423
 
 
2424
 
<element name="TSortedCollection.Init">
2425
 
<short>Instantiates a new instance of a <var>TSortedCollection</var></short>
2426
 
<descr>
2427
 
<p>
2428
 
<var>Init</var> calls the inherited constuctor (see <link id="TCollection.Init"/>) and
2429
 
sets the <var>Duplicates</var> flag to false.
2430
 
</p>
2431
 
<p>
2432
 
You should not call this method directly, since <var>TSortedCollection</var> is a
2433
 
abstract class. Instead, the descendent classes should call it via the
2434
 
<var>inherited</var> keyword.
2435
 
</p>
2436
 
</descr>
2437
 
<errors>
2438
 
None.
2439
 
</errors>
2440
 
<seealso> 
2441
 
<link id="TSortedCollection.Load"/>
2442
 
<link id="TCollection.Done"/>
2443
 
</seealso>
2444
 
</element>
2445
 
 
2446
 
<element name="TSortedCollection.Load">
2447
 
<short>Instantiates a new instance of a <var>TSortedCollection</var> and
2448
 
loads it from stream.</short>
2449
 
<descr>
2450
 
<p>
2451
 
<var>Load</var> calls the inherited constuctor (see <link id="TCollection.Load"/>) and
2452
 
reads the <var>Duplicates</var> flag from the stream..
2453
 
</p>
2454
 
<p>
2455
 
You should not call this method directly, since <var>TSortedCollection</var> is a
2456
 
abstract class. Instead, the descendent classes should call it via the
2457
 
<var>inherited</var> keyword.
2458
 
</p>
2459
 
<p>
2460
 
For an example, see <link id="TCollection.Load"/>.
2461
 
</p>
2462
 
</descr>
2463
 
<errors>
2464
 
None.
2465
 
</errors>
2466
 
<seealso> 
2467
 
<link id="TSortedCollection.Init"/>
2468
 
<link id="TCollection.Done"/>
2469
 
</seealso>
2470
 
</element>
2471
 
 
2472
 
 
2473
 
<element name="TSortedCollection.KeyOf">
2474
 
<short>Return the key of an item</short>
2475
 
<descr>
2476
 
<p>
2477
 
<var>KeyOf</var> returns the key associated with <var>Item</var>.
2478
 
<var>TSortedCollection</var> returns the item itself as the key, descendent
2479
 
objects can override this method to calculate a (unique) key based on the
2480
 
item passed (such as hash values).
2481
 
</p>
2482
 
<p>
2483
 
<var>Keys</var> are used to sort the objects, they are used to search and sort
2484
 
the items in the collection. If descendent types override this method then
2485
 
it allows possibly for faster search/sort methods based on keys rather than
2486
 
on the objects themselves.
2487
 
</p>
2488
 
</descr>
2489
 
<errors>
2490
 
None.
2491
 
</errors>
2492
 
<seealso>
2493
 
<link id="TSortedCollection.IndexOf"/>
2494
 
<link id="TSortedCollection.Compare"/>
2495
 
</seealso>
2496
 
</element>
2497
 
 
2498
 
<element name="TSortedCollection.IndexOf">
2499
 
<short>Return index of an item in the collection.</short>
2500
 
<descr>
2501
 
<p>
2502
 
<var>IndexOf</var> returns the index of <var>Item</var> in the collection. It searches
2503
 
for the object based on it's key. If duplicates are allowed, then it returns 
2504
 
the index of last object that matches <var>Item</var>.
2505
 
</p>
2506
 
<p>
2507
 
In case <var>Item</var> is not found in the collection, -1 is returned.
2508
 
</p>
2509
 
<p>
2510
 
For an example, see <link id="TCollection.IndexOf"/>
2511
 
</p>
2512
 
</descr>
2513
 
<errors>
2514
 
None.
2515
 
</errors>
2516
 
<seealso>
2517
 
<link id="TSortedCollection.Search"/>
2518
 
<link id="TSortedCollection.Compare"/>
2519
 
</seealso>
2520
 
</element>
2521
 
 
2522
 
 
2523
 
<element name="TSortedCollection.Compare">
2524
 
<short>Compare two items in the collection.</short>
2525
 
<descr>
2526
 
<p>
2527
 
<var>Compare</var> is an abstract method that should be overridden by descendent
2528
 
objects in order to compare two items in the collection. This method is used
2529
 
in the <link id="TSortedCollection.Search">Search</link> method and in the
2530
 
<link id="TSortedCollection.Insert">Insert</link> method to determine the ordering of
2531
 
the objects.
2532
 
</p>
2533
 
<p>
2534
 
The function should compare the two keys of items and return the following
2535
 
function results:
2536
 
</p>
2537
 
<dl>
2538
 
<dt>Result &lt; 0</dt><dd>If <var>Key1</var> is logically before <var>Key2</var> (<var>Key1&lt;Key2</var>)</dd>
2539
 
<dt>Result = 0</dt><dd> If <var>Key1</var> and <var>Key2</var> are equal. (<var>Key1=Key2</var>)</dd>
2540
 
<dt>Result &gt; 0</dt><dd> If <var>Key1</var> is logically after <var>Key2</var> (<var>Key1&gt;Key2</var>)</dd>
2541
 
</dl>
2542
 
</descr>
2543
 
<errors>
2544
 
An 'abstract run-time error' will be generated if you call
2545
 
<var>TSortedCollection.Compare</var> directly.
2546
 
</errors>
2547
 
<seealso>
2548
 
<link id="TSortedCollection.IndexOf"/>
2549
 
<link id="TSortedCollection.Search"/>
2550
 
</seealso>
2551
 
<example file="objectex/mysortc"/>
2552
 
</element>
2553
 
 
2554
 
 
2555
 
<element name="TSortedCollection.Search">
2556
 
<short>Search for item with given key.</short>
2557
 
<descr>
2558
 
<p>
2559
 
<var>Search</var> looks for the item with key <var>Key</var> and returns the position
2560
 
of the item (if present) in the collection in <var>Index</var>.
2561
 
</p>
2562
 
<p>
2563
 
Instead of a linear search as <var>TCollection</var> does, <var>TSortedCollection</var>
2564
 
uses a binary search based on the keys of the objects. It uses the
2565
 
<link id="TSortedCollection.Compare">Compare</link> function to implement this
2566
 
search.
2567
 
</p>
2568
 
<p>
2569
 
If the item is found, <var>Search</var> returns <var>True</var>, otherwise <var>False</var>
2570
 
is returned.
2571
 
</p>
2572
 
</descr>
2573
 
<errors>
2574
 
None.
2575
 
</errors>
2576
 
<seealso>
2577
 
<link id="TCollection.IndexOf"/>
2578
 
</seealso>
2579
 
<example file="objectex/ex36"/>
2580
 
</element>
2581
 
 
2582
 
 
2583
 
<element name="TSortedCollection.Insert">
2584
 
<short>Insert new item in collection.</short>
2585
 
<descr>
2586
 
<p>
2587
 
<var>Insert</var> inserts an item in the collection at the correct position, such
2588
 
that the collection is ordered at all times. You should never use
2589
 
<link id="TCollection.AtInsert">Atinsert</link>, since then the collection ordering
2590
 
is not guaranteed.
2591
 
</p>
2592
 
<p>
2593
 
If <var>Item</var> is already present in the collection, and <var>Duplicates</var> is
2594
 
<var>False</var>, the item will not be inserted.
2595
 
</p>
2596
 
</descr>
2597
 
<errors>
2598
 
None.
2599
 
</errors>
2600
 
<seealso>
2601
 
<link id="TCollection.AtInsert"/>
2602
 
</seealso>
2603
 
<example file="objectex/ex35"/>
2604
 
</element>
2605
 
 
2606
 
 
2607
 
 
2608
 
<element name="TSortedCollection.Store">
2609
 
<short>Write the collection to the stream.</short>
2610
 
<descr>
2611
 
<p>
2612
 
<var>Store</var> writes the collection to the stream <var>S</var>. It does this by
2613
 
calling the inherited <link id="TCollection.Store"/>, and then writing the
2614
 
<var>Duplicates</var> flag to the stream.
2615
 
</p>
2616
 
<p>
2617
 
After a <var>Store</var>, the collection can be loaded from the stream with the
2618
 
constructor <link id="TSortedCollection.Load">Load</link>
2619
 
</p>
2620
 
<p>
2621
 
For an example, see <link id="TCollection.Load"/>.
2622
 
</p>
2623
 
</descr>
2624
 
<errors>
2625
 
Errors can be those of <link id="TStream.Put"/>.
2626
 
</errors>
2627
 
<seealso>
2628
 
<link id="TSortedCollection.Load"/>
2629
 
</seealso>
2630
 
</element>
2631
 
 
2632
 
 
2633
 
<element name="TStringCollection">
2634
 
<short>Collection of pascal strings.</short>
2635
 
<descr>
2636
 
<p>
2637
 
The <var>TStringCollection</var> object manages a sorted collection of pascal
2638
 
strings.
2639
 
To this end, it overrides the <link id="TSortedCollection.Compare">Compare</link>
2640
 
method of <var>TSortedCollection</var>, and it introduces methods to read/write
2641
 
strings from a stream.
2642
 
</p>
2643
 
</descr>
2644
 
</element>
2645
 
 
2646
 
<element name="TStringCollection.GetItem">
2647
 
<short>Get string from the stream.</short>
2648
 
<descr>
2649
 
<p>
2650
 
<var>GetItem</var> reads a string from the stream <var>S</var> and returns a pointer
2651
 
to it. It doesn't insert the string in the collection.
2652
 
</p>
2653
 
<p>
2654
 
This method is primarily introduced to be able to load and store the
2655
 
collection from and to a stream.
2656
 
</p>
2657
 
</descr>
2658
 
<errors>
2659
 
The errors returned are those of <link id="TStream.ReadStr"/>.
2660
 
</errors>
2661
 
<seealso>
2662
 
<link id="TStringCollection.PutItem"/>
2663
 
</seealso>
2664
 
</element>
2665
 
 
2666
 
<element name="TStringCollection.Compare">
2667
 
<short>Compare two strings in the collection.</short>
2668
 
<descr>
2669
 
<p>
2670
 
<var>TStringCollection</var> overrides the <var>Compare</var> function so it compares
2671
 
the two keys as if they were pointers to strings. The compare is done case
2672
 
sensitive. It returns the following results:
2673
 
</p>
2674
 
<dl>
2675
 
<dt>-1</dt><dd> if the first string is alphabetically earlier  than the second string.</dd>
2676
 
<dt>0</dt><dd> if the two strings are equal.</dd>
2677
 
<dt>1</dt><dd> if the first string is alphabetically later than the second string.</dd>
2678
 
</dl>
2679
 
</descr>
2680
 
<errors>
2681
 
None.
2682
 
</errors>
2683
 
<seealso>
2684
 
<link id="TSortedCollection.Compare"/>
2685
 
</seealso>
2686
 
<example file="objectex/ex37"/>
2687
 
</element>
2688
 
 
2689
 
 
2690
 
 
2691
 
<element name="TStringCollection.FreeItem">
2692
 
<short>Dispose a string in the collection from memory.</short>
2693
 
<descr>
2694
 
<var>TStringCollection</var> overrides <var>FreeItem</var> so that the string pointed
2695
 
to by <var>Item</var> is disposed from memory.
2696
 
</descr>
2697
 
<errors>
2698
 
None.
2699
 
</errors>
2700
 
<seealso>
2701
 
<link id="TCollection.FreeItem"/>
2702
 
</seealso>
2703
 
</element>
2704
 
 
2705
 
<element name="TStringCollection.PutItem">
2706
 
<short>Write a string to the stream.</short>
2707
 
<descr>
2708
 
<p>
2709
 
<var>PutItem</var> writes the string pointed to by <var>Item</var> to the stream
2710
 
<var>S</var>.
2711
 
</p>
2712
 
<p>
2713
 
This method is primarily used in the <var>Load</var> and <var>Store</var> methods,
2714
 
and should not be used directly.
2715
 
</p>
2716
 
</descr>
2717
 
<errors>
2718
 
Errors are those of <link id="TStream.WriteStr"/>.
2719
 
</errors>
2720
 
<seealso>
2721
 
<link id="TStringCollection.GetItem"/>
2722
 
</seealso>
2723
 
</element>
2724
 
 
2725
 
 
2726
 
<element name="TStrCollection">
2727
 
<short>Collection of null-terminated strings</short>
2728
 
<descr>
2729
 
<p>
2730
 
The <var>TStrCollection</var> object manages a sorted collection
2731
 
of null-terminated strings (pchar strings).
2732
 
To this end, it overrides the <link id="TSortedCollection.Compare">Compare</link>
2733
 
method of <var>TSortedCollection</var>, and it introduces methods to read/write
2734
 
strings from a stream.
2735
 
</p>
2736
 
</descr>
2737
 
</element>
2738
 
 
2739
 
<element name="TStrCollection.GetItem">
2740
 
<short>Read a null-terminated string from the stream.</short>
2741
 
<descr>
2742
 
<p>
2743
 
<var>GetItem</var> reads a null-terminated string from the stream <var>S</var>
2744
 
and returns a pointer  to it. It doesn't insert the string in the
2745
 
collection.
2746
 
</p>
2747
 
<p>
2748
 
This method is primarily introduced to be able to load and store the
2749
 
collection from and to a stream.
2750
 
</p>
2751
 
</descr>
2752
 
<errors>
2753
 
The errors returned are those of <link id="TStream.StrRead"/>.
2754
 
</errors>
2755
 
<seealso>
2756
 
<link id="TStrCollection.PutItem"/>
2757
 
</seealso>
2758
 
</element>
2759
 
 
2760
 
<element name="TStrCollection.Compare">
2761
 
<short>Compare two strings in the collection.</short>
2762
 
<descr>
2763
 
<p>
2764
 
<var>TStrCollection</var> overrides the <var>Compare</var> function so it compares
2765
 
the two keys as if they were pointers to strings. The compare is done case
2766
 
sensitive. It returns
2767
 
</p>
2768
 
<dl>
2769
 
<dt>-1</dt><dd> if the first string is alphabetically earlier  than the second string. </dd>
2770
 
<dt>0</dt><dd> if the two strings are equal. </dd>
2771
 
<dt>1</dt><dd> if the first string is alphabetically later than the second string.</dd>
2772
 
</dl>
2773
 
</descr>
2774
 
<errors>
2775
 
None.
2776
 
</errors>
2777
 
<seealso>
2778
 
<link id="TSortedCollection.Compare"/>
2779
 
</seealso>
2780
 
<example file="objectex/ex38"/>
2781
 
</element>
2782
 
 
2783
 
<element name="TStrCollection.FreeItem">
2784
 
<short>Free null-terminated string from the collection.</short>
2785
 
<descr>
2786
 
<var>TStrCollection</var> overrides <var>FreeItem</var> so that the string pointed
2787
 
to by <var>Item</var> is disposed from memory.
2788
 
</descr>
2789
 
<errors>
2790
 
None.
2791
 
</errors>
2792
 
<seealso>
2793
 
<link id="TCollection.FreeItem"/>
2794
 
</seealso>
2795
 
</element>
2796
 
 
2797
 
<element name="TStrCollection.PutItem">
2798
 
<short>Write a null-terminated string to the stream.</short>
2799
 
<descr>
2800
 
<p>
2801
 
<var>PutItem</var> writes the string pointed to by <var>Item</var> to the stream
2802
 
<var>S</var>.
2803
 
</p>
2804
 
<p>
2805
 
This method is primarily used in the <var>Load</var> and <var>Store</var> methods,
2806
 
and should not be used directly.
2807
 
</p>
2808
 
</descr>
2809
 
<errors>
2810
 
Errors are those of <link id="TStream.StrWrite"/>.
2811
 
</errors>
2812
 
<seealso>
2813
 
<link id="TStrCollection.GetItem"/>
2814
 
</seealso>
2815
 
</element>
2816
 
 
2817
 
<element name="TUnSortedStrCollection">
2818
 
<short>Unsorted string collection</short>
2819
 
<descr>
2820
 
<p>
2821
 
The <var>TUnSortedStrCollection</var> object manages an unsorted list of strings.
2822
 
To this end, it overrides the <link id="TStringCollection.Insert"/> method to add
2823
 
strings at the end of the collection, rather than in the alphabetically
2824
 
correct position.
2825
 
</p>
2826
 
<p>
2827
 
Take care, the <link id="TSortedCollection.Search">Search</link> and
2828
 
<link id="TCollection.IndexOf">IndexOf</link> methods will not work on an unsorted
2829
 
string collection.
2830
 
</p>
2831
 
</descr>
2832
 
</element>
2833
 
 
2834
 
<element name="TUnSortedStrCollection.Insert">
2835
 
<short>Insert a new string in the collection.</short>
2836
 
<descr>
2837
 
<var>Insert</var> inserts a string at the end of the collection, instead
2838
 
of on it's alphabetical place, resulting in an unsorted collection of
2839
 
strings.
2840
 
</descr>
2841
 
<errors>
2842
 
None.
2843
 
</errors>
2844
 
<seealso>
2845
 
<link id="TCollection.Insert"/>
2846
 
</seealso>
2847
 
<example file="objectex/ex39"/>
2848
 
</element>
2849
 
 
2850
 
 
2851
 
 
2852
 
<element name="TResourceCollection">
2853
 
<short>Collection of resource names</short>
2854
 
<descr>
2855
 
<p>
2856
 
A <var>TResourceCollection</var> manages a collection of resource names.
2857
 
It stores the position and the size of a resource, as well as the name of
2858
 
the resource. It stores these items in records that look like this:
2859
 
</p>
2860
 
<code>
2861
 
TYPE
2862
 
   TResourceItem = packed RECORD
2863
 
      Posn: LongInt;
2864
 
      Size: LongInt;
2865
 
      Key : String;
2866
 
   End;
2867
 
   PResourceItem = ^TResourceItem;
2868
 
</code>
2869
 
<p>
2870
 
It overrides some methods of <var>TStringCollection</var> in order to accomplish
2871
 
this.
2872
 
</p>
2873
 
<remark>
2874
 
Remark that the <var>TResourceCollection</var> manages the names of the
2875
 
resources and their assiciated positions and sizes, it doesn't manage
2876
 
the resources themselves.
2877
 
</remark>
2878
 
</descr>
2879
 
</element>
2880
 
 
2881
 
<element name="TResourceCollection.KeyOf">
2882
 
<short>Return the key of an item in the collection.</short>
2883
 
<descr>
2884
 
<var>KeyOf</var> returns the key of an item in the collection. For resources, the
2885
 
key is a pointer to the string with the resource name.
2886
 
</descr>
2887
 
<errors>
2888
 
None.
2889
 
</errors>
2890
 
<seealso>
2891
 
<link id="TStringCollection.Compare"/>
2892
 
</seealso>
2893
 
</element>
2894
 
 
2895
 
<element name="TResourceCollection.GetItem">
2896
 
<short>Read an item from the stream.</short>
2897
 
<descr>
2898
 
<p>
2899
 
<var>GetItem</var> reads a resource item from the stream <var>S</var>. It reads the
2900
 
position, size and name from the stream, in that order. It DOES NOT read the
2901
 
resource itself from the stream.
2902
 
</p>
2903
 
<p>
2904
 
The resulting item is not inserted in the collection. This call is manly for
2905
 
internal use by the <link id="TCollection.Load"/> method.
2906
 
</p>
2907
 
</descr>
2908
 
<errors>
2909
 
Errors returned are those by <link id="TStream.Read"/>
2910
 
</errors>
2911
 
<seealso>
2912
 
<link id="TCollection.Load"/>
2913
 
<link id="TStream.Read"/>
2914
 
</seealso>
2915
 
</element>
2916
 
 
2917
 
<element name="TResourceCollection.FreeItem">
2918
 
<short>Release memory occupied by item.</short>
2919
 
<descr>
2920
 
<p>
2921
 
<var>FreeItem</var> releases the memory occupied by <var>Item</var>. It de-allocates
2922
 
the name, and then the resourceitem record.
2923
 
</p>
2924
 
<p>
2925
 
It does NOT remove the item from the collection.
2926
 
</p>
2927
 
</descr>
2928
 
<errors>
2929
 
None.
2930
 
</errors>
2931
 
<seealso>
2932
 
<link id="TCollection.FreeItem"/>
2933
 
</seealso>
2934
 
</element>
2935
 
 
2936
 
<element name="TResourceCollection.PutItem">
2937
 
<short>Write an item to the stream.</short>
2938
 
<descr>
2939
 
<p>
2940
 
<var>PutItem</var> writes <var>Item</var> to the stream <var>S</var>. It does this by
2941
 
writing the position and size and name of the resource item to the stream.
2942
 
</p>
2943
 
<p>
2944
 
This method is used primarily by the <link id="TCollection.Store">Store</link>
2945
 
method.
2946
 
</p>
2947
 
</descr>
2948
 
<errors>
2949
 
Errors returned are those by <link id="TStream.Write"/>.
2950
 
</errors>
2951
 
<seealso>
2952
 
<link id="TCollection.Store"/>
2953
 
</seealso>
2954
 
</element>
2955
 
 
2956
 
 
2957
 
<element name="TResourceFile">
2958
 
<short>Resource file</short>
2959
 
<descr>
2960
 
<link id="TResourceFile"/> represents the resources in a binary file image.
2961
 
</descr>
2962
 
</element>
2963
 
 
2964
 
<element name="TResourceFile.Stream">
2965
 
<short>Actual file stream</short>
2966
 
<descr>
2967
 
contains the (file) stream that has the executable image and
2968
 
the resources. It can be initialized by the <link id="TResourceFile.Init">Init</link>
2969
 
constructor call.
2970
 
</descr>
2971
 
</element>
2972
 
 
2973
 
<element name="TResourceFile.Modified">
2974
 
<short>Have resources changed ?</short>
2975
 
<descr>
2976
 
<var>Modified</var> is set to <var>True</var> if one of the resources has been changed.
2977
 
It is set by the <link id="TResourceFile.Init">SwitchTo</link>,
2978
 
<link id="TResourceFile.Delete">Delete</link> and <link id="TResourceFile.Put">Put</link>
2979
 
methods. Calling <link id="TResourceFile.Flush">Flush</link> will clear the
2980
 
<var>Modified</var> flag.
2981
 
</descr>
2982
 
</element>
2983
 
 
2984
 
<element name="TResourceFile.Init">
2985
 
<short>Instantiate a new instance.</short>
2986
 
<descr>
2987
 
<p>
2988
 
<var>Init</var> instantiates a new instance of a <var>TResourceFile</var> object.
2989
 
If <var>AStream</var> is not nil then it is considered as a stream describing an
2990
 
executable image on disk.
2991
 
</p>
2992
 
<p>
2993
 
<var>Init</var> will try to position the stream on the start of the resources section,
2994
 
and read all resources from the stream.
2995
 
</p>
2996
 
</descr>
2997
 
<errors>
2998
 
None.
2999
 
</errors>
3000
 
<seealso>
3001
 
<link id="TResourceFile.Done"/>
3002
 
</seealso>
3003
 
</element>
3004
 
 
3005
 
<element name="TResourceFile.Done">
3006
 
<short>Destroy the instance and remove it from memory.</short>
3007
 
<descr>
3008
 
<var>Done</var> cleans up the instance of the <var>TResourceFile</var> Object.
3009
 
If <var>Stream</var> was specified at initialization, then <var>Stream</var> is
3010
 
disposed of too.
3011
 
</descr>
3012
 
<errors>
3013
 
None.
3014
 
</errors>
3015
 
<seealso>
3016
 
<link id="TResourceFile.Init"/>
3017
 
</seealso>
3018
 
</element>
3019
 
 
3020
 
<element name="TResourceFile.Count">
3021
 
<short>Number of resources in the file</short>
3022
 
<descr>
3023
 
<var>Count</var> returns the number of resources. If no resources were
3024
 
read, zero is returned.
3025
 
</descr>
3026
 
<errors>
3027
 
None.
3028
 
</errors>
3029
 
<seealso>
3030
 
<link id="TResourceFile.Init"/>
3031
 
</seealso>
3032
 
</element>
3033
 
 
3034
 
<element name="TResourceFile.KeyAt">
3035
 
<short>Return the key of the item at a certain position.</short>
3036
 
<descr>
3037
 
<var>KeyAt</var> returns the key (the name) of the <var>I</var>-th resource.
3038
 
</descr>
3039
 
<errors>
3040
 
In case <var>I</var> is invalid, <var>TCollection.Error</var> will be executed.
3041
 
</errors>
3042
 
<seealso>
3043
 
<link id="TResourceFile.Get"/>
3044
 
</seealso>
3045
 
</element>
3046
 
 
3047
 
<element name="TResourceFile.Get">
3048
 
<short>Return a resource by key name.</short>
3049
 
<descr>
3050
 
<var>Get</var> returns a pointer to a instance of a resource identified by
3051
 
<var>Key</var>. If <var>Key</var> cannot be found in the list of resources, then
3052
 
<var>Nil</var> is returned.
3053
 
</descr>
3054
 
<errors>
3055
 
Errors returned may be those by <var>TStream.Get</var>
3056
 
</errors>
3057
 
<seealso>
3058
 
</seealso>
3059
 
</element>
3060
 
 
3061
 
<element name="TResourceFile.SwitchTo">
3062
 
<short>Write resources to a new stream.</short>
3063
 
<descr>
3064
 
<p>
3065
 
<var>SwitchTo</var> switches to a new stream to hold the resources in.
3066
 
<var>AStream</var> will be the new stream after the call to <var>SwitchTo</var>.
3067
 
</p>
3068
 
<p>
3069
 
If <var>Pack</var> is true, then all the known resources will be copied from
3070
 
the current stream to the new stream (<var>AStream</var>). If <var>Pack</var> is
3071
 
<var>False</var>, then only the current resource is copied.
3072
 
</p>
3073
 
<p>
3074
 
The return value is the value of the original stream: <var>Stream</var>.
3075
 
</p>
3076
 
<p>
3077
 
The <var>Modified</var> flag is set as a consequence of this call.
3078
 
</p>
3079
 
</descr>
3080
 
<errors>
3081
 
Errors returned can be those of <link id="TStream.Read"/> and
3082
 
<link id="TStream.Write"/>.
3083
 
</errors>
3084
 
<seealso>
3085
 
<link id="TResourceFile.Flush"/>
3086
 
</seealso>
3087
 
</element>
3088
 
 
3089
 
<element name="TResourceFile.Flush">
3090
 
<short>Writes the resources to the stream.</short>
3091
 
<descr>
3092
 
If the <var>Modified</var> flag is set to <var>True</var>, then <var>Flush</var>
3093
 
writes the resources to the stream <var>Stream</var>. It sets the <var>Modified</var>
3094
 
flag to true after that.
3095
 
</descr>
3096
 
<errors>
3097
 
Errors can be those by <link id="TStream.Seek"/> and <link id="TStream.Write"/>.
3098
 
</errors>
3099
 
<seealso>
3100
 
<link id="TResourceFile.SwitchTo"/>
3101
 
</seealso>
3102
 
</element>
3103
 
 
3104
 
<element name="TResourceFile.Delete">
3105
 
<short>Delete a resource from the file</short>
3106
 
<descr>
3107
 
<var>Delete</var> deletes the resource identified by <var>Key</var> from the
3108
 
collection. It sets the <var>Modified</var> flag to true.
3109
 
</descr>
3110
 
<errors>
3111
 
None.
3112
 
</errors>
3113
 
<seealso>
3114
 
<link id="TResourceFile.Flush"/>
3115
 
</seealso>
3116
 
</element>
3117
 
 
3118
 
<element name="TResourceFile.Put">
3119
 
<short>Set a resource by key name.</short>
3120
 
<descr>
3121
 
<var>Put</var> sets the resource identified by <var>Key</var> to <var>Item</var>.
3122
 
If no such resource exists, a new one is created. The item is written
3123
 
to the stream.
3124
 
</descr>
3125
 
<errors>
3126
 
Errors returned may be those by <link id="TStream.Put"/> and <var>TStream.Seek</var>
3127
 
</errors>
3128
 
<seealso>
3129
 
<link id="TResourceFile.Get">Get</link>
3130
 
</seealso>
3131
 
</element>
3132
 
 
3133
 
<element name="TStringList">
3134
 
<short>Collection of strings</short>
3135
 
<descr>
3136
 
<p>
3137
 
A <var>TStringList</var> object can be used to read a collection of strings
3138
 
stored in a stream. If you register this object with the <link id="RegisterType"/>
3139
 
function, you cannot register the <var>TStrListMaker</var> object.
3140
 
</p>
3141
 
</descr>
3142
 
</element>
3143
 
 
3144
 
<element name="TStringList.Load">
3145
 
<short>Load stringlist from stream.</short>
3146
 
<descr>
3147
 
The <var>Load</var> constructor reads the <var>TStringList</var> object from the
3148
 
stream <var>S</var>. It also reads the descriptions of the strings from the
3149
 
stream. The string descriptions are stored as an array of
3150
 
<var>TstrIndexrec</var> records, where each record describes a string on the
3151
 
stream. These records are kept in memory.
3152
 
</descr>
3153
 
<errors>
3154
 
If an error occurs, a stream error is triggered.
3155
 
</errors>
3156
 
<seealso>
3157
 
<link id="TStringList.Done"/>
3158
 
</seealso>
3159
 
</element>
3160
 
 
3161
 
<element name="TStringList.Done">
3162
 
<short>Clean up the instance</short>
3163
 
<descr>
3164
 
The <var>Done</var> destructor frees the memory occupied by the string
3165
 
descriptions, and destroys the object.
3166
 
</descr>
3167
 
<errors>
3168
 
None.
3169
 
</errors>
3170
 
<seealso>
3171
 
<link id="TStringList.Load">Load</link>
3172
 
<link id="TObject.Done"/>
3173
 
</seealso>
3174
 
</element>
3175
 
 
3176
 
<element name="TStringList.Get">
3177
 
<short>Return a string by key name</short>
3178
 
<descr>
3179
 
<var>Get</var> reads the string with key <var>Key</var> from the list of strings on the
3180
 
stream, and returns this string. If there is no string with such a key, an
3181
 
empty string is returned.
3182
 
</descr>
3183
 
<errors>
3184
 
If no string with key <var>Key</var> is found, an empty string is returned.
3185
 
A stream error may result if the stream doesn't contain the needed strings.
3186
 
</errors>
3187
 
<seealso>
3188
 
<link id="TStrListMaker.Put"/>
3189
 
</seealso>
3190
 
</element>
3191
 
 
3192
 
<element name="TStrListMaker">
3193
 
<short>Generate a stream with strings, readable by <link id="TStringList"/></short>
3194
 
<descr>
3195
 
<p>
3196
 
The <var>TStrListMaker</var> object can be used to generate a stream with
3197
 
strings, which can be read with the <var>TStringList</var> object.
3198
 
If you register this object with the <link id="RegisterType"/>
3199
 
function, you cannot register the <var>TStringList</var> object.
3200
 
</p>
3201
 
</descr>
3202
 
</element>
3203
 
 
3204
 
<element name="TStrListMaker.Init">
3205
 
<short>Instantiate a new instance of <var>TStrListMaker</var></short>
3206
 
<descr>
3207
 
<p>
3208
 
The <var>Init</var> constructor creates a new instance of the <var>TstrListMaker</var>
3209
 
object. It allocates <var>AStrSize</var> bytes on the heap to hold all the
3210
 
strings you wish to store. It also allocates enough room for
3211
 
<var>AIndexSize</var> key description entries (of the type <var>TStrIndexrec</var>).
3212
 
</p>
3213
 
<p>
3214
 
<var>AStrSize</var> must be large enough to contain all the strings you wish to
3215
 
store. If not enough memory is allocated, other memory will be overwritten.
3216
 
The same is true for <var>AIndexSize</var> : maximally <var>AIndexSize</var> strings
3217
 
can be written to the stream.
3218
 
</p>
3219
 
</descr>
3220
 
<errors>
3221
 
None.
3222
 
</errors>
3223
 
<seealso>
3224
 
<link id="TObject.Init"/>
3225
 
<link id="TStrListMaker.Done"/>
3226
 
</seealso>
3227
 
</element>
3228
 
 
3229
 
<element name="TStrListMaker.Done">
3230
 
<short>Clean up the instance and free all related memory.</short>
3231
 
<descr>
3232
 
The <var>Done</var> destructor de-allocates the memory for the index description
3233
 
records and the string data, and then destroys the object.
3234
 
</descr>
3235
 
<errors>
3236
 
None.
3237
 
</errors>
3238
 
<seealso>
3239
 
<link id="TObject.Done"/>
3240
 
<link id="TStrListMaker.Init"/>
3241
 
</seealso>
3242
 
</element>
3243
 
 
3244
 
<element name="TStrListMaker.Put">
3245
 
<short>Add a new string to the list with associated key.</short>
3246
 
<descr>
3247
 
<var>Put</var> adds they string <var>S</var> with key <var>Key</var> to the collection of
3248
 
strings. This action doesn't write the string to a stream. To write the
3249
 
strings to the stream, see the <link id="TStrListMaker.Store">Store</link> method.
3250
 
</descr>
3251
 
<errors>
3252
 
None.
3253
 
</errors>
3254
 
<seealso>
3255
 
<link id="TStrListMaker.Store"/>
3256
 
</seealso>
3257
 
</element>
3258
 
 
3259
 
<element name="TStrListMaker.Store">
3260
 
<short>Write the strings to the stream.</short>
3261
 
<descr>
3262
 
<var>Store</var> writes the collection of strings to the stream <var>S</var>.
3263
 
The collection can then be read with the <var>TStringList</var> object.
3264
 
</descr>
3265
 
<errors>
3266
 
A stream error may occur when writing the strings to the stream.
3267
 
</errors>
3268
 
<seealso>
3269
 
<link id="TStringList.Load"/>
3270
 
<link id="TStrListMaker.Put"/>
3271
 
</seealso>
3272
 
</element>
3273
 
 
3274
 
<element name="InvalidHandle">
3275
 
<short>Value for invalid handle. Initial value for file stream handles or when the stream is closed.</short>
3276
 
</element>
3277
 
 
3278
 
<!-- function Visibility: default -->
3279
 
<element name="CallVoidConstructor">
3280
 
<short>Call a constructor with no arguments</short>
3281
 
<descr>
3282
 
<p>
3283
 
<var>CallVoidConstructor</var> calls the constructor of an object. 
3284
 
<var>Ctor</var> is the address of the constructor, <var>Obj</var> is a
3285
 
pointer to the instance. If it is <var>Nil</var>, then a new instance is
3286
 
allocated. <var>VMT</var> is a pointer to the object's VMT. The return value
3287
 
is a pointer to the instance.
3288
 
</p>
3289
 
<p>
3290
 
Note that this can only be used on  constructors that require no arguments.
3291
 
</p>
3292
 
</descr>
3293
 
<errors>
3294
 
If the constructor expects arguments, the stack may be corrupted.
3295
 
</errors>
3296
 
<seealso>
3297
 
<link id="CallPointerConstructor"/>
3298
 
<link id="CallPointerMethod"/>
3299
 
<link id="CallVoidLocal"/>
3300
 
<link id="CallPointerLocal"/>
3301
 
<link id="CallVoidMethodLocal"/>
3302
 
<link id="CallPointerMethodLocal"/>
3303
 
</seealso>
3304
 
</element>
3305
 
 
3306
 
<!-- function Visibility: default -->
3307
 
<element name="CallPointerConstructor">
3308
 
<short>Call a constructor with a pointer argument.</short>
3309
 
<descr>
3310
 
<p>
3311
 
<var>CallVoidConstructor</var> calls the constructor of an object.
3312
 
<var>Ctor</var> is the address of the constructor, <var>Obj</var> is a
3313
 
pointer to the instance. If it is <var>Nil</var>, then a new instance is
3314
 
allocated. <var>VMT</var> is a pointer to the object's VMT.
3315
 
<var>Param1</var> is passed to the constructor. The return value
3316
 
is a pointer to the instance.
3317
 
</p>
3318
 
<p>
3319
 
Note that this can only be used on  constructors that require a pointer as
3320
 
the sole argument. It can also be used to call a constructor with a single
3321
 
argument by reference.
3322
 
</p>
3323
 
</descr>
3324
 
<errors>
3325
 
If the constructor expects other arguments than a pointer, the stack may be corrupted.
3326
 
</errors>
3327
 
<seealso>
3328
 
<link id="CallVoidConstructor"/>
3329
 
<link id="CallPointerMethod"/>
3330
 
<link id="CallVoidLocal"/>
3331
 
<link id="CallPointerLocal"/>
3332
 
<link id="CallVoidMethodLocal"/>
3333
 
<link id="CallPointerMethodLocal"/>
3334
 
</seealso>
3335
 
</element>
3336
 
 
3337
 
<!-- function Visibility: default -->
3338
 
<element name="CallVoidMethod">
3339
 
<short>Call an object method</short>
3340
 
<descr>
3341
 
<var>CallVoidMethod</var> calls the method with address <var>Method</var>
3342
 
for instance <var>Obj</var>. It returns a pointer to the instance.
3343
 
</descr>
3344
 
<errors>
3345
 
If the method expects parameters, the stack may become corrupted.
3346
 
</errors>
3347
 
<seealso>
3348
 
<link id="CallPointerMethod"/>
3349
 
<link id="CallVoidLocal"/>
3350
 
<link id="CallPointerLocal"/>
3351
 
<link id="CallVoidMethodLocal"/>
3352
 
<link id="CallPointerMethodLocal"/>
3353
 
<link id="CallVoidConstructor"/>
3354
 
<link id="CallPointerConstructor"/>
3355
 
</seealso>
3356
 
</element>
3357
 
 
3358
 
<!-- function Visibility: default -->
3359
 
<element name="CallPointerMethod">
3360
 
<short>Call a method with a single pointer argument</short>
3361
 
<descr>
3362
 
<var>CallPointerMethod</var> calls the method with address <var>Method</var>
3363
 
for instance <var>Obj</var>. It passes <var>Param1</var> to the method as
3364
 
the single argument. It returns a pointer to the instance.
3365
 
</descr>
3366
 
<errors>
3367
 
If the method expects other parameters than a single pointer, the stack may become corrupted.
3368
 
</errors>
3369
 
<seealso>
3370
 
<link id="CallVoidMethod"/>
3371
 
<link id="CallVoidLocal"/>
3372
 
<link id="CallPointerLocal"/>
3373
 
<link id="CallVoidMethodLocal"/>
3374
 
<link id="CallPointerMethodLocal"/>
3375
 
<link id="CallVoidConstructor"/>
3376
 
<link id="CallPointerConstructor"/>
3377
 
</seealso>
3378
 
</element>
3379
 
 
3380
 
<!-- function Visibility: default -->
3381
 
<element name="CallVoidLocal">
3382
 
<short>Call a local nested procedure.</short>
3383
 
<descr>
3384
 
<var>CallVoidLocal</var> calls the local procedure with address
3385
 
<var>Func</var>, where <var>Frame</var> is the frame of the wrapping
3386
 
function.
3387
 
</descr>
3388
 
<errors>
3389
 
If the local function expects parameters, the stack may become corrupted.
3390
 
</errors>
3391
 
<seealso>
3392
 
<link id="CallPointerMethod"/>
3393
 
<link id="CallVoidMethod"/>
3394
 
<link id="CallPointerLocal"/>
3395
 
<link id="CallVoidMethodLocal"/>
3396
 
<link id="CallPointerMethodLocal"/>
3397
 
<link id="CallVoidConstructor"/>
3398
 
<link id="CallPointerConstructor"/>
3399
 
</seealso>
3400
 
</element>
3401
 
 
3402
 
<!-- function Visibility: default -->
3403
 
<element name="CallPointerLocal">
3404
 
<short>Call a local nested function with a pointer argument</short>
3405
 
<descr>
3406
 
<var>CallPointerLocal</var> calls the local procedure with address
3407
 
<var>Func</var>, where <var>Frame</var> is the frame of the wrapping
3408
 
function. It passes <var>Param1</var> to the local function.
3409
 
</descr>
3410
 
<errors>
3411
 
If the local function expects other parameters than a pointer, the stack may become corrupted.
3412
 
</errors>
3413
 
<seealso>
3414
 
<link id="CallPointerMethod"/>
3415
 
<link id="CallVoidMethod"/>
3416
 
<link id="CallVoidLocal"/>
3417
 
<link id="CallVoidMethodLocal"/>
3418
 
<link id="CallPointerMethodLocal"/>
3419
 
<link id="CallVoidConstructor"/>
3420
 
<link id="CallPointerConstructor"/>
3421
 
</seealso>
3422
 
</element>
3423
 
 
3424
 
<!-- function Visibility: default -->
3425
 
<element name="CallVoidMethodLocal">
3426
 
<short>Call a local procedure of a method</short>
3427
 
<descr>
3428
 
<var>CallVoidMethodLocal</var> calls the local procedure with address
3429
 
<var>Func</var>, where <var>Frame</var> is the frame of the wrapping
3430
 
method.
3431
 
</descr>
3432
 
<errors>
3433
 
If the local function expects parameters, the stack may become corrupted.
3434
 
</errors>
3435
 
<seealso>
3436
 
<link id="CallPointerMethod"/>
3437
 
<link id="CallVoidMethod"/>
3438
 
<link id="CallPointerLocal"/>
3439
 
<link id="CallVoidLocal"/>
3440
 
<link id="CallPointerMethodLocal"/>
3441
 
<link id="CallVoidConstructor"/>
3442
 
<link id="CallPointerConstructor"/>
3443
 
</seealso>
3444
 
</element>
3445
 
 
3446
 
<!-- function Visibility: default -->
3447
 
<element name="CallPointerMethodLocal">
3448
 
<short>Call a local procedure of a method with a pointer argument</short>
3449
 
<descr>
3450
 
<var>CallPointerMethodLocal</var> calls the local procedure with address
3451
 
<var>Func</var>, where <var>Frame</var> is the frame of the wrapping
3452
 
method. It passes <var>Param1</var> to the local function.
3453
 
</descr>
3454
 
<errors>
3455
 
If the local function expects other parameters than a pointer, the stack may become corrupted.
3456
 
</errors>
3457
 
<seealso>
3458
 
<link id="CallPointerMethod"/>
3459
 
<link id="CallVoidMethod"/>
3460
 
<link id="CallPointerLocal"/>
3461
 
<link id="CallVoidLocal"/>
3462
 
<link id="CallVoidMethodLocal"/>
3463
 
<link id="CallVoidConstructor"/>
3464
 
<link id="CallPointerConstructor"/>
3465
 
</seealso>
3466
 
</element>
3467
 
 
3468
 
<!-- constant Visibility: default -->
3469
 
<element name="DefaultTPCompatible">
3470
 
<short>Default value for <link id="#rtl.objects.tstream.tpcompatible">tstream.tpcompatible</link></short>
3471
 
<descr>
3472
 
<var>DefaultTPCompatible</var> is used to initialize <link
3473
 
id="tstream.tpcompatible">tstream.tpcompatible</link>.
3474
 
</descr>
3475
 
</element>
3476
 
 
3477
 
</module>
3478
 
</package>
3479
 
</fpdoc-descriptions>
 
 
b'\\ No newline at end of file'