diff --git a/docs/xml/lazutils/lazconfigstorage.xml b/docs/xml/lazutils/lazconfigstorage.xml index 342e26381f..114ae1bd98 100644 --- a/docs/xml/lazutils/lazconfigstorage.xml +++ b/docs/xml/lazutils/lazconfigstorage.xml @@ -71,7 +71,8 @@ in the class, like:
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. +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
@@ -94,7 +95,8 @@ TConfigMemStorage or TXMLConfigStorage.
@@ -118,7 +120,8 @@ Value in the configuration storage for the specified value type.
+SetFullPathValue is an overloaded abstract virtual method in
+TConfigStorage. It must be overridden in a descendent class to use
+the node notation required for the underlying storage mechanism.
+
+SetFullPathValue is called from the SetValue method after ExtendPath has been
+called to include the CurrentBasePath value at the start of the node path in
+APath.
+
+SetDeleteFullPathValue is an overloaded abstract virtual method in
+TConfigStorage. It must be overridden and implemented in a
+descendent class to use the node notation required for the underlying storage
+mechanism.
+
+Overloaded variants of the method allow the AValue and DefValue arguments to be
+passed as either String, Integer, or Boolean types. Both arguments must use the
+same type. The arguments determine whether the node is removed or updated with
+a default value in the storage mechanism. When both arguments have the same
+value, the node at APath is deleted from the storage. Otherwise, the value in
+DefValue is stored for the specified node.
+
+SetDeleteFullPathValue is called from the SetDeleteValue method after
+ExtendPath has been called to include the CurrentBasePath value at the start of
+the node path in APath.
+
+DeleteFullPath is an abstract virtual method in
+TConfigStorage. It must be implemented in a descendent class to
+perform actions needed to remove the specified node from the storage mechanism
+for the class instance.
+
+DeleteFullPath always physically removes the node at the specified path. Use
+SetDeleteFullPathValue to update or remove a node using a value and default
+value.
+
+DeleteFullPath is used to implement the DeletePath method.
+
+DeleteFullPathValue is an abstract virtual method in
+TConfigStorage used to delete the node with the path name specified
+in APath. It must be implemented in a descendent class to access the
+storage mechanism for the derived class instance.
+
+DeleteFullPathValue is used to implement the DeleteValue method.
+
+WriteProperty is based on the actions performed by the
+TWriter class in the FPC RTL. Is uses the RTTI property information
+passed in the PropInfo argument to access each of the properties in Instance.
+No actions are performed for a given property if it does not provide 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 with the value(s)
+retrieved and written 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 in the storage mechanism by calling the SetValue
+method.
+
+OnlyProperty contains an optional name for a single property name
+stored in the method. When omitted (or set to an empty string), all of the
+properties in the type information are stored starting at the specified path
+using the Name for the property type as an identifier.
+
+DefInstance is a persistent object which contains values to be treated as the
+default values for the corresponding properties in Instance. When a property
+has the same value in both Instance and DefInstance, it is deleted from the
+configuration storage. DefInstance can be Nil - but default property
+values cannot be determined when omitted.
+
+WriteProperty handles values for the following type kinds in property type
+information:
+
+The following type kinds are not explicitly handled in the current LCL
+version:
+
+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:
+
+The following type kinds are not explicitly handled in the current LCL
+version:
+
+GetValue is an overloaded method in TConfigStorage. The
+overloaded variants allow the value read from the specified path in the
+configuration storage to be returned as one of the following types:
+
+ADefault contains the default value returned if a value is not found
+in the storage for the specified path. The argument uses the same type as the
+return value for the overloaded methods.
+
+GetValue calls GetFullPathValue after using ExtendPath to insert the value
+CurrentBasePath at the start of the value in APath. The value in ADefault
+is passed to GetFullPathValue as the default value.
+
+SetValue is an overloaded method in TConfigStorage used
+to store the value specified in the AValue argument to the node path
+in APath. The overloaded variants allow AValue to be specified using
+String, Integer, Boolean, TRect, or TPoint types.
+
+APath contains the node path where the value is stored in the storage
+mechanism. SetValue calls the ExtendPath method to include the value in
+CurrentBasePath prior to the specified node path.
+
+The SetFullPathValue method is called to store AValue to the underlying storage
+mechanism. Overloads for TRect and TPoint are decomposed and stored as the
+members values for the types. For TRect: Left, Top, Right, and Bottom are
+stored. For TPoint: X and Y are stored.
+
+Use GetValue to read a stored value for a specified node path.
+
+SetDeleteValue is an overloaded method in TConfigStorage.
+The variants allow the method to be used to store a value using either a
+String, Integer, Boolean, TRect, or TPoint type in the AValue
+argument.
+
+APath is the path to the node where the value is stored. It is
+specified with a value relative to the CurrentBasePath property. ExtendPath is
+called to insert CurrentBasePath at the start of the node path.
+
+DefValue contains the value treated as the default value for the
+node path. The overloaded variants use the same type as specified in the AValue
+argument.
+
+SetDeleteValue calls the SetDeleteFullPathValue method to update or remove the
+value at the specified path. When DefValue is equal to AValue, the node path in
+APath to be removed from the configuration storage.
+
+Calls ExtendPath to resolve APath to the CurrentBasePath for the storage. Calls
+DeleteFullPath to remove the resolved path to the storage node.
+
+Calls ExtendPath to resolve APath to the CurrentBasePath for the storage. Calls
+DeleteFullPathValue to remove value for the resolved node path.
+
+CurrentBasePath is a read-only String property. Its value
+is updated when the AppendBasePath and UndoAppendBasePath methods are called in
+the class instance. The value is used when the ExtendPath method is called to
+resolve a relative node path to its location in the storage mechanism.
+
+Inserts the value in CurrentBasePath as a prefix for the value in APath.
+
+AppendBasePath is a method used to append the relative path
+specified for a node in Path to the value in the CurrentBasePath property.
+AppendBasePath ensures that a trailing path delimiter ('/') is appended to the
+value in CurrentBasePath when it not empty and does not already include the
+delimiter.
+
+Use UndoAppendBasePath to remove a path node from the value in CurrentBasePath.
+
+WriteToDisk is an abstract virtual method in
+TConfigStorage. It must be implemented in a descendent class to
+perform actions needed to store values to the mechanism used in a derived class.
+
+GetFileName is an abstract virtual String function in TConfigStorage. It is used to retrieve the file name where configuration
+data is stored when the WriteToDisk method is called. It must be implemented in
+a descendent class which uses a file as the destination for the storage
+mechanism.
+
+
+
+
+
+
+
+
+
+
+
Use the OnlyProperty argument to specify the name for a single
@@ -485,9 +918,15 @@ Name for a single property value read and stored in Obj.
+TConfigStorageClass is the type used for the DefaultConfigClass variable in the
+Lazarus IDE.
+
-Create is the constructor for the class instance. It initializes values in the Parent and Name properties to the arguments passed to the constructor.
+Create is the constructor for the class instance. It initializes
+values in the Parent and Name properties to the arguments passed to the
+constructor.
+DeleteFullPath is an overridden method in
+TConfigMemStorage. It must be implemented in a descendent class to
+perform actions needed to remove the specified node from the storage mechanism
+for the class instance. It calls a private method used to search nodes in the
+memory-based storage for the specified node path. When found, the node is
+removed.
+
+DeleteFullPath is called from the DeletePath method.
+
+GetFullPathValue is an overloaded method in
+TConfigMemStorage. It implements the abstract virtual methods
+defined in the TConfigStorage ancestor. The variants allow the value in
+ADefault to specified as either a String, Integer, or Boolean type.
+Please note that TRect and TPoint are not handled in TConfigMemStorage.
+
+SetDeleteFullPathValue is an overloaded overridden method in
+TConfigMemStorage. Overloaded variants of the method allow the
+AValue and DefValue arguments to be passed as either String, Integer, or
+Boolean types. Both arguments must use the same type. The arguments determine
+whether the node is removed or updated with a default value in the storage
+mechanism. When both arguments have the same value, the node at APath is
+deleted from the storage. Otherwise, the value in DefValue is stored for the
+specified node.
+
+SetDeleteFullPathValue is called from the SetDeleteValue method after
+ExtendPath has been called to include the CurrentBasePath value at the start of
+the node path in APath.
+
+SetFullPathValue is an overloaded method in
+TConfigStorage. It implements the abstract virtual method introduced
+in the TConfigStorage ancestor. The overloaded variants convert
+AValue to a String type (when needed) and stores the value in a
+memory-based configuration node with the fully-qualified path specified in
+APath.
+
+SetFullPathValue is called from the SetValue method after ExtendPath has been
+called to include the CurrentBasePath value at the start of the node path in
+APath.
+
+Root is a TConfigMemStorageNode member with the root node
+for the storage. The node is created (when needed) when a value is stored to
+the memory-based configuration storage, and freed when the class instance is
+destroyed. Nodes in the storage are accessed starting at the Root node, and
+navigated by accessing the child nodes recursively. The node path reflects the
+hierarchy of nodes accessed to reach a specific node.
+
+SaveStringToStringTree is a routine used to save values found in the
+specified Tree structure to a TConfigStorage instance under the specified path.
+