A3DGE - Amateur 3D Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers Conclusion
|
Class TConfigurationFile
Unit
a3dge
Declaration
type TConfigurationFile = class(TObject)
Description
Handles configuration files.
It gets values from a configuration file, which uses the INI file format, and also from command line options.
Hierarchy
- TObject
- TConfigurationFile
Overview
Methods
 |
constructor Create; virtual; |
 |
destructor Destroy; override; |
 |
procedure Load; |
 |
function GetValue (const aSection, aKey, aDefault: AnsiString): String; |
 |
function GetIntValue ( const aSection, aKey: AnsiString; aDefault: Integer ): Integer; |
 |
function GetBoolValue ( const aSection, aKey: AnsiString; aDefault: Boolean ): Boolean; |
 |
procedure SetValue (const aSection, aKey, aValue: AnsiString); |
 |
procedure SetIntValue (const aSection, aKey: AnsiString; aValue: Integer); |
 |
procedure SetBoolValue (const aSection, aKey: AnsiString; aValue: Boolean); |
 |
procedure Save; |
Properties
 |
property FileName: AnsiString read fFileName write fFileName; |
Description
Methods
 |
destructor Destroy; override; |
Destructor.
Note that changes in the configuration file won't be saved. You must call Save to do it.
See also
- TConfigurationFile.Save
- Save current configuration to file.
|
 |
function GetValue (const aSection, aKey, aDefault: AnsiString): String; |
Get a configuration value.
Parameters
- aSection
- Section name. It can be an empty string for the global section.
- aKey
- Key name.
- aDefault
- Default value returned if the key doesn't exist in file.
Returns
The value of the key, or Default if it doesn't exists. Note that if the key exists, but is empty, an empty string will be returned. See also
- TConfigurationFile.SetValue
- Set a configuration value.
- TConfigurationFile.GetBoolValue
- Get a boolean configuration value.
- TConfigurationFile.GetIntValue
- Get an integer configuration value.
|
 |
function GetIntValue ( const aSection, aKey: AnsiString; aDefault: Integer ): Integer; |
Get an integer configuration value.
Parameters
- aSection
- Section name. It can be an empty string for the global section.
- aKey
- Key name.
- aDefault
- Default value returned if the key doesn't exist in file.
See also
- TConfigurationFile.SetIntValue
- Set an integer configuration value.
- TConfigurationFile.GetValue
- Get a configuration value.
|
 |
function GetBoolValue ( const aSection, aKey: AnsiString; aDefault: Boolean ): Boolean; |
Get a boolean configuration value.
Parameters
- aSection
- Section name. It can be an empty string for the global section.
- aKey
- Key name.
- aDefault
- Default value returned if the key doesn't exist in file.
See also
- TConfigurationFile.SetBoolValue
- Set a boolean configuration value.
- TConfigurationFile.GetValue
- Get a configuration value.
|
 |
procedure SetIntValue (const aSection, aKey: AnsiString; aValue: Integer); |
Set an integer configuration value.
Parameters
- aSection
- Section name. It can be an empty string for the global section.
- aKey
- Key name.
- aValue
- The new value.
See also
- TConfigurationFile.GetIntValue
- Get an integer configuration value.
- TConfigurationFile.SetValue
- Set a configuration value.
|
 |
procedure SetBoolValue (const aSection, aKey: AnsiString; aValue: Boolean); |
Set a boolean configuration value.
Parameters
- aSection
- Section name. It can be an empty string for the global section.
- aKey
- Key name.
- aValue
- The new value.
See also
- TConfigurationFile.GetBoolValue
- Get a boolean configuration value.
- TConfigurationFile.SetValue
- Set a configuration value.
|
Properties
 |
property FileName: AnsiString read fFileName write fFileName; |
Configuration file name, including path.
Default is GetAppConfigFile (False, False) .
Note that assign this property will load the file if it exists.
See also
- TConfigurationFile.Load
- (Re)loads configuration file.
- TConfigurationFile.Save
- Save current configuration to file.
|
Generated by PasDoc 0.15.0. Generated on 2025-07-31 11:41:01.
|