TConfigStorage.ReadProperty procedure
Reads value(s) from a path in the configuration storage into the specified persistent object.
Declaration
procedure ReadProperty(Path: string; Instance: TPersistent;
PropInfo: Pointer; DefInstance: TPersistent=Nil;
OnlyProperty: string='')Arguments
Path | Path where property value(s) are stored in the configuration storage. |
Instance | Persistent object where value(s) read from storage are stored in the method. |
PropInfo | Pointer to the RTTI property information processed in the method. |
DefInstance | Persistent object with the default value(s) for properties processed in the method. |
OnlyProperty | Specifies a single property name to the stored in the method. All properties in PropInfo are stored when omitted (or set to ''). |
Description
ReadProperty is based on the actions performed by the
TReader class in the FPC RTL. Is uses the RTTI property information
passed in the
PropInfo argument to store the property values in
Instance. No actions are performed if the property information does
not have both a getter and a setter routine for the property value.
APath contains the fully-qualified path where value(s) are stored in
the configuration storage.
Instance is the RTTI-enabled persistent object where value(s) read
from the configuration storage are stored in the method.
PropInfo in a pointer to type information for the persistent object
in Instance (and DefInstance). It is used to access each property, and to
convert and store each value from the storage mechanism using RTTI routines.
OnlyProperty contains an optional name for a single property name
handled in the method. When omitted (or set to an empty string), all of the
properties in the type information are read and stored in the properties
starting at the specified path.
DefInstance is a persistent object which contains values to be treated as the default values for the corresponding properties in Instance. If DefInstance is not specified (or contains Nil), the Instance argument is assigned to DefInstance.
ReadProperty handles values for the following type kinds in property type information:
- tkInteger (including integer which have a string identifier)
- tkChar
- tkEnumeration
- tkSet
- tkWChar
- tkFloat
- tkSString
- tkLString
- tkAString
- tkBool
The following type kinds are not explicitly handled in the current LCL version:
- tkWString
- tkInt64
- tkQWord
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
