Class TIniPropStorageHelper

Unit

Declaration

type TIniPropStorageHelper = class helper(TObject) for TIniPropStorage

Description

Tools for handling INI files.

Hierarchy

Overview

Methods

Public function ReadIntSect(const ASection, AKey: string; ADefault: Integer): Integer;
Public function ReadStringSect(const ASection, AKey: string; const ADefault: string): string;
Public function ReadBoolSect(const ASection, AKey: string; ADefault: Boolean): Boolean;
Public function ReadDoubleSect(const ASection, AKey: string; ADefault: Double): Double;
Public function ReadDateTimeSect(const ASection, AKey: string; ADefault: TDateTime): TDateTime;
Public procedure ReadKeysSect(const ASection: string; AList: TStrings);
Public procedure WriteIntSect(const ASection, AKey: string; AValue: Integer);
Public procedure WriteStringSect(const ASection, AKey: string; const AValue: string);
Public procedure WriteBoolSect(const ASection, AKey: string; AValue: Boolean);
Public procedure WriteDoubleSect(const ASection, AKey: string; AValue: Double);
Public procedure WriteDateTimeSect(const ASection, AKey: string; AValue: TDateTime);
Public procedure EraseSect(const ASection: string);

Description

Methods

Public function ReadIntSect(const ASection, AKey: string; ADefault: Integer): Integer;

Reads an integer value from a specific section.

Parameters
ASection
The name of the section [SectionName].
AKey
The key to read.
ADefault
Value returned if the key is missing or an error occurs.
Returns

The integer value or ADefault.

Public function ReadStringSect(const ASection, AKey: string; const ADefault: string): string;

Reads a String value from a specific section.

Parameters
ASection
The name of the section.
AKey
The key to read.
ADefault
Value returned if the key is missing.
Returns

The String value or ADefault.

Public function ReadBoolSect(const ASection, AKey: string; ADefault: Boolean): Boolean;

Reads a boolean value from a specific section.

Parameters
ASection
The name of the section.
AKey
The key to read.
ADefault
Value returned if the key is missing.
Returns

The boolean value or ADefault.

Public function ReadDoubleSect(const ASection, AKey: string; ADefault: Double): Double;

Reads a double precision floating point value from a specific section.

Parameters
ASection
The name of the section.
AKey
The key to read.
ADefault
Value returned if the key is missing or invalid.
Returns

The double value or ADefault.

Public function ReadDateTimeSect(const ASection, AKey: string; ADefault: TDateTime): TDateTime;

Reads a TDateTime value from a specific section.

Parameters
ASection
The name of the section.
AKey
The key to read.
ADefault
Value returned if the key is missing or invalid.
Returns

The TDateTime value or ADefault.

Public procedure ReadKeysSect(const ASection: string; AList: TStrings);

Retrieves all key names within a specific section.

Parameters
ASection
The name of the section to scan.
AList
A TStrings object to be populated with key names.
Public procedure WriteIntSect(const ASection, AKey: string; AValue: Integer);

Writes an integer value to a specific section.

Parameters
ASection
The name of the section.
AKey
The key to write.
AValue
The integer value to store.
Public procedure WriteStringSect(const ASection, AKey: string; const AValue: string);

Writes a String value to a specific section.

Parameters
ASection
The name of the section.
AKey
The key to write.
AValue
The String value to store.
Public procedure WriteBoolSect(const ASection, AKey: string; AValue: Boolean);

Writes a boolean value to a specific section.

Parameters
ASection
The name of the section.
AKey
The key to write.
AValue
The boolean value to store.
Public procedure WriteDoubleSect(const ASection, AKey: string; AValue: Double);

Writes a double precision floating point value to a specific section. Note: Uses FloatToStr to ensure DecimalSeparator consistency.

Parameters
ASection
The name of the section.
AKey
The key to write.
AValue
The double value to store.
Public procedure WriteDateTimeSect(const ASection, AKey: string; AValue: TDateTime);

Writes a TDateTime value to a specific section.

Parameters
ASection
The name of the section.
AKey
The key to write.
AValue
The TDateTime value to store.
Public procedure EraseSect(const ASection: string);

Erases an entire section and all its keys from the storage.

Parameters
ASection
The name of the section to remove.