Declaration¶
Source position: inifiles.pp line 231
type
TIniFile = class(TCustomIniFile)
public
constructor Create(const AFileName: string;
AOptions: TIniFileOptions=[]); overload;
constructor Create(AStream: TStream; AOptions: TIniFileOptions=[]); overload;
constructor Create(AStream: TStream; AEscapeLineFeeds: Boolean); overload;
constructor Create(AStream: TStream; ADefaultEncoding: TEncoding;
AOptions: TIniFileOptions=[]);
constructor Create(AStream: TStream; ADefaultEncoding: TEncoding;
AOwnsEncoding: Boolean; AOptions: TIniFileOptions=[]);
destructor Destroy;
function ReadString : string;
procedure WriteString;
procedure ReadSection;
procedure ReadSectionRaw;
procedure ReadSections;
procedure ReadSectionValues; overload;
procedure EraseSection;
procedure DeleteKey;
procedure UpdateFile;
property Stream: TStream; {r}
property CacheUpdates: Boolean; {rw}
property WriteBOM: Boolean; {rw}
end;
Inheritance¶
Description¶
TIniFile is an implementation of TCustomIniFile which does the same as TMemIniFile, namely it reads the whole file into memory. Unlike TMemIniFile it does not cache updates in memory, but immediately writes any changes to disk.
TIniFile introduces no new methods, it just implements the abstract methods introduced in TCustomIniFile
Properties¶
| Member | Visibility | Description |
|---|---|---|
| CacheUpdates | public | Should changes be kept in memory. |
| Stream read only | public | Stream from which ini file was read. |
| WriteBOM | public | Indicates if a Byte Order Mark (BOM) is written at the start of the .INI file. |
Methods¶
| Member | Visibility | Description |
|---|---|---|
| Create | public | Create a new instance of TIniFile. |
| DeleteKey | public | Delete key. |
| Destroy | public | Remove the TIniFile instance from memory. |
| EraseSection | public | |
| ReadSection | public | Read the key names in a section. |
| ReadSectionRaw | public | Read raw section. |
| ReadSections | public | Read section names. |
| ReadSectionValues | public | |
| ReadString | public | Read a string. |
| UpdateFile | public | Update the file on disk. |
| WriteString | public | Write string to file. |
See also¶
| Name | Description |
|---|---|
| TCustomIniFile | Abstract ini file object. |
| TMemIniFile | Inifile cached in memory. |