type TIniFileMode =( ifmRead, ifmWrite );
ifmRead is default mode (means "read" data from ini-file. Set mode to ifmWrite to write data to ini-file, correspondent to TIniFile.
function OpenIniFile( const FileName: KOLString ): PIniFile;
Opens ini file, creating TIniFile object instance to work with it.
TIniFile
TIniFile( unit KOL.pas ) TObj _TObj
TIniFile = object( TObj )
Ini file incapsulation. The main feature is what the same block of read-write operations could be defined (difference must be only in Mode value).
TIniFile properties
property Mode: TIniFileMode;
ifmWrite, if write data to ini-file rather than read it.
property FileName: KOLString;
Ini file name.
property Section: KOLString;
Current ini section.
TIniFile methods
Destructor
function ValueInteger( const Key: KOLString; Value: Integer ): Integer;
Reads or writes integer data value.
function ValueString( const Key: KOLString; const Value: KOLString ): KOLString;
Reads or writes string data value.
function ValueDouble( const Key: KOLString; const Value: Double ): Double;
Reads or writes Double data value.
function ValueBoolean( const Key: KOLString; Value: Boolean ): Boolean;
Reads or writes Boolean data value.
function ValueData( const Key: KOLString; Value: Pointer; Count: Integer ): Boolean;
Reads or writes data from/to buffer. Returns True, if success.
procedure ClearAll;
Clears all sections of ini-file.
Clears current Section of ini-file.
procedure ClearKey( const Key: KOLString );
Clears given key in current section.
procedure GetSectionNames( Names: PKOLStrList );
Retrieves section names, storing it in string list passed as a parameter. String list does not cleared before processing. Section names are added to the end of the string list.
procedure SectionData( Names: PKOLStrList );
Read/write current section content to/from string list. (Depending on current Mode value).