diff --git a/docs/xml/lcl/jsonpropstorage.xml b/docs/xml/lcl/jsonpropstorage.xml index 9e5266b8d3..4d3885a7a0 100644 --- a/docs/xml/lcl/jsonpropstorage.xml +++ b/docs/xml/lcl/jsonpropstorage.xml @@ -1,425 +1,423 @@ - - Contains a component that stores Form Session Properties in JSON format. -

In this unit you can find an implementation of a name/value pair storage -container in JSON format.

-

This container will get the Form's Session Properties that you setup in +

+In this unit you can find an implementation of a name/value pair storage +container using JSON (JavaScript Object Notation) format. +

+

+This container will get the Form's Session Properties that you setup in TForm.SessionProperties and read/write -them on the file you specify on TJSONPropStorage.JSONFileName.

+them on the file you specify on +TJSONPropStorage.JSONFileName +. +

- - - - - - - - - - - - - - - - - - - - - - + + + + This unit contains the implementation of a path/value pair generic container -in JSON format. See package: fcl-json. +in JSON format. See package: +fcl-json. - - - + + - - - - - - - - -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. - - - - + +

+TCustomJSONPropStorage is a TFormPropertyStorage +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. +

+

+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. +

+

+Use JSONFileName to specify the path and file name to the file where the JSON +content for the session properties is stored. +

+

+Use RootObjectPath to specify the path to the JSON object where the session +properties is stored in the JSON file. +

+

+Use Formatted to control whether formatting options for the JSONConfig file are +enabled for the storage mechanism. +

+

+TCustomJSONPropStorage includes overridden methods used to read, write, and +maintain entries in the JSON storage mechanism. +

+

+Do not create instances of TCustomJSONPropStorage; use the TJSONPropStorage +descendant instead. +

+
+ + +TFormPropertyStorage + +
- - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + -Getter for the property TCustomJSONPropStorage.JSONFileName. +Gets the value for the JSONFileName property. - - - - - - + + + +TCustomJSONPropStorage.JSONFileName + + -The current value of the property TCustomJSONPropStorage.JSONFileName. +Value for the JSONFileName property. - + - -Returns the name of the RootSection. - - - - - - + +Returns the name of the RootSection for the storage mechanism. + + +

+RootSection is an overridden String 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. +

+

+The return value contains the JSON notation for the path name, like: +'TApplication/Form1' or 'TApplication/Frame1'. +

+
+ +
-The current value of RootSection. - + +The current value for the RootSection property. + +
- -Getter for the property TCustomJSONPropStorage.Formatted. +Gets the value for the Formatted property. - - - - - - + + + + +
-The current value of TCustomJSONPropStorage.Formatted. +The current value for the Formatted property. - +
- -Setter for the property TCustomJSONPropStorage.Formatted. +Sets the value for the Formatted property. - - - - - - + + + + +
-A Boolean value to set the property TCustomJSONPropStorage.Formatted. +New Boolean value for the Formatted property. - + - -Turns '.' notation into '/' notation for the XPATH-like JSONConf underlayer. +Converts component/property names using '.' delimiters to the '/' delimiter +used for the JSON notation in the JSONConfig storage mechanism. - - - - - - + +

+ +fpjson Reference + +

+

+ +FCL JSON + +

+
+ + The path to be fixed. - - - + The fixed path is returned with '.' replaced by '/'. - + - -Instance of the object that implements a generic path/value pair storage. +TJSONConfig instance used to store path/value pairs. - - - - + +

+JSONConf is a read-only TJSONConfig property which +provides access to the JSON storage mechanism used in the class instance. +

+ +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 True. You can use the predefined +constant values like AsCompressedJSON or AsCompactJSON. + +
+ + - + -Ask the underlying storage object for an entry. - - - - - - + +Ensures that the TJSONConfig storage mechanism for the class instance is +allocated and configured when needed. + + +

+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. +

+

+StorageNeeded is called from methods like: Save, Restore, SaveProperties, +RestoreProperties, ReadString, WriteString, ReadInteger, WriteInteger, and +EraseSections. +

+

+See FreeStorage for the actions performed when the JSON storage mechanism in +JSONConf is no longer needed. +

+
+ + + + + + + -If the item is read-only. - + +True to create the storage mechanism using read-only permission. + + - -Frees an entry from the underlying storage object. - - - - + +Frees the TJSONConfig storage mechanism when no longer needed. + + +

+Frees the JSON storage mechanism in JSONConf when the internal usage counter +reaches 0 (zero). +

+

+FreeStorage is called from methods like: Save, Restore, SaveProperties, +RestoreProperties, ReadString, WriteString, ReadInteger, WriteInteger, and +EraseSections. +

+

+See StorageNeeded for the actions performed when the JSON storage mechanism in +JSONConf is allocated and configured for the class instance. +

+
+ + + + - -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. - - - - - - + +

+DoReadString is an overridden String function used to implement the ReadString +method in TCustomPropertyStorage ancestor. +

+
+ + + -The section to be read. - - - +The section to be read in the method. + -The ident to be read. - - - +The identifier to be read in the method. + -If has no value then return this as default. - - - + +Default value returned for the specified section and identifier when either the +section or identifer was not found in JSONConf. + + -The value of the section/ident requested. - +Returns the value for the section/ident requested. + - Implements the actual writing of a value from the underlying storage container. - - - - - - + +

+DoWriteString is an overridden method used to implement the WriteString +method in TCustomPropertyStorage ancestor. +

+
+ + + The section to be written. - - - + The ident to be written. - - - + The value to be written. - + - Erases a section from the underlying storage container. - - - - - - + + + + The path to the section that will be erased. - + - -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. - - - - + + + + - -Name of the root object path on your JSON file. - - - - + +Name of the root JSON object in the JSON file. + + + + + - -This determines if the JSON is to be formatted or not. - - - - + +Controls whether formatted JSON is emitted in the JSONConf storage mechanism. + + + + + - Implements the final class for the JSON Form Session Properties storage. - - + +

+TJSONPropStorage is a TCustomJSONPropStorage +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. +

+

+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. +

+

+Use JSONFileName to specify the path and file name to the file where the JSON +content for the session properties is stored. +

+

+Use RootObjectPath to specify the path to the JSON object where the session +properties is stored in the JSON file. +

+

+Use Formatted to control whether formatting options for the JSON config file +are enabled for the storage mechanism. +

+
-TForm.SessionProperties -TINIPropStorage -TXMLPropStorage + +TForm.SessionProperties +TINIPropStorage +TXMLPropStorage -
+ - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Registers TJSONPropStorage on the +Registers +TJSONPropStorage on the 'Misc' tab of the component palette. - - - - + + + + -
-
+ + +