[Overview][Classes][Procedures and functions][Index] Reference for unit 'JSONPropStorage' (#lcl)

TCustomJSONPropStorage

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements the base class used to store session properties to a file in JSON format.

Declaration

Source position: jsonpropstorage.pas line 21

type TCustomJSONPropStorage = class(TFormPropertyStorage)

protected

  function GetJSONFileName; virtual;

  

Gets the value for the JSONFileName property.

  function RootSection; override;

  

Returns the name of the RootSection for the storage mechanism.

  function GetFormatted;

  

Gets the value for the Formatted property.

  procedure SetFormatted();

  

Sets the value for the Formatted property.

  function FixPath(); virtual;

  

Converts component/property names using '.' delimiters to the '/' delimiter used for the JSON notation in the JSONConfig storage mechanism.

  property JSONConf: TJSONConfig; [r]

  

TJSONConfig instance used to store path/value pairs.

public

  procedure StorageNeeded(); override;

  

Ensures that the TJSONConfig storage mechanism for the class instance is allocated and configured when needed.

  procedure FreeStorage; override;

  

Frees the TJSONConfig storage mechanism when no longer needed.

  function DoReadString(); override;

  

Performs actions needed to read the value for the specified section and identifier as a String type.

  procedure DoWriteString(); override;

  

Performs actions needed to write the specified Section and Ident to the JSON storage mechanism as a String type.

  procedure DoEraseSections(); override;

  

Performs actions needed to remove the entry (and all of its child entries) at the specified path in the JSON storage.

  property JSONFileName: string; [rw]

  

Name of the file where the session property names and values are saved in JSON format.

  property RootObjectPath: string; [rw]

  

Name of the root JSON object in the JSON file where session properties are stored.

  property Formatted: Boolean; [rw]

  

Controls whether formatted JSON is emitted in the JSONConf storage mechanism.

end;

Inheritance

TCustomJSONPropStorage

  

Implements the base class used to store session properties to a file in JSON format.

|

TFormPropertyStorage

  

TFormPropertyStorage - class for storage of a Form's properties.

|

TControlPropertyStorage

  

Implements the abstract ancestor class used to get the property list for a control.

|

TCustomPropertyStorage

  

Defines a container used to Save and Restore property values.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

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.

See also

TJSONPropStorage

  

Implements the final class for the JSON Form Session Properties storage.

TFormPropertyStorage

  

TFormPropertyStorage - class for storage of a Form's properties.


Version 3.2 Generated 2024-02-25 Home