1
<?xml version="1.0" encoding="ISO-8859-1"?>
6
====================================================================
8
====================================================================
11
<module name="IniFiles">
12
<short>Ini files support</short>
14
<file>IniFiles</file> provides support for handling <file>.ini</file> files.
15
It contains an implementation completely independent of the Windows API for
16
handling such files. The basic (abstract) functionality is defined in
17
<link id="TCustomInifile"/> and is implemented in <link id="TIniFile"/> and
18
<link id="TMemIniFile"/>. The API presented by these components is Delphi
22
<!-- unresolved type reference Visibility: default -->
23
<element name="classes">
24
<short>Stream and stringlist support</short>
27
<!-- unresolved type reference Visibility: default -->
28
<element name="sysutils">
29
<short>Exception and formatting routines</short>
33
********************************************************************
34
#fcl.IniFiles.TIniFileKey
35
********************************************************************
38
<!-- object Visibility: default -->
39
<element name="TIniFileKey">
40
<short>Object representing a key=value pair in the ini file.</short>
42
<var>TIniFileKey</var> is used to keep the key/value pairs in the ini file
43
in memory. It is an internal structure, used internally by the <link
44
id="TIniFile"/> class.
51
<!-- constructor Visibility: public -->
52
<element name="TIniFileKey.Create">
53
<short>Create a new instance of <var>TIniFileKey</var></short>
55
<var>Create</var> instantiates a new instance of <var>TIniFileKey</var> on
56
the heap. It fills <link id="TIniFileKey.Ident">Ident</link> with
57
<var>AIdent</var> and <link id="TIniFileKey.Value">Value</link> with
61
<link id="TIniFileKey.Ident">Ident</link>
62
<link id="TIniFileKey.Value">Value</link>
66
<!-- argument Visibility: default -->
67
<element name="TIniFileKey.Create.AIdent">
68
<short>Key name</short>
71
<!-- argument Visibility: default -->
72
<element name="TIniFileKey.Create.AValue">
73
<short>Key value</short>
76
<!-- property Visibility: public -->
77
<element name="TIniFileKey.Ident">
78
<short>Key name</short>
80
<var>Ident</var> is the key value part of the key/value pair.
83
<link id="TIniFileKey.Value">Value</link>
87
<!-- property Visibility: public -->
88
<element name="TIniFileKey.Value">
89
<short>Key value</short>
91
<var>Value</var> is the value part of the key/value pair.
94
<link id="TIniFileKey.Ident">Ident</link>
99
********************************************************************
100
#fcl.IniFiles.TIniFileKeyList
101
********************************************************************
104
<!-- object Visibility: default -->
105
<element name="TIniFileKeyList">
106
<short>Key list object</short>
108
<var>TIniFileKeyList</var> maintains a list of <link id="TIniFileKey"/>
109
instances on behalf of the <link id="TIniFileSection"/> class. It stores
110
they keys of one section of the .ini files.
113
<link id="TIniFileKey"/>
114
<link id="TIniFileSection"/>
118
<!-- destructor Visibility: public -->
119
<element name="TIniFileKeyList.Destroy">
120
<short>Free the instance</short>
122
<var>Destroy</var> clears up the list using <link
123
id="TIniFileKeyList.Clear">Clear</link> and then calls the inherited destroy.
126
<link id="TIniFileKeyList.Clear">Clear</link>
130
<!-- procedure Visibility: public -->
131
<element name="TIniFileKeyList.Clear">
132
<short>Clear the list</short>
134
<var>Clear</var> removes all <link id="TIniFileKey"/> instances from the
135
list, and frees the instances.
138
<link id="TIniFileKey"/>
142
<!-- property Visibility: public -->
143
<element name="TIniFileKeyList.Items">
144
<short>Indexed access to <var>TIniFileKey</var> items in the list</short>
146
<var>Items</var> provides indexed access to the <link id="TIniFileKey"/>
147
items in the list. The index is zero-based and runs from 0 to
151
<link id="TIniFileKey"/>
155
<!-- argument Visibility: default -->
156
<element name="TIniFileKeyList.Items.Index">
157
<short>Index of item to retrieve.</short>
161
********************************************************************
162
#fcl.IniFiles.TIniFileSection
163
********************************************************************
166
<!-- object Visibility: default -->
167
<element name="TIniFileSection">
168
<short>Ini file section object</short>
170
<var>TIniFileSection</var> is a class which represents a section in the
171
<file>.ini</file>, and is used internally by the <link id="TIniFile"/>
172
class (one instance of <var>TIniFileSection</var> is created for each
173
section in the file by the <link id="TIniFileSectionList"/> list).
174
The name of the section is stored in the <link id="TIniFileSection.Name">Name</link> property, and the key/value pairs in
175
this section are available in the <link
176
id="TIniFileSection.KeyList">KeyList</link> property.
179
<link id="TIniFileKeyList"/>
180
<link id="TIniFile"/>
181
<link id="TIniFileSectionList"/>
185
<!-- constructor Visibility: public -->
186
<element name="TIniFileSection.Create">
187
<short>Create a new section object</short>
189
<var>Create</var> instantiates a new <var>TIniFileSection</var> class, and
190
sets the name to <var>AName</var>. It allocates a <link
191
id="TIniFileKeyList"/> instance to keep all the key/value pairs for this
195
<link id="TIniFileKeyList"/>
199
<!-- argument Visibility: default -->
200
<element name="TIniFileSection.Create.AName">
201
<short>Name for the section</short>
204
<!-- destructor Visibility: public -->
205
<element name="TIniFileSection.Destroy">
206
<short>Free the section object from memory</short>
208
<var>Destroy</var> cleans up the key list, and then calls the inherited
209
<var>Destroy</var>, removing the <var>TIniFileSection</var> instance
213
<link id="TIniFileSection.Create">Create</link>
214
<link id="TIniFileKeyList"/>
218
<!-- property Visibility: public -->
219
<element name="TIniFileSection.Name">
220
<short>Name of the section</short>
222
<var>Name</var> is the name of the section in the file.
225
<link id="TIniFileSection.KeyList"/>
229
<!-- property Visibility: public -->
230
<element name="TIniFileSection.KeyList">
231
<short>List of key/value pairs in this section</short>
233
<var>KeyList</var> is the <link id="TIniFileKeyList"/> instance that is used
234
by the <var>TIniFileSection</var> to keep the key/value pairs of the
238
<link id="TIniFileSection.Name"/>
239
<link id="TIniFileKeyList"/>
243
<element name="TIniFileSection.Empty">
244
<short>Is the section empty</short>
246
<var>Empty</var> returns <var>True</var> if the section contains no key
247
values (even if they are empty). It may contain comments.
251
********************************************************************
252
#fcl.IniFiles.TIniFileSectionList
253
********************************************************************
256
<!-- object Visibility: default -->
257
<element name="TIniFileSectionList">
258
<short>Section objects list</short>
260
<var>TIniFileSectionList</var> maintains a list of <link
261
id="TIniFileSection"/> instances, one for each section in an .ini file.
262
<var>TIniFileSectionList</var> is used internally by the <link
263
id="TIniFile"/> class to represent the sections in the file.
266
<link id="TIniFileSection"/>
267
<link id="TIniFile"/>
271
<!-- destructor Visibility: public -->
272
<element name="TIniFileSectionList.Destroy">
273
<short>Free the object from memory</short>
275
<var>Destroy</var> calls <link id="TIniFileSectionList.Clear">Clear</link>
276
to clear the section list and the calls the inherited <var>Destroy</var>
279
<link id="TIniFileSectionList.Clear">Clear</link>
283
<!-- procedure Visibility: public -->
284
<element name="TIniFileSectionList.Clear">
285
<short>Clear the list</short>
287
<var>Clear</var> removes all <link id="TIniFileSection"/> items from the
288
list, and frees the items it removes from the list.
291
<link id="TIniFileSection"/>
292
<link id="TIniFileSectionList.Items"/>
296
<!-- property Visibility: public -->
297
<element name="TIniFileSectionList.Items">
298
<short>Indexed access to all the section objects in the list</short>
300
<var>Items</var> provides indexed access to all the section objects in the
301
list. <var>Index</var> should run from 0 to <var>Count-1</var>.
304
<link id="TIniFileSection"/>
305
<link id="TIniFileSectionList.Clear"/>
309
<!-- argument Visibility: default -->
310
<element name="TIniFileSectionList.Items.Index">
311
<short>Index of section object to retrieve</short>
315
********************************************************************
316
#fcl.IniFiles.TCustomIniFile
317
********************************************************************
320
<!-- object Visibility: default -->
321
<element name="TCustomIniFile">
322
<short>Abstract ini file object</short>
325
<var>TCustomIniFile</var> implements all calls for manipulating a
326
<file>.ini</file>. It does not implement any of this behaviour, the
327
behaviour must be implemented in a descendent class like <link
328
id="TIniFile"/> or <link id="TMemIniFile"/>.
331
Since <var>TCustomIniFile</var> is an abstract class, it should never
332
be created directly. Instead, one of the <var>TIniFile</var> or
333
<var>TMemIniFile</var> classes should be created.
337
<link id="TIniFile"/>
338
<link id="TMemIniFile"/>
342
<!-- constructor Visibility: public -->
343
<element name="TCustomIniFile.Create">
344
<short>Instantiate a new instance of <var>TCustomIniFile</var>.</short>
347
<var>Create</var> creates a new instance of <var>TCustomIniFile</var> and
348
loads it with the data from <var>AFileName</var>, if this file exists.
349
If the <var>AEscapeLineFeeds</var> parameter is <var>True</var>, then lines
350
which have their end-of-line markers escaped with a backslash, will be
351
concatenated. This means that the following 2 lines
354
Description=This is a \
355
line with a long text
361
Description=This is a line with a long text
364
By default, not escaping of linefeeds is performed (for Delphi
369
If the file cannot be read, an exception may be raised.
372
<link id="TCustomIniFile.Destroy">Destroy</link>
376
<!-- argument Visibility: default -->
377
<element name="TCustomIniFile.Create.AFileName">
378
<short>Filename to read</short>
381
<!-- argument Visibility: default -->
382
<element name="TCustomIniFile.Create.AEscapeLineFeeds">
383
<short>Should escaping of linefeeds be enabled ?</short>
386
<!-- destructor Visibility: public -->
387
<element name="TCustomIniFile.Destroy">
388
<short>Remove the <var>TCustomIniFile</var> instance from memory</short>
390
<var>Destroy</var> cleans up all internal structures and then calls the
391
inherited <var>Destroy</var>.
394
<link id="TCustomIniFile"/>
398
<!-- function Visibility: public -->
399
<element name="TCustomIniFile.SectionExists">
400
<short>Check if a section exists.</short>
402
<var>SectionExists</var> returns <var>True</var> if a section with name
403
<var>Section</var> exists, and contains keys. (comments are not considered
407
<link id="TCustomIniFile.ValueExists"/>
411
<!-- function result Visibility: default -->
412
<element name="TCustomIniFile.SectionExists.Result">
413
<short><var>True</var> if a section named <var>Section</var> exists and is
417
<!-- argument Visibility: default -->
418
<element name="TCustomIniFile.SectionExists.Section">
419
<short>Name of the section</short>
422
<!-- function Visibility: public -->
423
<element name="TCustomIniFile.ReadString">
424
<short>Read a string valued key</short>
426
<var>ReadString</var> reads the key <var>Ident</var> in section <var>Section</var>,
427
and returns the value as a string. If the specified key or section do not exist,
428
then the value in <var>Default</var> is returned. Note that if the key
429
exists, but is empty, an empty string will be returned.
432
<link id="TCustomIniFile.WriteString">WriteString</link>
433
<link id="TCustomIniFile.ReadInteger">ReadInteger</link>
434
<link id="TCustomIniFile.ReadBool">ReadBool</link>
435
<link id="TCustomIniFile.ReadDate">ReadDate</link>
436
<link id="TCustomIniFile.ReadDateTime">ReadDateTime</link>
437
<link id="TCustomIniFile.ReadTime">ReadTime</link>
438
<link id="TCustomIniFile.ReadFloat">ReadFloat</link>
439
<link id="TCustomIniFile.ReadBinaryStream">ReadBinaryStream</link>
443
<!-- function result Visibility: default -->
444
<element name="TCustomIniFile.ReadString.Result">
445
<short>Value of <var>Ident</var> as a string.</short>
448
<!-- argument Visibility: default -->
449
<element name="TCustomIniFile.ReadString.Section">
450
<short>Section to read <var>Ident</var> from</short>
453
<!-- argument Visibility: default -->
454
<element name="TCustomIniFile.ReadString.Ident">
455
<short>Name of key to retrieve value from</short>
458
<!-- argument Visibility: default -->
459
<element name="TCustomIniFile.ReadString.Default">
460
<short>Default value to return when the key <var>Ident</var> does not exist.</short>
463
<!-- procedure Visibility: public -->
464
<element name="TCustomIniFile.WriteString">
465
<short>Write a string value</short>
467
<var>WriteString</var> writes the string <var>Value</var> with the name
468
<var>Ident</var> to the section <var>Section</var>, overwriting any previous
469
value that may exist there. The section will be created if it does not
473
<link id="TCustomIniFile.ReadString">ReadString</link>
474
<link id="TCustomIniFile.WriteInteger">WriteInteger</link>
475
<link id="TCustomIniFile.WriteBool">WriteBool</link>
476
<link id="TCustomIniFile.WriteDate">WriteDate</link>
477
<link id="TCustomIniFile.WriteDateTime">WriteDateTime</link>
478
<link id="TCustomIniFile.WriteTime">WriteTime</link>
479
<link id="TCustomIniFile.WriteFloat">WriteFloat</link>
480
<link id="TCustomIniFile.WriteBinaryStream">WriteBinaryStream</link>
484
<!-- argument Visibility: default -->
485
<element name="TCustomIniFile.WriteString.Section">
486
<short>Section to write key value to</short>
489
<!-- argument Visibility: default -->
490
<element name="TCustomIniFile.WriteString.Ident">
491
<short>Key name with which to write value</short>
494
<!-- argument Visibility: default -->
495
<element name="TCustomIniFile.WriteString.Value">
496
<short>String value to write</short>
499
<!-- function Visibility: public -->
500
<element name="TCustomIniFile.ReadInteger">
501
<short>Read an integer value from the file</short>
503
<var>ReadInteger</var> reads the key <var>Ident</var> in section <var>Section</var>,
504
and returns the value as an integer. If the specified key or section do not exist,
505
then the value in <var>Default</var> is returned. If the key
506
exists, but contains an invalid integer value, <var>Default</var> is also returned.
509
<link id="TCustomIniFile.WriteInteger">WriteInteger</link>
510
<link id="TCustomIniFile.ReadString">ReadString</link>
511
<link id="TCustomIniFile.ReadBool">ReadBool</link>
512
<link id="TCustomIniFile.ReadDate">ReadDate</link>
513
<link id="TCustomIniFile.ReadDateTime">ReadDateTime</link>
514
<link id="TCustomIniFile.ReadTime">ReadTime</link>
515
<link id="TCustomIniFile.ReadFloat">ReadFloat</link>
516
<link id="TCustomIniFile.ReadBinaryStream">ReadBinaryStream</link>
520
<!-- function result Visibility: default -->
521
<element name="TCustomIniFile.ReadInteger.Result">
522
<short>Value of <var>Ident</var> as an integer.</short>
525
<!-- argument Visibility: default -->
526
<element name="TCustomIniFile.ReadInteger.Section">
527
<short>Section to read <var>Ident</var> from</short>
530
<!-- argument Visibility: default -->
531
<element name="TCustomIniFile.ReadInteger.Ident">
532
<short>Name of key to retrieve value from</short>
535
<!-- argument Visibility: default -->
536
<element name="TCustomIniFile.ReadInteger.Default">
537
<short>Default value to return when the key <var>Ident</var> does not exist.</short>
540
<!-- procedure Visibility: public -->
541
<element name="TCustomIniFile.WriteInteger">
542
<short>Write an integer value</short>
544
<var>WriteInteger</var> writes the integer <var>Value</var> with the name
545
<var>Ident</var> to the section <var>Section</var>, overwriting any previous
546
value that may exist there. The section will be created if it does not
550
<link id="TCustomIniFile.ReadInteger">ReadInteger</link>
551
<link id="TCustomIniFile.WriteString">WriteString</link>
552
<link id="TCustomIniFile.WriteBool">WriteBool</link>
553
<link id="TCustomIniFile.WriteDate">WriteDate</link>
554
<link id="TCustomIniFile.WriteDateTime">WriteDateTime</link>
555
<link id="TCustomIniFile.WriteTime">WriteTime</link>
556
<link id="TCustomIniFile.WriteFloat">WriteFloat</link>
557
<link id="TCustomIniFile.WriteBinaryStream">WriteBinaryStream</link>
561
<!-- argument Visibility: default -->
562
<element name="TCustomIniFile.WriteInteger.Section">
563
<short>Section to write key value to</short>
566
<!-- argument Visibility: default -->
567
<element name="TCustomIniFile.WriteInteger.Ident">
568
<short>Key name with which to write value</short>
571
<!-- argument Visibility: default -->
572
<element name="TCustomIniFile.WriteInteger.Value">
573
<short>Integer value to write</short>
576
<!-- function Visibility: public -->
577
<element name="TCustomIniFile.ReadBool">
580
<var>ReadString</var> reads the key <var>Ident</var> in section <var>Section</var>,
581
and returns the value as a boolean (valid values are 0 and 1). If the specified key
582
or section do not exist, then the value in <var>Default</var> is returned. If the key
583
exists, but contains an invalid integer value, <var>False</var> is also returned.
588
<link id="TCustomIniFile.WriteBool">WriteBool</link>
589
<link id="TCustomIniFile.ReadInteger">ReadInteger</link>
590
<link id="TCustomIniFile.ReadString">ReadString</link>
591
<link id="TCustomIniFile.ReadDate">ReadDate</link>
592
<link id="TCustomIniFile.ReadDateTime">ReadDateTime</link>
593
<link id="TCustomIniFile.ReadTime">ReadTime</link>
594
<link id="TCustomIniFile.ReadFloat">ReadFloat</link>
595
<link id="TCustomIniFile.ReadBinaryStream">ReadBinaryStream</link>
599
<!-- function result Visibility: default -->
600
<element name="TCustomIniFile.ReadBool.Result">
601
<short>Value of <var>Ident</var> as a boolean</short>
604
<!-- argument Visibility: default -->
605
<element name="TCustomIniFile.ReadBool.Section">
606
<short>Section to read <var>Ident</var> from</short>
609
<!-- argument Visibility: default -->
610
<element name="TCustomIniFile.ReadBool.Ident">
611
<short>Name of key to retrieve value from</short>
614
<!-- argument Visibility: default -->
615
<element name="TCustomIniFile.ReadBool.Default">
616
<short>Default value to return when the key <var>Ident</var> does not exist.</short>
619
<!-- procedure Visibility: public -->
620
<element name="TCustomIniFile.WriteBool">
621
<short>Write boolean value</short>
623
<var>WriteBool</var> writes the boolean <var>Value</var> with the name
624
<var>Ident</var> to the section <var>Section</var>, overwriting any previous
625
value that may exist there. The section will be created if it does not
629
<link id="TCustomIniFile.ReadBool">ReadBool</link>
630
<link id="TCustomIniFile.WriteInteger">WriteInteger</link>
631
<link id="TCustomIniFile.WriteString">WriteString</link>
632
<link id="TCustomIniFile.WriteDate">WriteDate</link>
633
<link id="TCustomIniFile.WriteDateTime">WriteDateTime</link>
634
<link id="TCustomIniFile.WriteTime">WriteTime</link>
635
<link id="TCustomIniFile.WriteFloat">WriteFloat</link>
636
<link id="TCustomIniFile.WriteBinaryStream">WriteBinaryStream</link>
640
<!-- argument Visibility: default -->
641
<element name="TCustomIniFile.WriteBool.Section">
642
<short>Section to write key value to</short>
645
<!-- argument Visibility: default -->
646
<element name="TCustomIniFile.WriteBool.Ident">
647
<short>Key name with which to write value</short>
650
<!-- argument Visibility: default -->
651
<element name="TCustomIniFile.WriteBool.Value">
652
<short>Boolean value to write</short>
655
<!-- function Visibility: public -->
656
<element name="TCustomIniFile.ReadDate">
657
<short>Read a date value</short>
659
<var>ReadDate</var> reads the key <var>Ident</var> in section <var>Section</var>,
660
and returns the value as a date (<var>TDateTime</var>). If the specified key or section do not exist,
661
then the value in <var>Default</var> is returned. If the key
662
exists, but contains an invalid date value, <var>Default</var> is also returned.
663
The international settings of the <file>SysUtils</file> are taken into
664
account when deciding if the read value is a correct date.
669
<link id="TCustomIniFile.WriteDate">WriteDate</link>
670
<link id="TCustomIniFile.ReadInteger">ReadInteger</link>
671
<link id="TCustomIniFile.ReadBool">ReadBool</link>
672
<link id="TCustomIniFile.ReadString">ReadString</link>
673
<link id="TCustomIniFile.ReadDateTime">ReadDateTime</link>
674
<link id="TCustomIniFile.ReadTime">ReadTime</link>
675
<link id="TCustomIniFile.ReadFloat">ReadFloat</link>
676
<link id="TCustomIniFile.ReadBinaryStream">ReadBinaryStream</link>
680
<!-- function result Visibility: default -->
681
<element name="TCustomIniFile.ReadDate.Result">
682
<short>Value of <var>Ident</var> as a <var>TDateTime</var></short>
685
<!-- argument Visibility: default -->
686
<element name="TCustomIniFile.ReadDate.Section">
687
<short>Section to read <var>Ident</var> from</short>
690
<!-- argument Visibility: default -->
691
<element name="TCustomIniFile.ReadDate.Ident">
692
<short>Name of key to retrieve value from</short>
695
<!-- argument Visibility: default -->
696
<element name="TCustomIniFile.ReadDate.Default">
697
<short>Default value to return when the key <var>Ident</var> does not exist.</short>
700
<!-- function Visibility: public -->
701
<element name="TCustomIniFile.ReadDateTime">
702
<short>Read a Date/Time value</short>
704
<var>ReadDateTime</var> reads the key <var>Ident</var> in section <var>Section</var>,
705
and returns the value as a date/time (<var>TDateTime</var>). If the specified key or section do not exist,
706
then the value in <var>Default</var> is returned. If the key
707
exists, but contains an invalid date/time value, <var>Default</var> is also returned.
708
The international settings of the <file>SysUtils</file> are taken into
709
account when deciding if the read value is a correct date/time.
712
<link id="TCustomIniFile.WriteDateTime">WriteDateTime</link>
713
<link id="TCustomIniFile.ReadInteger">ReadInteger</link>
714
<link id="TCustomIniFile.ReadBool">ReadBool</link>
715
<link id="TCustomIniFile.ReadDate">ReadDate</link>
716
<link id="TCustomIniFile.ReadString">ReadString</link>
717
<link id="TCustomIniFile.ReadTime">ReadTime</link>
718
<link id="TCustomIniFile.ReadFloat">ReadFloat</link>
719
<link id="TCustomIniFile.ReadBinaryStream">ReadBinaryStream</link>
723
<!-- function result Visibility: default -->
724
<element name="TCustomIniFile.ReadDateTime.Result">
725
<short>Value of <var>Ident</var> as a <var>TDateTime</var></short>
728
<!-- argument Visibility: default -->
729
<element name="TCustomIniFile.ReadDateTime.Section">
730
<short>Section to read <var>Ident</var> from</short>
733
<!-- argument Visibility: default -->
734
<element name="TCustomIniFile.ReadDateTime.Ident">
735
<short>Name of key to retrieve value from</short>
738
<!-- argument Visibility: default -->
739
<element name="TCustomIniFile.ReadDateTime.Default">
740
<short>Default value to return when the key <var>Ident</var> does not exist.</short>
743
<!-- function Visibility: public -->
744
<element name="TCustomIniFile.ReadFloat">
745
<short>Read a floating point value</short>
747
<var>ReadFloat</var> reads the key <var>Ident</var> in section <var>Section</var>,
748
and returns the value as a float (<var>Double</var>). If the specified key or section do not exist,
749
then the value in <var>Default</var> is returned. If the key
750
exists, but contains an invalid float value, <var>Default</var> is also returned.
751
The international settings of the <file>SysUtils</file> are taken into
752
account when deciding if the read value is a correct float.
755
<link id="TCustomIniFile.WriteFloat">WriteFloat</link>
756
<link id="TCustomIniFile.ReadInteger">ReadInteger</link>
757
<link id="TCustomIniFile.ReadBool">ReadBool</link>
758
<link id="TCustomIniFile.ReadDate">ReadDate</link>
759
<link id="TCustomIniFile.ReadDateTime">ReadDateTime</link>
760
<link id="TCustomIniFile.ReadTime">ReadTime</link>
761
<link id="TCustomIniFile.ReadString">ReadString</link>
762
<link id="TCustomIniFile.ReadBinaryStream">ReadBinaryStream</link>
766
<!-- function result Visibility: default -->
767
<element name="TCustomIniFile.ReadFloat.Result">
768
<short>Value of <var>Ident</var> as a floating point value</short>
771
<!-- argument Visibility: default -->
772
<element name="TCustomIniFile.ReadFloat.Section">
773
<short>Section to read <var>Ident</var> from</short>
776
<!-- argument Visibility: default -->
777
<element name="TCustomIniFile.ReadFloat.Ident">
778
<short>Name of key to retrieve value from</short>
781
<!-- argument Visibility: default -->
782
<element name="TCustomIniFile.ReadFloat.Default">
783
<short>Default value to return when the key <var>Ident</var> does not exist.</short>
786
<!-- function Visibility: public -->
787
<element name="TCustomIniFile.ReadTime">
788
<short>Read a time value</short>
790
<var>ReadTime</var> reads the key <var>Ident</var> in section <var>Section</var>,
791
and returns the value as a time (<var>TDateTime</var>). If the specified key or section do not exist,
792
then the value in <var>Default</var> is returned. If the key
793
exists, but contains an invalid time value, <var>Default</var> is also returned.
794
The international settings of the <file>SysUtils</file> are taken into
795
account when deciding if the read value is a correct time.
800
<link id="TCustomIniFile.WriteTime">WriteTime</link>
801
<link id="TCustomIniFile.ReadInteger">ReadInteger</link>
802
<link id="TCustomIniFile.ReadBool">ReadBool</link>
803
<link id="TCustomIniFile.ReadDate">ReadDate</link>
804
<link id="TCustomIniFile.ReadDateTime">ReadDateTime</link>
805
<link id="TCustomIniFile.ReadString">ReadString</link>
806
<link id="TCustomIniFile.ReadFloat">ReadFloat</link>
807
<link id="TCustomIniFile.ReadBinaryStream">ReadBinaryStream</link>
811
<!-- function result Visibility: default -->
812
<element name="TCustomIniFile.ReadTime.Result">
813
<short>Value of <var>Ident</var> as a <var>TDateTime</var></short>
816
<!-- argument Visibility: default -->
817
<element name="TCustomIniFile.ReadTime.Section">
818
<short>Section to read <var>Ident</var> from</short>
821
<!-- argument Visibility: default -->
822
<element name="TCustomIniFile.ReadTime.Ident">
823
<short>Name of key to retrieve value from</short>
826
<!-- argument Visibility: default -->
827
<element name="TCustomIniFile.ReadTime.Default">
828
<short>Default value to return when the key <var>Ident</var> does not exist.</short>
831
<!-- function Visibility: public -->
832
<element name="TCustomIniFile.ReadBinaryStream">
833
<short>Read binary data</short>
836
<var>ReadBinaryStream</var> reads the key <var>Name</var> in section <var>Section</var>,
837
and returns the value in the stream <var>Value</var>. If the specified key or section do
838
not exist, then the contents of <var>Value</var> are left untouched. The
839
stream is not cleared prior to adding data to it.
842
The data is interpreted as a series of 2-byte hexadecimal values, each
843
representing a byte in the data stream, i.e, it should always be an even
844
number of hexadecimal characters.
848
<link id="TCustomIniFile.WriteBinaryStream">WriteBinaryStream</link>
849
<link id="TCustomIniFile.ReadInteger">ReadInteger</link>
850
<link id="TCustomIniFile.ReadBool">ReadBool</link>
851
<link id="TCustomIniFile.ReadDate">ReadDate</link>
852
<link id="TCustomIniFile.ReadDateTime">ReadDateTime</link>
853
<link id="TCustomIniFile.ReadTime">ReadTime</link>
854
<link id="TCustomIniFile.ReadFloat">ReadFloat</link>
855
<link id="TCustomIniFile.ReadString">ReadString</link>
859
<!-- function result Visibility: default -->
860
<element name="TCustomIniFile.ReadBinaryStream.Result">
861
<short>Number of bytes written to <var>Value</var></short>
864
<!-- argument Visibility: default -->
865
<element name="TCustomIniFile.ReadBinaryStream.Section">
866
<short>Section to read <var>Name</var> from</short>
869
<!-- argument Visibility: default -->
870
<element name="TCustomIniFile.ReadBinaryStream.Name">
871
<short>Name of key to retrieve value from</short>
874
<!-- argument Visibility: default -->
875
<element name="TCustomIniFile.ReadBinaryStream.Value">
876
<short>Stream to write data to.</short>
879
<!-- procedure Visibility: public -->
880
<element name="TCustomIniFile.WriteDate">
881
<short>Write date value</short>
883
<var>WriteDate</var> writes the date <var>Value</var> with the name
884
<var>Ident</var> to the section <var>Section</var>, overwriting any previous
885
value that may exist there. The section will be created if it does not
886
exist. The date is written using the internationalization settings in the
887
<file>SysUtils</file> unit.
892
<link id="TCustomIniFile.ReadDate">ReadDate</link>
893
<link id="TCustomIniFile.WriteInteger">WriteInteger</link>
894
<link id="TCustomIniFile.WriteBool">WriteBool</link>
895
<link id="TCustomIniFile.WriteString">WriteString</link>
896
<link id="TCustomIniFile.WriteDateTime">WriteDateTime</link>
897
<link id="TCustomIniFile.WriteTime">WriteTime</link>
898
<link id="TCustomIniFile.WriteFloat">WriteFloat</link>
899
<link id="TCustomIniFile.WriteBinaryStream">WriteBinaryStream</link>
903
<!-- argument Visibility: default -->
904
<element name="TCustomIniFile.WriteDate.Section">
905
<short>Section to write key value to</short>
908
<!-- argument Visibility: default -->
909
<element name="TCustomIniFile.WriteDate.Ident">
910
<short>Key name with which to write value</short>
913
<!-- argument Visibility: default -->
914
<element name="TCustomIniFile.WriteDate.Value">
915
<short>Date value to write</short>
918
<!-- procedure Visibility: public -->
919
<element name="TCustomIniFile.WriteDateTime">
920
<short>Write date/time value</short>
922
<var>WriteDateTime</var> writes the date/time <var>Value</var> with the name
923
<var>Ident</var> to the section <var>Section</var>, overwriting any previous
924
value that may exist there. The section will be created if it does not
925
exist. The date/time is written using the internationalization settings in the
926
<file>SysUtils</file> unit.
929
<link id="TCustomIniFile.ReadDateTime">ReadDateTime</link>
930
<link id="TCustomIniFile.WriteInteger">WriteInteger</link>
931
<link id="TCustomIniFile.WriteBool">WriteBool</link>
932
<link id="TCustomIniFile.WriteDate">WriteDate</link>
933
<link id="TCustomIniFile.WriteString">WriteString</link>
934
<link id="TCustomIniFile.WriteTime">WriteTime</link>
935
<link id="TCustomIniFile.WriteFloat">WriteFloat</link>
936
<link id="TCustomIniFile.WriteBinaryStream">WriteBinaryStream</link>
940
<!-- argument Visibility: default -->
941
<element name="TCustomIniFile.WriteDateTime.Section">
942
<short>Section to write key value to</short>
945
<!-- argument Visibility: default -->
946
<element name="TCustomIniFile.WriteDateTime.Ident">
947
<short>Key name with which to write value</short>
950
<!-- argument Visibility: default -->
951
<element name="TCustomIniFile.WriteDateTime.Value">
952
<short>Date/Time value to write</short>
955
<!-- procedure Visibility: public -->
956
<element name="TCustomIniFile.WriteFloat">
957
<short>Write a floating-point value</short>
959
<var>WriteFloat</var> writes the time <var>Value</var> with the name
960
<var>Ident</var> to the section <var>Section</var>, overwriting any previous
961
value that may exist there. The section will be created if it does not
962
exist. The floating point value is written using the internationalization
963
settings in the <file>SysUtils</file> unit.
966
<link id="TCustomIniFile.ReadFloat">ReadFloat</link>
967
<link id="TCustomIniFile.WriteInteger">WriteInteger</link>
968
<link id="TCustomIniFile.WriteBool">WriteBool</link>
969
<link id="TCustomIniFile.WriteDate">WriteDate</link>
970
<link id="TCustomIniFile.WriteDateTime">WriteDateTime</link>
971
<link id="TCustomIniFile.WriteTime">WriteTime</link>
972
<link id="TCustomIniFile.WriteString">WriteString</link>
973
<link id="TCustomIniFile.WriteBinaryStream">WriteBinaryStream</link>
977
<!-- argument Visibility: default -->
978
<element name="TCustomIniFile.WriteFloat.Section">
979
<short>Section to write key value to</short>
982
<!-- argument Visibility: default -->
983
<element name="TCustomIniFile.WriteFloat.Ident">
984
<short>Key name with which to write value</short>
987
<!-- argument Visibility: default -->
988
<element name="TCustomIniFile.WriteFloat.Value">
989
<short>Float value to write</short>
992
<!-- procedure Visibility: public -->
993
<element name="TCustomIniFile.WriteTime">
994
<short>Write time value</short>
996
<var>WriteTime</var> writes the time <var>Value</var> with the name
997
<var>Ident</var> to the section <var>Section</var>, overwriting any previous
998
value that may exist there. The section will be created if it does not
999
exist. The time is written using the internationalization settings in the
1000
<file>SysUtils</file> unit.
1003
<link id="TCustomIniFile.ReadTime">ReadTime</link>
1004
<link id="TCustomIniFile.WriteInteger">WriteInteger</link>
1005
<link id="TCustomIniFile.WriteBool">WriteBool</link>
1006
<link id="TCustomIniFile.WriteDate">WriteDate</link>
1007
<link id="TCustomIniFile.WriteDateTime">WriteDateTime</link>
1008
<link id="TCustomIniFile.WriteString">WriteString</link>
1009
<link id="TCustomIniFile.WriteFloat">WriteFloat</link>
1010
<link id="TCustomIniFile.WriteBinaryStream">WriteBinaryStream</link>
1014
<!-- argument Visibility: default -->
1015
<element name="TCustomIniFile.WriteTime.Section">
1016
<short>Section to write key value to</short>
1019
<!-- argument Visibility: default -->
1020
<element name="TCustomIniFile.WriteTime.Ident">
1021
<short>Key name with which to write value</short>
1024
<!-- argument Visibility: default -->
1025
<element name="TCustomIniFile.WriteTime.Value">
1026
<short>Time value to write</short>
1029
<!-- procedure Visibility: public -->
1030
<element name="TCustomIniFile.WriteBinaryStream">
1031
<short>Write binary data</short>
1034
<var>WriteBinaryStream</var> writes the binary data in <var>Value</var> with the name
1035
<var>Ident</var> to the section <var>Section</var>, overwriting any previous
1036
value that may exist there. The section will be created if it does not
1040
The binary data is encoded using a 2-byte hexadecimal value per byte in the
1041
data stream. The data stream must be seekable, so it's size can be
1042
determined. The data stream is not repositioned, it must be at the correct
1047
<link id="TCustomIniFile.ReadBinaryStream">ReadBinaryStream</link>
1048
<link id="TCustomIniFile.WriteInteger">WriteInteger</link>
1049
<link id="TCustomIniFile.WriteBool">WriteBool</link>
1050
<link id="TCustomIniFile.WriteDate">WriteDate</link>
1051
<link id="TCustomIniFile.WriteDateTime">WriteDateTime</link>
1052
<link id="TCustomIniFile.WriteTime">WriteTime</link>
1053
<link id="TCustomIniFile.WriteFloat">WriteFloat</link>
1054
<link id="TCustomIniFile.WriteString">WriteString</link>
1058
<!-- argument Visibility: default -->
1059
<element name="TCustomIniFile.WriteBinaryStream.Section">
1060
<short>Section to write key value to</short>
1063
<!-- argument Visibility: default -->
1064
<element name="TCustomIniFile.WriteBinaryStream.Name">
1065
<short>Key name with which to write value</short>
1068
<!-- argument Visibility: default -->
1069
<element name="TCustomIniFile.WriteBinaryStream.Value">
1070
<short>Binary data to write</short>
1073
<!-- procedure Visibility: public -->
1074
<element name="TCustomIniFile.ReadSection">
1075
<short>Read the key names in a section</short>
1077
<var>ReadSection</var> will return the names of the keys in section
1078
<var>Section</var> in <var>Strings</var>, one string per key. If a
1079
non-existing section is specified, the list is cleared. To return the values
1080
of the keys as well, the <link
1081
id="TCustomIniFile.ReadSectionValues">ReadSectionValues</link> method should
1085
<link id="TCustomIniFile.ReadSections">ReadSections</link>
1086
<link id="TCustomIniFile.SectionExists">SectionExists</link>
1087
<link id="TCustomIniFile.ReadSectionValues">ReadSectionValues</link>
1091
<!-- argument Visibility: default -->
1092
<element name="TCustomIniFile.ReadSection.Section">
1093
<short>Section for which to read key names</short>
1096
<!-- argument Visibility: default -->
1097
<element name="TCustomIniFile.ReadSection.Strings">
1098
<short>Stringlist to store key names in</short>
1101
<!-- procedure Visibility: public -->
1102
<element name="TCustomIniFile.ReadSections">
1103
<short>Read the list of sections</short>
1105
<var>ReadSections</var> returns the names of existing sections in
1106
<var>Strings</var>. It also returns names of empty sections.
1109
<link id="TCustomIniFile.SectionExists">SectionExists</link>
1110
<link id="TCustomIniFile.ReadSectionValues">ReadSectionValues</link>
1111
<link id="TCustomIniFile.ReadSection">ReadSection</link>
1115
<!-- argument Visibility: default -->
1116
<element name="TCustomIniFile.ReadSections.Strings">
1117
<short>Stringlist in which to return section names</short>
1120
<!-- procedure Visibility: public -->
1121
<element name="TCustomIniFile.ReadSectionValues">
1122
<short>Read names and values of a section</short>
1124
<var>ReadSectionValues</var> returns the keys and their values in the
1125
section <var>Section</var> in <var>Strings</var>. They are returned as
1126
<var>Key=Value</var> strings, one per key, so the <var>Values</var> property
1127
of the stringlist can be used to read the values. To retrieve just the names
1128
of the available keys, <link id="TCustomIniFile.ReadSection">ReadSection</link>
1132
<link id="TCustomIniFile.SectionExists">SectionExists</link>
1133
<link id="TCustomIniFile.ReadSections">ReadSections</link>
1134
<link id="TCustomIniFile.ReadSection">ReadSection</link>
1138
<!-- argument Visibility: default -->
1139
<element name="TCustomIniFile.ReadSectionValues.Section">
1140
<short>Section for which to read key names and values</short>
1143
<!-- argument Visibility: default -->
1144
<element name="TCustomIniFile.ReadSectionValues.Strings">
1145
<short>Stringlist to store key/value pairs in</short>
1148
<!-- procedure Visibility: public -->
1149
<element name="TCustomIniFile.EraseSection">
1150
<short>Clear a section </short>
1152
<var>EraseSection</var> deletes all values from the section named
1153
<var>Section</var> and removes the section from the ini file.
1154
If the section didn't exist prior to a call to <var>EraseSection</var>, nothing happens.
1157
<link id="TCustomIniFile.SectionExists">SectionExists</link>
1158
<link id="TCustomIniFile.ReadSections">ReadSections</link>
1159
<link id="TCustomIniFile.DeleteKey">DeleteKey</link>
1163
<!-- argument Visibility: default -->
1164
<element name="TCustomIniFile.EraseSection.Section">
1165
<short>Name of section to erase</short>
1168
<!-- procedure Visibility: public -->
1169
<element name="TCustomIniFile.DeleteKey">
1170
<short>Delete a key from a section</short>
1172
<var>DeleteKey</var> deletes the key <var>Ident</var> from section
1173
<var>Section</var>. If the key or section didn't exist prior to the
1174
<var>DeleteKey</var> call, nothing happens.
1177
<link id="TCustomIniFile.EraseSection">EraseSection</link>
1181
<!-- argument Visibility: default -->
1182
<element name="TCustomIniFile.DeleteKey.Section">
1183
<short>Section from which to delete key</short>
1186
<!-- argument Visibility: default -->
1187
<element name="TCustomIniFile.DeleteKey.Ident">
1188
<short>Name of key to delete</short>
1191
<!-- procedure Visibility: public -->
1192
<element name="TCustomIniFile.UpdateFile">
1193
<short>Update the file on disk</short>
1195
<var>UpdateFile</var> writes the in-memory image of the ini-file to disk.
1196
To speed up operation of the inifile class, the whole ini-file is read into
1197
memory when the class is created, and all operations are performed
1198
in-memory. If <var>CacheUpdates</var> is set to <var>True</var>, any
1199
changes to the inifile are only in memory, until they are committed to disk
1200
with a call to <var>UpdateFile</var>. If <var>CacheUpdates</var> is set to
1201
<var>False</var>, then all operations which cause a change in the .ini file
1202
will immediatly be committed to disk with a call to
1203
<var>UpdateFile</var>. Since the whole file is written to disk, this may have
1204
serious impact on performance.
1207
<link id="TIniFile.CacheUpdates">CacheUpdates</link>
1211
<!-- function Visibility: public -->
1212
<element name="TCustomIniFile.ValueExists">
1213
<short>Check if a value exists</short>
1215
<var>ValueExists</var> checks whether the key <var>Ident</var> exists in
1216
section <var>Section</var>. It returns <var>True</var> if a key was found,
1217
or <var>False</var> if not. The key may be empty.
1220
<link id="TCustomIniFile.SectionExists">SectionExists</link>
1224
<!-- function result Visibility: default -->
1225
<element name="TCustomIniFile.ValueExists.Result">
1226
<short><var>True</var> if <var>Ident</var> exists in section <var>Section</var></short>
1229
<!-- argument Visibility: default -->
1230
<element name="TCustomIniFile.ValueExists.Section">
1231
<short>Section in which to look for <var>Ident</var></short>
1234
<!-- argument Visibility: default -->
1235
<element name="TCustomIniFile.ValueExists.Ident">
1236
<short>Key name to look for.</short>
1239
<!-- property Visibility: public -->
1240
<element name="TCustomIniFile.FileName">
1241
<short>Name of the .ini file</short>
1243
<var>FileName</var> is the name of the ini file on disk. It should be
1244
specified when the <var>TCustomIniFile</var> instance is created. Contrary
1245
to the Delphi implementation, if no path component is present in the
1246
filename, the filename is not searched in the windows directory.
1249
<link id="TCustomIniFile.Create">Create</link>
1253
<!-- property Visibility: public -->
1254
<element name="TCustomIniFile.EscapeLineFeeds">
1255
<short>Should linefeeds be escaped ?</short>
1258
<var>EscapeLineFeeds</var> determines whether escaping of linefeeds is
1259
enabled: For a description of this feature, see <link
1260
id="TCustomIniFile.Create">Create</link>, as the value of this property must
1261
be specified when the <var>TCustomIniFile</var> instance is created.
1264
By default, <var>EscapeLineFeeds</var> is <var>False</var>.
1268
<link id="TCustomIniFile.Create">Create</link>
1269
<link id="TCustomIniFile.CaseSensitive">CaseSensitive</link>
1273
<!-- property Visibility: public -->
1274
<element name="TCustomIniFile.CaseSensitive">
1275
<short>Are key and section names case sensitive</short>
1277
<var>CaseSensitive</var> determines whether searches for sections and keys
1278
are performed case-sensitive or not. By default, they are not case
1282
<link id="TCustomIniFile.EscapeLineFeeds">EscapeLineFeeds</link>
1287
********************************************************************
1288
#fcl.IniFiles.TIniFile
1289
********************************************************************
1292
<!-- object Visibility: default -->
1293
<element name="TIniFile">
1294
<short>Ini file implementation</short>
1297
<var>TIniFile</var> is an implementation of <link id="TCustomIniFile"/>
1298
which does the same as <link id="TMemIniFile"/>, namely it reads the whole file
1299
into memory. Unlike <var>TMemIniFile</var> it does not cache updates in
1300
memory, but immediatly writes any changes to disk.
1303
<var>TIniFile</var> introduces no new methods, it just implements the
1304
abstract methods introduced in <var>TCustomIniFile</var>
1308
<link id="TCustomIniFile"/>
1309
<link id="TMemIniFile"/>
1313
<!-- constructor Visibility: public -->
1314
<element name="TIniFile.Create">
1315
<short>Create a new instance of <var>TIniFile</var></short>
1317
<var>Create</var> creates a new instance of <var>TIniFile</var> and
1318
initializes the class by reading the file from disk if the filename
1319
<var>AFileName</var> is specified, or from stream in case <var>AStream</var>
1320
is specified. It also sets most variables to their initial values, i.e.
1321
<var>AEscapeLineFeeds</var> is saved prior to reading the file, and
1322
<var>Cacheupdates</var> is set to <var>False</var>.
1325
<link id="TCustomIniFile"/>
1326
<link id="TMemIniFile"/>
1330
<!-- argument Visibility: default -->
1331
<element name="TIniFile.Create.AFileName">
1332
<short>Filename to read from</short>
1335
<!-- argument Visibility: default -->
1336
<element name="TIniFile.Create.AEscapeLineFeeds">
1337
<short>Should escaping of linefeeds be enabled ?</short>
1340
<!-- argument Visibility: default -->
1341
<element name="TIniFile.Create.AStream">
1342
<short>Stream to read ini data from</short>
1345
<!-- destructor Visibility: public -->
1346
<element name="TIniFile.Destroy">
1347
<short>Remove the <var>TIniFile</var> instance from memory</short>
1349
<var>Destroy</var> writes any pending changes to disk, and cleans up the
1350
<var>TIniFile</var> structures, and then calls the inherited
1351
<var>Destroy</var>, effectively removing the instance from memory.
1354
If an error happens when the file is written to disk, an exception will be
1358
<link id="TCustomIniFile.UpdateFile">UpdateFile</link>
1359
<link id="TIniFile.CacheUpdates">CacheUpdates</link>
1363
<!-- function Visibility: public -->
1364
<element name="TIniFile.ReadString">
1365
<short>Read a string</short>
1367
<var>ReadString</var> implements the <link id="TCustomIniFile.ReadString"/>
1368
abstract method by looking at the in-memory copy of the ini file and
1369
returning the string found there.
1372
<link id="TCustomIniFile.ReadString"/>
1376
<!-- function result Visibility: default -->
1377
<element name="TIniFile.ReadString.Result">
1378
<short>Value of the string or <var>Default</var> if none found.</short>
1381
<!-- argument Visibility: default -->
1382
<element name="TIniFile.ReadString.Section">
1383
<short>Section to search key value in</short>
1386
<!-- argument Visibility: default -->
1387
<element name="TIniFile.ReadString.Ident">
1388
<short>Key name</short>
1391
<!-- argument Visibility: default -->
1392
<element name="TIniFile.ReadString.Default">
1393
<short>Default value if none is found.</short>
1396
<!-- procedure Visibility: public -->
1397
<element name="TIniFile.WriteString">
1398
<short>Write string to file</short>
1400
<var>WriteString</var> implements the <link id="TCustomIniFile.WriteString"/>
1401
abstract method by writing the string to the in-memory copy of the ini file.
1402
If <link id="TIniFile.CacheUpdates">CacheUpdates</link> property is
1403
<var>False</var>, then the whole file is immediatly written to disk as well.
1406
If an error happens when the file is written to disk, an exception will be
1413
<!-- argument Visibility: default -->
1414
<element name="TIniFile.WriteString.Section">
1415
<short>Section to write key value in</short>
1418
<!-- argument Visibility: default -->
1419
<element name="TIniFile.WriteString.Ident">
1420
<short>Key name to use</short>
1423
<!-- argument Visibility: default -->
1424
<element name="TIniFile.WriteString.Value">
1425
<short>String value to write</short>
1428
<!-- procedure Visibility: public -->
1429
<element name="TIniFile.ReadSection">
1430
<short>Read the key names in a section</short>
1432
<var>ReadSection</var> reads the key names from <var>Section</var> into
1433
<var>Strings</var>, taking the in-memory copy of the ini file.
1434
This is the implementation for the abstract <link id="TCustomIniFile.ReadSection"/>
1437
<link id="TCustomIniFile.ReadSection"/>
1438
<link id="TIniFile.ReadSectionRaw"/>
1442
<!-- argument Visibility: default -->
1443
<element name="TIniFile.ReadSection.Section">
1444
<short>Section to read names from</short>
1447
<!-- argument Visibility: default -->
1448
<element name="TIniFile.ReadSection.Strings">
1449
<short>Stringlist to store names in</short>
1452
<!-- procedure Visibility: public -->
1453
<element name="TIniFile.ReadSectionRaw">
1454
<short>Read raw section</short>
1456
<var>ReadSectionRaw</var> returns the contents of the section
1457
<var>Section</var> as it is: this includes the comments in the
1458
section. (these are also stored in memory)
1461
<link id="TIniFile.ReadSection"/>
1462
<link id="TCustomIniFile.ReadSection"/>
1466
<!-- argument Visibility: default -->
1467
<element name="TIniFile.ReadSectionRaw.Section">
1468
<short>Section name to read</short>
1471
<!-- argument Visibility: default -->
1472
<element name="TIniFile.ReadSectionRaw.Strings">
1473
<short>Strings to store section contents in</short>
1476
<!-- procedure Visibility: public -->
1477
<element name="TIniFile.ReadSections">
1478
<short>Read section names</short>
1480
<var>ReadSections</var> is the implementation of <link
1481
id="TCustomIniFile.ReadSections"/>. It operates on the in-memory copy of the
1482
inifile, and places all section names in <var>Strings</var>.
1485
<link id="TIniFile.ReadSection"/>
1486
<link id="TCustomIniFile.ReadSections"/>
1487
<link id="TIniFile.ReadSectionValues"/>
1491
<!-- argument Visibility: default -->
1492
<element name="TIniFile.ReadSections.Strings">
1493
<short>Stringlist to store section names in</short>
1496
<!-- procedure Visibility: public -->
1497
<element name="TIniFile.ReadSectionValues">
1500
<var>ReadSectionValues</var> is the implementation of <link
1501
id="TCustomIniFile.ReadSectionValues"/>. It operates on the in-memory copy of the
1502
inifile, and places all key names from <var>Section</var> together with
1503
their values in <var>Strings</var>.
1506
<link id="TIniFile.ReadSection"/>
1507
<link id="TCustomIniFile.ReadSectionValues"/>
1508
<link id="TIniFile.ReadSections"/>
1512
<!-- argument Visibility: default -->
1513
<element name="TIniFile.ReadSectionValues.Section">
1514
<short>Section to read key name/values from</short>
1517
<!-- argument Visibility: default -->
1518
<element name="TIniFile.ReadSectionValues.Strings">
1519
<short>Stringlist to store key/value pairs in.</short>
1522
<!-- procedure Visibility: public -->
1523
<element name="TIniFile.EraseSection">
1526
<var>Erasesection</var> deletes the section <var>Section</var> from memory,
1527
if <link id="TIniFile.CacheUpdates">CacheUpdates</link> is <var>False</var>,
1528
then the file is immediatly updated on disk. This method is the
1529
implementation of the abstract <link id="TCustomIniFile.EraseSection"/>
1533
<link id="TCustomIniFile.EraseSection"/>
1534
<link id="TIniFile.ReadSection"/>
1535
<link id="TIniFile.ReadSections"/>
1539
<!-- argument Visibility: default -->
1540
<element name="TIniFile.EraseSection.Section">
1541
<short>Section to erase</short>
1544
<!-- procedure Visibility: public -->
1545
<element name="TIniFile.DeleteKey">
1546
<short>Delete key</short>
1548
<var>DeleteKey</var> deletes the <var>Ident</var> from the section
1549
<var>Section</var>. This operation is performed on the in-memory copy of the
1550
ini file. if <link id="TIniFile.CacheUpdates">CacheUpdates</link> is
1551
<var>False</var>, then the file is immediatly updated on disk.
1554
<link id="TIniFile.CacheUpdates">CacheUpdates</link>
1558
<!-- argument Visibility: default -->
1559
<element name="TIniFile.DeleteKey.Section">
1560
<short>Section in which to delete key</short>
1563
<!-- argument Visibility: default -->
1564
<element name="TIniFile.DeleteKey.Ident">
1565
<short>Name of key to delete</short>
1568
<!-- procedure Visibility: public -->
1569
<element name="TIniFile.UpdateFile">
1570
<short>Update the file on disk</short>
1572
<var>UpdateFile</var> writes the in-memory data for the ini file to disk.
1573
The whole file is written. If the ini file was instantiated from a stream,
1574
then the stream is updated. Note that the stream must be seekable for this
1575
to work correctly. The ini file is marked as 'clean' after a call to
1576
<var>UpdateFile</var> (i.e. not in need of writing to disk).
1579
If an error occurs when writing to stream or disk, an exception may be
1583
<link id="TIniFile.CacheUpdates">CacheUpdates</link>
1587
<!-- property Visibility: public -->
1588
<element name="TIniFile.Stream">
1589
<short>Stream from which ini file was read</short>
1591
<var>Stream</var> is the stream which was used to create the
1592
<var>IniFile</var>. The <link id="TIniFile.UpdateFile">UpdateFile</link>
1593
method will use this stream to write changes to.
1596
<link id="TIniFile.Create">Create</link>
1597
<link id="TIniFile.UpdateFile">UpdateFile</link>
1601
<!-- property Visibility: public -->
1602
<element name="TIniFile.CacheUpdates">
1603
<short>Should changes be kept in memory</short>
1605
<var>CacheUpdates</var> determines how to deal with changes to the ini-file
1606
data: if set to <var>True</var> then changes are kept in memory till the
1607
file is written to disk with a call to <link id="TIniFile.UpdateFile">UpdateFile</link>.
1608
If it is set to <var>False</var> then each call that changes the data of the
1609
ini-file will result in a call to <var>UpdateFile</var>. This is the default
1610
behaviour, but it may aversely affect performance.
1613
<link id="TIniFile.UpdateFile">UpdateFile</link>
1618
********************************************************************
1619
#fcl.IniFiles.TMemIniFile
1620
********************************************************************
1623
<!-- object Visibility: default -->
1624
<element name="TMemIniFile">
1625
<short>Inifile cached in memory</short>
1627
<var>TMemIniFile</var> is a simple descendent of <link id="TIniFile"/> which
1628
introduces some extra methods to be compatible to the Delphi implementation
1629
of <var>TMemIniFile</var>. The FPC implementation of <var>TIniFile</var> is
1630
implemented as a <var>TMemIniFile</var>, except that <var>TIniFile</var>
1631
does not cache its updates, and <var>TMemIniFile</var> does.
1634
<link id="TIniFile"/>
1635
<link id="TCustomIniFile"/>
1636
<link id="TIniFile.CacheUpdates">CacheUpdates</link>
1640
<!-- constructor Visibility: public -->
1641
<element name="TMemIniFile.Create">
1642
<short>Create a new instance of <var>TMemIniFile</var></short>
1644
<var>Create</var> simply calls the inherited <link
1645
id="TIniFile.Create">Create</link>, and sets the <link
1646
id="TIniFile.CacheUpdates">CacheUpdates</link> to <var>True</var> so updates
1647
will be kept in memory till they are explicitly written to disk.
1650
<link id="TIniFile.Create"/>
1651
<link id="TIniFile.CacheUpdates">CacheUpdates</link>
1655
<!-- argument Visibility: default -->
1656
<element name="TMemIniFile.Create.AFileName">
1657
<short>Name of file to read data from</short>
1660
<!-- argument Visibility: default -->
1661
<element name="TMemIniFile.Create.AEscapeLineFeeds">
1662
<short>Should linefeed escaping be turned on</short>
1665
<!-- procedure Visibility: public -->
1666
<element name="TMemIniFile.Clear">
1667
<short>Clear the data</short>
1669
<var>Clear</var> removes all sections and key/value pairs from memory. If <link
1670
id="TIniFile.CacheUpdates">CacheUpdates</link> is set to <var>False</var>
1671
then the file on disk will immediatly be emptied.
1674
<link id="TMemIniFile.SetStrings">SetStrings</link>
1675
<link id="TMemIniFile.GetStrings">GetStrings</link>
1679
<!-- procedure Visibility: public -->
1680
<element name="TMemIniFile.GetStrings">
1681
<short>Get contents of ini file as stringlist</short>
1684
<var>GetStrings</var> returns the whole contents of the ini file in a single
1685
stringlist, <var>List</var>. This includes comments and empty sections.
1688
The <var>GetStrings</var> call can be used to get data for a call to <link
1689
id="TMemIniFile.SetStrings">SetStrings</link>, which can be used to copy
1690
data between 2 in-memory ini files.
1694
<link id="TMemIniFile.SetStrings">SetStrings</link>
1695
<link id="TMemIniFile.Clear">Clear</link>
1699
<!-- argument Visibility: default -->
1700
<element name="TMemIniFile.GetStrings.List">
1701
<short>Stringlist in which to copy the data</short>
1704
<!-- procedure Visibility: public -->
1705
<element name="TMemIniFile.Rename">
1706
<short>Rename the ini file</short>
1708
<var>Rename</var> will rename the ini file with the new name
1709
<var>AFileName</var>. If <var>Reload</var> is <var>True</var> then the
1710
in-memory contents will be cleared and replaced with the contents
1711
found in <var>AFileName</var>, if it exists. If <var>Reload</var> is
1712
<var>False</var>, the next call to <var>UpdateFile</var> will replace the
1713
contents of <var>AFileName</var> with the in-memory data.
1716
<link id="TIniFile.UpdateFile">UpdateFile</link>
1720
<!-- argument Visibility: default -->
1721
<element name="TMemIniFile.Rename.AFileName">
1722
<short>New filename</short>
1725
<!-- argument Visibility: default -->
1726
<element name="TMemIniFile.Rename.Reload">
1727
<short>Load memory data from new file ?</short>
1730
<!-- procedure Visibility: public -->
1731
<element name="TMemIniFile.SetStrings">
1732
<short>Set data from a stringlist</short>
1735
<var>SetStrings</var> sets the in-memory data from the <var>List</var>
1736
stringlist. The data is first cleared.
1739
The <var>SetStrings</var> call can be used to set the data of the ini file
1740
to a list of strings obtained with <link id="TMemIniFile.GetStrings">GetStrings</link>.
1741
The two calls combined can be used to copy data between 2 in-memory ini files.
1745
<link id="TMemIniFile.GetStrings">GetStrings</link>
1746
<link id="TMemIniFile.Clear">Clear</link>
1750
<!-- argument Visibility: default -->
1751
<element name="TMemIniFile.SetStrings.List">
1752
<short>Stringlist to get data from</short>
1755
</module> <!-- IniFiles -->
1758
</fpdoc-descriptions>