TJSONDocumentAncestor Class

Definition

Manage documents as JSON files. If you provide a private key they are encrypted with a ??? algorithm.

Delphi
type TJSONDocumentAncestor = class(TDocumentAncestor)
Inheritance
TObject
TJSONDocumentAncestor

Remarks

In your descendants, don't forget to override the methods GetDocumentGUID, GetDocumentExtension and GetPrivateKey

Constants

CJSONDocumentVersion

Version level of this class. It is used to check compatibility between the program and the files it saves or tries to load.

Constructors

Create

Used to create a new instance of this class. It's better to use TDocument.DefaultDocument if you have only one document in your project, but create instances for each document if you want to edit more than one at the same time.

(Inherited from TDocumentAncestor)

Properties

FileName

The FileName for this document (no path, no extension) if opened by LoadFromFile(WithAName) or it has been saved by SaveToFile(WithAName)

(Inherited from TDocumentAncestor)
HasChanged

Returns True if a document parameter has changed since last Clear(), LoadXXX() or SaveXXX()

(Inherited from TDocumentAncestor)
Path

Path to the folder where this document will be saved.

(Inherited from TDocumentAncestor)

Methods

AsJSON

Get the JSON object version of this instance.

Clear

Used to clean current instance and reset all properties and fields to their default values

(Inherited from TDocumentAncestor)
GetDocumentExtension

Returns the file extension for the storrage file of this document.

(Inherited from TDocumentAncestor)
GetDocumentGUID

Returns the unique identifier used in the document jeader to check if the file is compatible with this project.

(Inherited from TDocumentAncestor)
GetEncoding

Returns the encoding format of the JSON document source string

GetPrivateXORKey

Returns the optional key to use to crypt/uncrypt the document file.

IsCrypted

Returns True if this document has a Private XOR Key and should by crypted

LoadFromFile(string)

Load this document from a file.

LoadFromJSONObject(TJSONObject)

Fill this instance from a JSON object.

SaveToFile(string)

Save this document to a file.

SetHasChanged(Boolean) (Inherited from TDocumentAncestor)
ToJSON

Get the JSON source version of this instance.