[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'rttiutils' (#fcl)

TPropsStorage

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Property storage mechanism

Declaration

Source position: rttiutils.pp line 66

type TPropsStorage = class(TObject)

protected

  function ReadString(); virtual;

  procedure WriteString(); virtual;

  procedure EraseSection(); virtual;

  function GetItemName(); virtual;

  function CreateStorage; virtual;

public

  procedure StoreAnyProperty();

  

Store a property value

  procedure LoadAnyProperty();

  

Load a property value

  procedure StoreProperties();

  

Store a list of properties

  procedure LoadProperties();

  

Load a list of properties

  procedure LoadObjectsProps();

  

Load a list of component properties

  procedure StoreObjectsProps();

  

Store a list of component properties

  property AObject: TObject; [rw]

  

Object to load or store properties from

  property Prefix: String; [rw]

  

Prefix to use in storage

  property Section: String; [rw]

  

Section name for storage

  property OnReadString: TReadStrEvent; [rw]

  

Read a string value from storage

  property OnWriteString: TWriteStrEvent; [rw]

  

Write a string value to storage

  property OnEraseSection: TEraseSectEvent; [rw]

  

Erase a section in storage

end;

Inheritance

TPropsStorage

  

Property storage mechanism

|

TObject

Description

TPropsStorage provides a mechanism to store properties from any class which has published properties (usually a TPersistent descendent) in a storage mechanism.

TPropsStorage does not handle the storage by itself, instead, the storage is handled through a series of callbacks to read and/or write strings. Conversion of property types to string is handled by TPropsStorage itself: all that needs to be done is set the 3 handlers. The storage mechanism is assumed to have the structure of an .ini file : sections with key/value pairs. The three callbacks should take this into account, but they do not need to create an actual .ini file.

See also

TPropInfoList

  

Class for keeping property information

The latest version of this document can be found at lazarus-ccr.sourceforge.net.