Docs: LCL/jsonpropstorage. Updates topic content.

This commit is contained in:
dsiders 2023-10-16 07:41:24 +01:00
parent 28368d3029
commit f9b6339554

View File

@ -1,425 +1,423 @@
<?xml version="1.0" encoding="UTF-8"?>
<fpdoc-descriptions>
<package name="lcl">
<!--
====================================================================
JSONPropStorage
====================================================================
-->
<module name="JSONPropStorage">
<short>
Contains a component that stores Form Session Properties in JSON format.
</short>
<descr>
<p>In this unit you can find an implementation of a name/value pair storage
container in JSON format.</p>
<p>This container will get the Form's Session Properties that you setup in
<p>
In this unit you can find an implementation of a name/value pair storage
container using JSON (JavaScript Object Notation) format.
</p>
<p>
This container will get the Form's Session Properties that you setup in
<link id="#LCL.Forms.TForm">TForm.SessionProperties</link> and read/write
them on the file you specify on <link
id="#LCL.JsonPropStorage.TJSONPropStorage.JSONFileName">TJSONPropStorage.JSONFileName</link>.</p>
them on the file you specify on
<link id="#LCL.JsonPropStorage.TJSONPropStorage.JSONFileName">TJSONPropStorage.JSONFileName
</link>.
</p>
</descr>
<!-- unresolved type reference Visibility: default -->
<element name="Classes">
<short />
<descr />
<seealso />
</element> <!-- unit Classes -->
<!-- unresolved type reference Visibility: default -->
<element name="SysUtils">
<short />
<descr />
<seealso />
</element> <!-- unit SysUtils -->
<!-- unresolved type reference Visibility: default -->
<element name="Forms">
<short />
<descr />
<seealso />
</element> <!-- unit Forms -->
<!-- unresolved type reference Visibility: default -->
<!-- unresolved type references -->
<element name="Classes"/>
<element name="SysUtils"/>
<element name="Forms"/>
<element name="JSONConf">
<short>
This unit contains the implementation of a path/value pair generic container
in JSON format. See package: <url
href="http://wiki.freepascal.org/fcl-json">fcl-json</url>.
in JSON format. See package:
<url href="http://wiki.freepascal.org/fcl-json">fcl-json</url>.
</short>
<descr />
<seealso />
</element> <!-- unit JSONConf -->
</element>
<element name="LazUTF8"/>
<!-- unresolved type reference Visibility: default -->
<element name="LazUTF8">
<short />
<descr />
<seealso />
</element> <!-- unit LazUTF8 -->
<!-- object Visibility: default -->
<element name="TCustomJSONPropStorage">
<short>
Implements the base class for the JSON Form's Session Properties Storage.
Implements the base class used to store session properties to a file in JSON
format.
</short>
<descr />
<errors />
<seealso />
</element> <!-- object TCustomJSONPropStorage -->
<descr>
<p>
<var>TCustomJSONPropStorage</var> is a <var>TFormPropertyStorage</var>
descendant which defines a class used to store session properties for a form or
frame to a file using JSON (JavaScript Object Notation) format. It extends the
ancestor class with properties and methods needed to access the JSON storage
mechanism (TJSONConfig) for the class instance.
</p>
<p>
Use the SessionProperties property in the TForm (or TFrame) instance which owns
the class to define the component and property names written to the JSON
storage mechanism.
</p>
<p>
Use JSONFileName to specify the path and file name to the file where the JSON
content for the session properties is stored.
</p>
<p>
Use RootObjectPath to specify the path to the JSON object where the session
properties is stored in the JSON file.
</p>
<p>
Use Formatted to control whether formatting options for the JSONConfig file are
enabled for the storage mechanism.
</p>
<p>
TCustomJSONPropStorage includes overridden methods used to read, write, and
maintain entries in the JSON storage mechanism.
</p>
<p>
Do not create instances of TCustomJSONPropStorage; use the TJSONPropStorage
descendant instead.
</p>
</descr>
<seealso>
<link id="TJSONPropStorage"/>
<link id="#lcl.forms.TFormPropertyStorage">TFormPropertyStorage</link>
</seealso>
</element>
<!-- variable Visibility: private -->
<element name="TCustomJSONPropStorage.FCount">
<short />
<descr />
<errors />
<seealso />
</element> <!-- variable TCustomJSONPropStorage.FCount -->
<!-- private -->
<element name="TCustomJSONPropStorage.FCount"/>
<element name="TCustomJSONPropStorage.FJSONFileName"/>
<element name="TCustomJSONPropStorage.FRootObjectPath"/>
<element name="TCustomJSONPropStorage.FJSONConf"/>
<element name="TCustomJSONPropStorage.FFormatted"/>
<!-- variable Visibility: private -->
<element name="TCustomJSONPropStorage.FJSONFileName">
<short />
<descr />
<errors />
<seealso />
</element> <!-- variable TCustomJSONPropStorage.FJSONFileName -->
<!-- variable Visibility: private -->
<element name="TCustomJSONPropStorage.FRootObjectPath">
<short />
<descr />
<errors />
<seealso />
</element> <!-- variable TCustomJSONPropStorage.FRootObjectPath -->
<!-- variable Visibility: private -->
<element name="TCustomJSONPropStorage.FJSONConf">
<short />
<descr />
<errors />
<seealso />
</element> <!-- variable TCustomJSONPropStorage.FJSONConf -->
<!-- variable Visibility: private -->
<element name="TCustomJSONPropStorage.FFormatted">
<short />
<descr />
<errors />
<seealso />
</element> <!-- variable TCustomJSONPropStorage.FFormatted -->
<!-- function Visibility: protected -->
<!-- protected -->
<element name="TCustomJSONPropStorage.GetJSONFileName">
<short>
Getter for the property <link
id="#LCL.JsonPropStorage.TCustomJSONPropStorage.JSONFileName">TCustomJSONPropStorage.JSONFileName</link>.
Gets the value for the JSONFileName property.
</short>
<descr />
<errors />
<seealso />
</element> <!-- function TCustomJSONPropStorage.GetJSONFileName -->
<!-- function result Visibility: default -->
<descr/>
<errors/>
<seealso>
<link id="#lcl.jsonpropstorage.TCustomJSONPropStorage.JSONFileName">TCustomJSONPropStorage.JSONFileName</link>
</seealso>
</element>
<element name="TCustomJSONPropStorage.GetJSONFileName.Result">
<short>
The current value of the property <link
id="#LCL.JsonPropStorage.TCustomJSONPropStorage.JSONFileName">TCustomJSONPropStorage.JSONFileName</link>.
Value for the JSONFileName property.
</short>
</element> <!-- function result TCustomJSONPropStorage.GetJSONFileName.Result
-->
</element>
<!-- function Visibility: protected -->
<element name="TCustomJSONPropStorage.RootSection">
<short>Returns the name of the RootSection.</short>
<descr />
<errors />
<seealso />
</element> <!-- function TCustomJSONPropStorage.RootSection -->
<!-- function result Visibility: default -->
<short>
Returns the name of the RootSection for the storage mechanism.
</short>
<descr>
<p>
<var>RootSection</var> is an overridden <var>String</var> function used to
return the section where the JSON content is stored in the JSON file. It
ensures that the value in RootObjectPath is used (when assigned). When omitted,
the inherited method is called to get the JSON object path for components in
the hierarchy for Root.
</p>
<p>
The return value contains the JSON notation for the path name, like:
'TApplication/Form1' or 'TApplication/Frame1'.
</p>
</descr>
<seealso/>
</element>
<element name="TCustomJSONPropStorage.RootSection.Result">
<short>The current value of RootSection.</short>
</element> <!-- function result TCustomJSONPropStorage.RootSection.Result -->
<short>
The current value for the RootSection property.
</short>
</element>
<!-- function Visibility: protected -->
<element name="TCustomJSONPropStorage.GetFormatted">
<short>
Getter for the property <link
id="#LCL.JsonPropStorage.TCustomJSONPropStorage.Formatted">TCustomJSONPropStorage.Formatted</link>.
Gets the value for the Formatted property.
</short>
<descr />
<errors />
<seealso />
</element> <!-- function TCustomJSONPropStorage.GetFormatted -->
<!-- function result Visibility: default -->
<descr/>
<seealso>
<link id="TCustomJSONPropStorage.Formatted"/>
</seealso>
</element>
<element name="TCustomJSONPropStorage.GetFormatted.Result">
<short>
The current value of <link
id="#LCL.JsonPropStorage.TCustomJSONPropStorage.Formatted">TCustomJSONPropStorage.Formatted</link>.
The current value for the Formatted property.
</short>
</element> <!-- function result TCustomJSONPropStorage.GetFormatted.Result -->
</element>
<!-- procedure Visibility: protected -->
<element name="TCustomJSONPropStorage.SetFormatted">
<short>
Setter for the property <link
id="#LCL.JsonPropStorage.TCustomJSONPropStorage.Formatted">TCustomJSONPropStorage.Formatted</link>.
Sets the value for the Formatted property.
</short>
<descr />
<errors />
<seealso />
</element> <!-- procedure TCustomJSONPropStorage.SetFormatted -->
<!-- argument Visibility: default -->
<descr/>
<seealso>
<link id="TCustomJSONPropStorage.Formatted"/>
</seealso>
</element>
<element name="TCustomJSONPropStorage.SetFormatted.Value">
<short>
A <var>Boolean</var> value to set the property <link
id="#LCL.JsonPropStorage.TCustomJSONPropStorage.Formatted">TCustomJSONPropStorage.Formatted</link>.
New <var>Boolean</var> value for the Formatted property.
</short>
</element> <!-- argument TCustomJSONPropStorage.SetFormatted.Value -->
</element>
<!-- function Visibility: protected -->
<element name="TCustomJSONPropStorage.FixPath">
<short>
Turns '.' notation into '/' notation for the XPATH-like <url
href="http://wiki.freepascal.org/fcl-json">JSONConf</url> underlayer.
Converts component/property names using '.' delimiters to the '/' delimiter
used for the JSON notation in the JSONConfig storage mechanism.
</short>
<descr />
<errors />
<seealso />
</element> <!-- function TCustomJSONPropStorage.FixPath -->
<!-- argument Visibility: default -->
<descr>
<p>
<url href="https://lazarus-ccr.sourceforge.io/fpcdoc/fcl/fpjson/index.html">
fpjson Reference
</url>
</p>
<p>
<url href="http://wiki.freepascal.org/fcl-json">
FCL JSON
</url>
</p>
</descr>
<seealso/>
</element>
<element name="TCustomJSONPropStorage.FixPath.aPath">
<short>The path to be fixed.</short>
</element> <!-- argument TCustomJSONPropStorage.FixPath.aPath -->
<!-- function result Visibility: default -->
</element>
<element name="TCustomJSONPropStorage.FixPath.Result">
<short>The fixed path is returned with '.' replaced by '/'.</short>
</element> <!-- function result TCustomJSONPropStorage.FixPath.Result -->
</element>
<!-- property Visibility: protected -->
<element name="TCustomJSONPropStorage.JSONConf">
<short>
Instance of the object that implements a generic path/value pair storage.
TJSONConfig instance used to store path/value pairs.
</short>
<descr />
<errors />
<seealso />
</element> <!-- property TCustomJSONPropStorage.JSONConf -->
<descr>
<p>
<var>JSONConf</var> is a read-only <var>TJSONConfig</var> property which
provides access to the JSON storage mechanism used in the class instance.
</p>
<remark>
JSONConf does not have any of the formatting options assigned in the property.
You must assign values to the FormatOptions property in JSONConf to enable the
feature when Formatted is set to <b>True</b>. You can use the predefined
constant values like AsCompressedJSON or AsCompactJSON.
</remark>
</descr>
<seealso/>
</element>
<!-- procedure Visibility: public -->
<!-- public -->
<element name="TCustomJSONPropStorage.StorageNeeded">
<short>Ask the underlying storage object for an entry.</short>
<descr />
<errors />
<seealso />
</element> <!-- procedure TCustomJSONPropStorage.StorageNeeded -->
<!-- argument Visibility: default -->
<short>
Ensures that the TJSONConfig storage mechanism for the class instance is
allocated and configured when needed.
</short>
<descr>
<p>
Creates the TJSONCOnfig instance in JSONConf if it has not already been
allocated, or when the value in ReadOnly differs from the value used when the
storage mechanism was created. Uses values from Formatted and GetJSONFileName
to configure the JSONConf member. Increments the internal usage counter for the
storage mechanism.
</p>
<p>
StorageNeeded is called from methods like: Save, Restore, SaveProperties,
RestoreProperties, ReadString, WriteString, ReadInteger, WriteInteger, and
EraseSections.
</p>
<p>
See FreeStorage for the actions performed when the JSON storage mechanism in
JSONConf is no longer needed.
</p>
</descr>
<seealso>
<link id="TCustomJSONPropStorage.JSONConf"/>
<link id="TCustomJSONPropStorage.Formatted"/>
<link id="TCustomJSONPropStorage.GetJSONFileName"/>
<link id="TCustomJSONPropStorage.FreeStorage"/>
</seealso>
</element>
<element name="TCustomJSONPropStorage.StorageNeeded.ReadOnly">
<short>If the item is read-only.</short>
</element> <!-- argument TCustomJSONPropStorage.StorageNeeded.ReadOnly -->
<short>
<b>True</b> to create the storage mechanism using read-only permission.
</short>
</element>
<!-- procedure Visibility: public -->
<element name="TCustomJSONPropStorage.FreeStorage">
<short>Frees an entry from the underlying storage object.</short>
<descr />
<errors />
<seealso />
</element> <!-- procedure TCustomJSONPropStorage.FreeStorage -->
<short>
Frees the TJSONConfig storage mechanism when no longer needed.
</short>
<descr>
<p>
Frees the JSON storage mechanism in JSONConf when the internal usage counter
reaches 0 (zero).
</p>
<p>
FreeStorage is called from methods like: Save, Restore, SaveProperties,
RestoreProperties, ReadString, WriteString, ReadInteger, WriteInteger, and
EraseSections.
</p>
<p>
See StorageNeeded for the actions performed when the JSON storage mechanism in
JSONConf is allocated and configured for the class instance.
</p>
</descr>
<seealso>
<link id="TCustomJSONPropStorage.JSONConf"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TCustomJSONPropStorage.DoReadString">
<short>
Implements the actual reading of a value from the underlying storage
container.
Performs actions needed to read the value for the specified section and
identifier as a String type.
</short>
<descr />
<errors />
<seealso />
</element> <!-- fucntion TCustomJSONPropStorage.DoReadString -->
<!-- argument Visibility: default -->
<descr>
<p>
DoReadString is an overridden String function used to implement the ReadString
method in TCustomPropertyStorage ancestor.
</p>
</descr>
<errors/>
<seealso/>
</element>
<element name="TCustomJSONPropStorage.DoReadString.Section">
<short>The section to be read.</short>
</element> <!-- argument TCustomJSONPropStorage.DoReadString.Section -->
<!-- argument Visibility: default -->
<short>The section to be read in the method.</short>
</element>
<element name="TCustomJSONPropStorage.DoReadString.Ident">
<short>The ident to be read.</short>
</element> <!-- argument TCustomJSONPropStorage.StorageNeeded.Ident -->
<!-- argument Visibility: default -->
<short>The identifier to be read in the method.</short>
</element>
<element name="TCustomJSONPropStorage.DoReadString.Default">
<short>If has no value then return this as default.</short>
</element> <!-- argument TCustomJSONPropStorage.DoReadString.Default -->
<!-- function result Visibility: default -->
<short>
Default value returned for the specified section and identifier when either the
section or identifer was not found in JSONConf.
</short>
</element>
<element name="TCustomJSONPropStorage.DoReadString.Result">
<short>The value of the section/ident requested.</short>
</element> <!-- function result TCustomJSONPropStorage.DoReadString.Result -->
<short>Returns the value for the section/ident requested.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TCustomJSONPropStorage.DoWriteString">
<short>
Implements the actual writing of a value from the underlying storage
container.
</short>
<descr />
<errors />
<seealso />
</element> <!-- procedure TCustomJSONPropStorage.DoWriteString -->
<!-- argument Visibility: default -->
<descr>
<p>
DoWriteString is an overridden method used to implement the WriteString
method in TCustomPropertyStorage ancestor.
</p>
</descr>
<errors/>
<seealso/>
</element>
<element name="TCustomJSONPropStorage.DoWriteString.Section">
<short>The section to be written.</short>
</element> <!-- argument TCustomJSONPropStorage.DoWriteString.Section -->
<!-- argument Visibility: default -->
</element>
<element name="TCustomJSONPropStorage.DoWriteString.Ident">
<short>The ident to be written.</short>
</element> <!-- argument TCustomJSONPropStorage.DoWriteString.Ident -->
<!-- argument Visibility: default -->
</element>
<element name="TCustomJSONPropStorage.DoWriteString.Value">
<short>The value to be written.</short>
</element> <!-- argument TCustomJSONPropStorage.DoWriteString.Value -->
</element>
<!-- procedure Visibility: public -->
<element name="TCustomJSONPropStorage.DoEraseSections">
<short>Erases a section from the underlying storage container.</short>
<descr />
<errors />
<seealso />
</element> <!-- procedure TCustomJSONPropStorage.DoEraseSections -->
<!-- argument Visibility: default -->
<descr/>
<errors/>
<seealso/>
</element>
<element name="TCustomJSONPropStorage.DoEraseSections.ARootObjectPath">
<short>The path to the section that will be erased.</short>
</element> <!-- argument
TCustomJSONPropStorage.DoEraseSections.ARootObjectPath -->
</element>
<!-- property Visibility: public -->
<element name="TCustomJSONPropStorage.JSONFileName">
<short>
Name of the file where the property data is saved in JSON format.
Name of the file where the session property names and values are saved in JSON
format.
</short>
<descr />
<errors />
<seealso />
</element> <!-- property TCustomJSONPropStorage.JSONFileName -->
<descr/>
<errors/>
<seealso/>
</element>
<!-- property Visibility: public -->
<element name="TCustomJSONPropStorage.RootObjectPath">
<short>Name of the root object path on your JSON file.</short>
<descr />
<errors />
<seealso />
</element> <!-- property TCustomJSONPropStorage.RootObjectPath -->
<short>
Name of the root JSON object in the JSON file.
</short>
<descr/>
<errors/>
<seealso/>
</element>
<!-- property Visibility: public -->
<element name="TCustomJSONPropStorage.Formatted">
<short>This determines if the JSON is to be formatted or not.</short>
<descr />
<errors />
<seealso />
</element> <!-- property TCustomJSONPropStorage.Formatted -->
<short>
Controls whether formatted JSON is emitted in the JSONConf storage mechanism.
</short>
<descr/>
<errors/>
<seealso/>
</element>
<!-- object Visibility: default -->
<element name="TJSONPropStorage">
<short>
Implements the final class for the JSON Form Session Properties storage.
</short>
<descr />
<errors />
<descr>
<p>
<var>TJSONPropStorage</var> is a <var>TCustomJSONPropStorage</var>
descendant which implements a class used to store session properties for a form
or frame to a file using JSON (JavaScript Object Notation) format. It sets the
visibility for properties introduced in ancestor classes.
</p>
<p>
Use the SessionProperties property in the TForm (or TFrame) instance which owns
the class to define the component and property names written to the JSON
storage mechanism.
</p>
<p>
Use JSONFileName to specify the path and file name to the file where the JSON
content for the session properties is stored.
</p>
<p>
Use RootObjectPath to specify the path to the JSON object where the session
properties is stored in the JSON file.
</p>
<p>
Use Formatted to control whether formatting options for the JSON config file
are enabled for the storage mechanism.
</p>
</descr>
<seealso>
<link id="#LCL.Forms.TForm">TForm.SessionProperties</link>
<link id="#LCL.INIPropStorage.TINIPropStorage">TINIPropStorage</link>
<link id="#LCL.XMLPropStorage.TXMLPropStorage">TXMLPropStorage</link>
<link id="TCustomJSONPropStorage"/>
<link id="#lcl.forms.TForm">TForm.SessionProperties</link>
<link id="#lcl.inipropstorage.TINIPropStorage">TINIPropStorage</link>
<link id="#lcl.xmlpropstorage.TXMLPropStorage">TXMLPropStorage</link>
</seealso>
</element> <!-- object TJSONPropStorage -->
</element>
<!-- property Visibility: published -->
<element name="TJSONPropStorage.StoredValues" link="#LCL.PropertyStorage.TCustomPropertyStorage.StoredValues">
<short />
<descr />
<errors />
<seealso />
</element> <!-- property TJSONPropStorage.StoredValues -->
<!-- published -->
<element name="TJSONPropStorage.StoredValues" link="#lcl.propertystorage.TCustomPropertyStorage.StoredValues"/>
<element name="TJSONPropStorage.JSONFileName" link="#lcl.jsonpropstorage.TCustomJSONPropStorage.JSONFileName"/>
<element name="TJSONPropStorage.Formatted" link="#lcl.jsonpropstorage.TCustomJSONPropStorage.Formatted"/>
<element name="TJSONPropStorage.Active" link="#LCL.PropertyStorage.TCustomPropertyStorage.Active"/>
<element name="TJSONPropStorage.OnSavingProperties" link="#LCL.PropertyStorage.TCustomPropertyStorage.OnSavingProperties"/>
<element name="TJSONPropStorage.OnSaveProperties" link="#LCL.PropertyStorage.TCustomPropertyStorage.OnSaveProperties"/>
<element name="TJSONPropStorage.OnRestoringProperties" link="#LCL.PropertyStorage.TCustomPropertyStorage.OnRestoringProperties"/>
<element name="TJSONPropStorage.OnRestoreProperties" link="#LCL.PropertyStorage.TCustomPropertyStorage.OnRestoreProperties"/>
<!-- property Visibility: published -->
<element name="TJSONPropStorage.JSONFileName" link="#LCL.JsonPropStorage.TCustomJSONPropStorage.JSONFileName">
<short />
<descr />
<errors />
<seealso />
</element> <!-- property TJSONPropStorage.JSONFileName -->
<!-- property Visibility: published -->
<element name="TJSONPropStorage.Formatted" link="#LCL.JsonPropStorage.TCustomJSONPropStorage.Formatted">
<short />
<descr />
<errors />
<seealso />
</element> <!-- property TJSONPropStorage.StoredValues -->
<!-- property Visibility: published -->
<element name="TJSONPropStorage.Active" link="#LCL.PropertyStorage.TCustomPropertyStorage.Active">
<short />
<descr />
<errors />
<seealso />
</element> <!-- property TJSONPropStorage.Active -->
<!-- property Visibility: published -->
<element name="TJSONPropStorage.OnSavingProperties" link="#LCL.PropertyStorage.TCustomPropertyStorage.OnSavingProperties">
<short />
<descr />
<errors />
<seealso />
</element> <!-- property TJSONPropStorage.OnSavingProperties -->
<!-- property Visibility: published -->
<element name="TJSONPropStorage.OnSaveProperties" link="#LCL.PropertyStorage.TCustomPropertyStorage.OnSaveProperties">
<short />
<descr />
<errors />
<seealso />
</element> <!-- property TJSONPropStorage.OnSaveProperties -->
<!-- property Visibility: published -->
<element name="TJSONPropStorage.OnRestoringProperties" link="#LCL.PropertyStorage.TCustomPropertyStorage.OnRestoringProperties">
<short />
<descr />
<errors />
<seealso />
</element> <!-- property TJSONPropStorage.OnRestoringProperties -->
<!-- property Visibility: published -->
<element name="TJSONPropStorage.OnRestoreProperties" link="#LCL.PropertyStorage.TCustomPropertyStorage.OnRestoreProperties">
<short />
<descr />
<errors />
<seealso />
</element> <!-- property TJSONPropStorage.OnRestoreProperties -->
<!-- procedure Visibility: default -->
<element name="Register">
<short>
Registers <link
id="#LCL.JsonPropStorage.TJSONPropStorage">TJSONPropStorage</link> on the
Registers
<link id="#LCL.JsonPropStorage.TJSONPropStorage">TJSONPropStorage</link> on the
'Misc' tab of the component palette.
</short>
<descr />
<errors />
<seealso />
</element> <!-- procedure Register -->
<descr/>
<errors/>
<seealso/>
</element>
</module> <!-- module JSONPropStorage -->
</package> <!-- package lcl -->
</module>
<!-- JSONPropStorage -->
</package>
</fpdoc-descriptions>