Class TParams
Unit
Declaration
type TParams = class(TObject)
Description
Use TParams with its class methods if you only want to manage one settings file. If you need more than 1 file to store your settings in the same project, crreate instances of TParamsFile instead of using TParams.
TParams is here for compatibility with old projects.
Hierarchy
- TObject
- TParams
Overview
Methods
![]() |
class procedure Save; |
![]() |
class procedure Load; |
![]() |
class procedure Cancel; |
![]() |
class procedure Delete(const ClearMemoryToo: boolean = true); |
![]() |
class procedure Clear; |
![]() |
class function getValue(key: string; default: string = ''): string; overload; |
![]() |
class function getValue(key: string; default: boolean = False) : boolean; overload; |
![]() |
class function getValue(key: string; default: integer = 0) : integer; overload; |
![]() |
class function getValue(key: string; default: cardinal = 0) : integer; overload; |
![]() |
class function getValue(key: string; default: single = 0): single; overload; |
![]() |
class function getValue(key: string; default: TDateTime = 0) : TDateTime; overload; |
![]() |
class function getValue(key: string; default: TJSONValue = nil) : TJSONValue; overload; |
![]() |
class procedure setValue(key, Value: string); overload; |
![]() |
class procedure setValue(key: string; Value: boolean); overload; |
![]() |
class procedure setValue(key: string; Value: integer); overload; |
![]() |
class procedure setValue(key: string; Value: cardinal); overload; |
![]() |
class procedure setValue(key: string; Value: single); overload; |
![]() |
class procedure setValue(key: string; Value: TDateTime); overload; |
![]() |
class procedure setValue(key: string; Value: TJSONValue); overload; |
![]() |
class procedure setFolderName(AFolderName: string; AReload: boolean = true); |
![]() |
class procedure setFilePath(AFilePath: string; AReload: boolean = true); |
![]() |
class procedure InitDefaultFileNameV2(Const AEditor, ASoftware: string; AReload: boolean = true); |
![]() |
class procedure MoveToFilePath(ANewFilePath: string; ASave: boolean = true; ACreateFolder: boolean = False); |
![]() |
class function getFilePath: string; |
![]() |
class function ToJSON: string; |
![]() |
class function AsJSONObject: TJSONObject; |
![]() |
class procedure Remove(key: string); |
![]() |
class function HasChanged: boolean; |
![]() |
class procedure BeginUpdate; |
![]() |
class procedure EndUpdate(const AutoSaveChanges: boolean = true); |
Properties
![]() |
class property onBeforeLoadEvent: TParamsLoadSaveEvent
read GetonBeforeLoadEvent write SetonBeforeLoadEvent; |
![]() |
class property onBeforeLoadProc: TParamsLoadSaveProc
read GetonBeforeLoadProc write SetonBeforeLoadProc; |
![]() |
class property onAfterLoadEvent: TParamsLoadSaveEvent
read GetonAfterLoadEvent write SetonAfterLoadEvent; |
![]() |
class property onAfterLoadProc: TParamsLoadSaveProc read GetonAfterLoadProc
write SetonAfterLoadProc; |
![]() |
class property onBeforeSaveEvent: TParamsLoadSaveEvent
read GetonBeforeSaveEvent write SetonBeforeSaveEvent; |
![]() |
class property onBeforeSaveProc: TParamsLoadSaveProc
read GetonBeforeSaveProc write SetonBeforeSaveProc; |
![]() |
class property onAfterSaveEvent: TParamsLoadSaveEvent
read GetonAfterSaveEvent write SetonAfterSaveEvent; |
![]() |
class property onAfterSaveProc: TParamsLoadSaveProc read GetonAfterSaveProc
write SetonAfterSaveProc; |
![]() |
class property onCryptEvent: TParamsCryptEvent read GetonCryptEvent
write SetonCryptEvent; |
![]() |
class property onCryptProc: TParamsCryptProc read GetonCryptProc
write SetonCryptProc; |
![]() |
class property onDecryptEvent: TParamsDecryptEvent read GetonDecryptEvent
write SetonDecryptEvent; |
![]() |
class property onDecryptProc: TParamsDecryptProc read GetonDecryptProc
write SetonDecryptProc; |
![]() |
class property PortableMode: boolean read GetPortableMode
write SetPortableMode; |
Description
Methods
![]() |
class procedure Save; |
Save current parameters to actual parameter file |
![]() |
class procedure Load; |
Load parameters from actual parameter file |
![]() |
class procedure Cancel; |
Cancel current changes and reload previous saved values |
![]() |
class procedure Delete(const ClearMemoryToo: boolean = true); |
Delete the file where settings are stored.
WARNING !!! No rollback. Deleting the file can't be canceled. |
![]() |
class procedure Clear; |
Clear current parameters list |
![]() |
class function getValue(key: string; default: string = ''): string; overload; |
Get the string value for key parameter with an empty string as default value |
![]() |
class function getValue(key: string; default: boolean = False) : boolean; overload; |
Get the boolean value for key parameter with False as default value |
![]() |
class function getValue(key: string; default: integer = 0) : integer; overload; |
Get the integer value for key parameter with zero as default value |
![]() |
class function getValue(key: string; default: cardinal = 0) : integer; overload; |
Get the cardinal value for key parameter with zero as default value |
![]() |
class function getValue(key: string; default: single = 0): single; overload; |
Get the single value for key parameter with zero as default value |
![]() |
class function getValue(key: string; default: TDateTime = 0) : TDateTime; overload; |
Get the TDateTime value for key parameter with December 30th 1899 at 12:00 as default value |
![]() |
class function getValue(key: string; default: TJSONValue = nil) : TJSONValue; overload; |
Get the JSON value for key parameter with nil as default value |
![]() |
class procedure setValue(key, Value: string); overload; |
Set the value for key parameter as string |
![]() |
class procedure setValue(key: string; Value: boolean); overload; |
Set the value for key parameter as boolean |
![]() |
class procedure setValue(key: string; Value: integer); overload; |
Set the value for key parameter as integer |
![]() |
class procedure setValue(key: string; Value: cardinal); overload; |
Set the value for key parameter as cardinal |
![]() |
class procedure setValue(key: string; Value: single); overload; |
Set the value for key parameter as single |
![]() |
class procedure setValue(key: string; Value: TDateTime); overload; |
Set the value for key parameter as TDateTime |
![]() |
class procedure setValue(key: string; Value: TJSONValue); overload; |
Set the value for key parameter as TJSONValue |
![]() |
class function getFilePath: string; |
Return the absolute path to the parameter file (drive+folder+file name+extension) |
![]() |
class function ToJSON: string; |
Return the current parameters as a serialized JSON object. |
![]() |
class function AsJSONObject: TJSONObject; |
Return the current parameters as a JSON object |
![]() |
class procedure Remove(key: string); |
Retire une clé des paramètres |
![]() |
class function HasChanged: boolean; |
![]() |
class procedure BeginUpdate; |
Allow parameters changes but delay the Save operation to the EndUpdate call.
If you call BeginUpdate you MUST call its EndUpdate. Use a try... finally... end ! |
Properties
![]() |
class property onBeforeLoadEvent: TParamsLoadSaveEvent
read GetonBeforeLoadEvent write SetonBeforeLoadEvent; |
Called before loading the settings file
Also called for Cancel operation (which reload the file). |
![]() |
class property onBeforeLoadProc: TParamsLoadSaveProc
read GetonBeforeLoadProc write SetonBeforeLoadProc; |
![]() |
class property onAfterLoadEvent: TParamsLoadSaveEvent
read GetonAfterLoadEvent write SetonAfterLoadEvent; |
Called after loading the settings file
Also called for Cancel operation (which reload the file). |
![]() |
class property onAfterLoadProc: TParamsLoadSaveProc read GetonAfterLoadProc
write SetonAfterLoadProc; |
![]() |
class property onBeforeSaveEvent: TParamsLoadSaveEvent
read GetonBeforeSaveEvent write SetonBeforeSaveEvent; |
Called before saving the settings file
The finalization of this unit calls the TParams.Save. If you have a BeforeSaveEvent or BeforeEventProc, beware of potential access violation by using something perhaps already destroyed. |
![]() |
class property onBeforeSaveProc: TParamsLoadSaveProc
read GetonBeforeSaveProc write SetonBeforeSaveProc; |
![]() |
class property onAfterSaveEvent: TParamsLoadSaveEvent
read GetonAfterSaveEvent write SetonAfterSaveEvent; |
Called after saving the settings file
The finalization of this unit calls the TParams.Save. If you have a BeforeSaveEvent or BeforeEventProc, beware of potential access violation by using something perhaps already destroyed. |
![]() |
class property onAfterSaveProc: TParamsLoadSaveProc read GetonAfterSaveProc
write SetonAfterSaveProc; |
![]() |
class property onCryptEvent: TParamsCryptEvent read GetonCryptEvent
write SetonCryptEvent; |
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. |
![]() |
class property onCryptProc: TParamsCryptProc read GetonCryptProc
write SetonCryptProc; |
![]() |
class property onDecryptEvent: TParamsDecryptEvent read GetonDecryptEvent
write SetonDecryptEvent; |
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. |
![]() |
class property onDecryptProc: TParamsDecryptProc read GetonDecryptProc
write SetonDecryptProc; |
![]() |
class property PortableMode: boolean read GetPortableMode
write SetPortableMode; |
Portable mode : if true nothing is done on the storage. Default value is false. |
Generated by PasDoc 0.16.0.