Sign in Join
FPDoc Onlineexperiment

TConfigStorage class

In unit LazConfigStorage

Defines the base class for a configuration storage mechanism.

Declaration

pascal
TConfigStorage = class

Descends from it: TConfigMemStorage TXMLConfigStorage

Description

TConfigStorage is a class used to create and maintain configuration information using an XML-based storage format. TConfigStorage is a base class; it contains abstract virtual methods which must be implemented in descendent class to provide memory- or file-based storage for its values.

TConfigStorage and descendent classes have a base path where its data is stored, and sub-paths and values for the data items in the storage. Path information uses an XPath-like notation which indicates where a given value is stored, and the name associated with the stored value.

For example:

'path/to/loginform'
'path/to/loginform/top'
'path/to/loginform/left'
'path/to/loginform/width'
'path/to/loginform/height'

Values can be specified using one of the native Pascal data types supported in the class, like:

  • String
  • Integer
  • Boolean
  • TStrings
  • TRect
  • TPoint
  • TPersistent

Methods are provided to get, set, or delete stored items using their path notation. Methods are also provided to read or write published property values to or from persistent objects using RTTI.

Do not create instances of TConfigStorage. Use of the descendent classes like TConfigMemStorage or TXMLConfigStorage.

See also

Properties

CurrentBasePathpublicContains the base node path where values are read or written in the storage mechanism.

Methods

GetFullPathValueprotectedSpecifies a method used to get a value or its default from the specified fully-qualified path.
SetFullPathValueprotectedDefines the method used to resolve the specified node path prior to storing the specified value.
SetDeleteFullPathValueprotectedDefines the method used to delete the specified node path or to reset it to a default value.
DeleteFullPathprotectedDefines the method used to remove the node at the specified path from the configuration storage.
DeleteFullPathValueprotectedDefines the method used to delete the node with the specified full path name from the configuration storage.
WritePropertyprotectedStores one or more property values from an RTTI-enabled persistent object to the specified path in the configuration storage.
ReadPropertyprotectedReads value(s) from a path in the configuration storage into the specified persistent object.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
ClearpublicClears the content in the configuration storage.
GetValuepublicGets the value stored at the specified path relative to the base path in the configuration storage.
SetValuepublicStores a value at the specified path in the configuration storage.
SetDeleteValuepublicUpdates the value for the specified node path, or deletes it when it contains a default value.
DeletePathpublicRemoves the configuration storage node with the specified path.
DeleteValuepublicDeletes the value stored for the specified path.
ExtendPathpublicResolves a relative node path to the current base path for the storage mechanism.
AppendBasePathpublicAppends the specified relative path to the existing value in CurrentBasePath.
UndoAppendBasePathpublicRemoves the last node path from the value in CurrentBasePath.
WriteToDiskpublicDefines the method used to flush the values in the configuration storage to the underlying storage mechanism.
GetFilenamepublicDefines the method used to get the file name where configuration data is stored.
WriteObjectpublicStores property names and values in the specified object to the configuration storage.
ReadObjectpublicReads names and values from the configuration storage into properties for the specified object instance.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.