TParamsFile Class

TParamsFile work as an instance of a settings file. You can have more than one instance for more than 1 settings file.

Unit: Olf.RTL.Params
System.JSON.TObject
  Olf.RTL.Params.TParamsFile
type TParamsFile = class(TObject)

The TParamsFile type exposes the following members.

Show:
 NameDescription
Create

Overloaded. Class constructor wich loads the parameter file specified as parameter.

Create

Overloaded. Class constructor wich just initialize private fields.

Destroy

Instance destructor

Top
Show:
 NameDescription
PortableMode

Portable mode : if true nothing is saved nor loaded. Default value is false.

onAfterLoadEvent

Called after loading the settings file

onAfterLoadProc

onAfterSaveEvent

Called after saving the settings file

onAfterSaveProc

onBeforeLoadEvent

Called before loading the settings file.

onBeforeLoadProc

onBeforeSaveEvent

Called before saving the settings file

onBeforeSaveProc

onCryptEvent

Called before saving the parameters in a file (and after onBeforeSave). If crypted, the file is saved as a binary format. If uncrypted, the file is saved as a JSON text file.

onCryptProc

onDecryptEvent

Called after loading the parameters from a file (and before onAfterLoad). If crypted, the file is saved as a binary format. If uncrypted, the file is saved as a JSON text file.

onDecryptProc

Top
Show:
 NameDescription
AsJSONObject

Return the current parameters as a JSON object

BeginUpdate

Allow parameters changes but delay the Save operation to the EndUpdate call.

Cancel

Cancel current changes and reload previous saved values

Clear

Clear current parameters list

Delete

Delete the file where settings are stored.

EndUpdate

Closes the block of code started with BeginUpdate. If you did some changes, it saves them by default.

HasChanged

Returns True if a setting has changed and not been saved.

InitDefaultFileNameV2

Initialise the folder and the filename with a new default tree: => "Documents / Editor / Software" for DEBUG and iOS => "AppData (HomePath) / Editor / Software" in RELEASE (except iOS)

Load

Load parameters from actual parameter file

MoveToFilePath

Move actual parameter file to the new file.

Remove

Retire une clé des paramètres

Save

Save current parameters to actual parameter file

ToJSON

Return the current parameters as a serialized JSON object.

getFilePath

Return the absolute path to the parameter file (drive+folder+file name+extension)

getParamValue

getParamsFileName

getValue

Overloaded. Get the JSON value for key parameter with nil as default value

getValue

Overloaded. Get the TDateTime value for key parameter with December 30th 1899 at 12:00 as default value

getValue

Overloaded. Get the single value for key parameter with zero as default value

getValue

Overloaded. Get the integer value for key parameter with zero as default value

getValue

Overloaded. Get the cardinal value for key parameter with zero as default value

getValue

Overloaded. Get the boolean value for key parameter with False as default value

getValue

Overloaded. Get the string value for key parameter with an empty string as default value

setFilePath

Change the folder where is the parameter file.

setFolderName

Change the folder where is the parameter file.

setParamValue

setValue

Overloaded. Set the value for key parameter as TJSONValue

setValue

Overloaded. Set the value for key parameter as TDateTime

setValue

Overloaded. Set the value for key parameter as single

setValue

Overloaded. Set the value for key parameter as integer

setValue

Overloaded. Set the value for key parameter as cardinal

setValue

Overloaded. Set the value for key parameter as boolean

setValue

Overloaded. Set the value for key parameter as string

Top