lazarus-ccr/examples/germesorders/uconfig.pas
MageSlayer 05a5e2c6a2 First public commit
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@639 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2008-12-21 21:46:28 +00:00

64 lines
1014 B
ObjectPascal

unit uConfig;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
type
{ TConfig }
TConfig = class
private
ExePath:string; //слэш на конце
public
constructor Create;
destructor Destroy;override;
//полный абсолютный путь к базе данных
function BaseFile:string;
function DebugLogFile:string;
function DebugLogDirectory:string;
end;
var GlobalConfig:TConfig;
implementation
uses Forms;
{ TConfig }
constructor TConfig.Create;
begin
ExePath:=ExtractFilePath(Application.ExeName);
end;
destructor TConfig.Destroy;
begin
inherited Destroy;
end;
function TConfig.BaseFile: string;
begin
Result:=ExePath + 'base/germesorders.db3';
end;
function TConfig.DebugLogFile: string;
begin
Result:=ExePath + 'debug.log';
end;
function TConfig.DebugLogDirectory: string;
begin
Result:=ExePath + 'logs';
end;
initialization
GlobalConfig:=TConfig.Create;
finalization
FreeAndNil(GlobalConfig);
end.