Rosi ComponentsUnits Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TAppDirCfg
Unit
AppDirCfg
Declaration
type TAppDirCfg = class(TComponent)
Description
TAppDirCfg is non visual component which provides functionality for automatic loading and processing of txt configuration file. Configuration file uses INI file format (Name=Value) and can contain specific directory tags which are automatically replaces by directory specified by the system. Following symbols are supported: %APPDIR%, %SYSTEMDIR%, %WINDIR%, %MYDOC%, %LOCALAPP%, %TEMPDIR%
Default name of cfg file: ApplicationName.dir (can be specified by CfgFileName property) Example of cfg file: DataDir=%APPDIR%\Data ReportDir=%APPDIR%\Reports DLLDir=%SYSTEMDIR% INIDir=%WINDIR%
Hierarchy
Overview
Methods
Properties
|
property CfgFileName: string read FCfgFileName write SetCfgFileName; |
|
property CreateAllDir: boolean read FCreateAllDir write FCreateAllDir default false; |
Description
Methods
|
function SystemDir: string; |
returns current SystemDirectory (e.g. C:\Windows\System\)
|
|
function WinDir: string; |
returns current WindowsDirectory (e.g. C:\Windows\)
|
|
function MyDocumentDir: string; |
returns MyDocument directory for current user
|
|
function LocalApplDir: string; |
returns current Local Application (e.g. C:\Windows\)
|
|
function TemporaryDir: string; |
returns Temporary directory
|
|
function CfgExists(Name: string): boolean; |
returns existency of "Name" item in the cfg file
|
|
function GetCfg(Name: string): string; |
returns value of "Name" item from cfg file; e.g. line in cfgfile: DefaultFormat=0.00 ; Name='DefaultFormat', result will be 0.00
|
|
function GetCfgDef(Name, DefaultCfg: string): string; |
returns value of "Name" item from cfg file or "DefaultCfg" if "Name" not found
|
|
function GetDir(DirName: string; CreateDir: boolean = true): string; |
returns value of "DirName" item from cfg file (last character is backslash); directory is created if prameter CreateDir is true
|
|
function GetDirDef(DirName, DefaultDir: string; CreateDir: boolean = true): string; |
returns value of "DirName" item from cfg file or "DefaultDir" if "DirName" is not found (last character is backslash); directory is created if prameter CreateDir is true
|
|
function GetSpecialDir(FolderType: integer): string; |
returns special directory in system according parameter FolderType, see ShlObj for list of values: CSIDL_DESKTOP, CSIDL_INTERNET, CSIDL_PROGRAMS, CSIDL_CONTROLS, CSIDL_PRINTERS, CSIDL_PERSONAL, CSIDL_FAVORITES, CSIDL_STARTUP, CSIDL_RECENT, CSIDL_SENDTO, CSIDL_BITBUCKET, CSIDL_STARTMENU, CSIDL_DESKTOPDIRECTORY, CSIDL_DRIVES, CSIDL_NETWORK, CSIDL_NETHOOD, CSIDL_FONTS, CSIDL_TEMPLATES, CSIDL_COMMON_STARTMENU, CSIDL_COMMON_PROGRAMS, CSIDL_COMMON_STARTUP, CSIDL_COMMON_DESKTOPDIRECTORY, CSIDL_APPDATA, CSIDL_PRINTHOOD, CSIDL_ALTSTARTUP, CSIDL_COMMON_ALTSTARTUP, CSIDL_COMMON_FAVORITES, CSIDL_INTERNET_CACHE, CSIDL_COOKIES, CSIDL_HISTORY
|
|
procedure LoadCfgFile; virtual; |
reload cfg file from disk (called automatically in Loaded event)
|
Properties
|
property CfgFileName: string read FCfgFileName write SetCfgFileName; |
FileName of cfg file, 'ApplicationName.dir' is used if empty
|
|
property CreateAllDir: boolean read FCreateAllDir write FCreateAllDir default false; |
if true, application creates all directories from cfg file on startup
|
Generated by PasDoc 0.15.0.
|