Skip to content

TIniCollectionItem

Collection item with support for loading/saving from/to ini file.

Declaration

Source position: inicol.pp line 32

type

  TIniCollectionItem = class(TCollectionItem)
  public
    procedure SaveToIni;
    procedure LoadFromIni;
    procedure SaveToFile;
    procedure LoadFromFile;
    property SectionName: string; {rw}
  end;

Description

TIniCollectionItem is a #rtl.classes.tcollectionitem descendent which has some extra methods for saving/loading the item to or from an .ini file.

To use this class, a descendent should be made, and the SaveToIni and LoadFromIni methods should be overridden. They should implement the actual loading and saving. The loading and saving is always initiated by the methods in TIniCollection, TIniCollection.LoadFromIni and TIniCollection.SaveToIni respectively.

Properties

Member Visibility Description
SectionName public Default section name.
See all Properties

Methods

Member Visibility Description
LoadFromFile public Load item from a file.
LoadFromIni public Method called when the item must be loaded.
SaveToFile public Save item to a file.
SaveToIni public Method called when the item must be saved.
See all Methods

See also

Name Description
TIniCollection Collection which can write itself to an .ini file.
TIniCollectionItem.SaveToIni Method called when the item must be saved.
TIniCollectionItem.LoadFromIni Method called when the item must be loaded.
TIniCollection.LoadFromIni Load collection from a file in .ini file format.
TIniCollection.SaveToIni Save the collection to a TCustomIniFile descendent.