Ignore:
Timestamp:
Mar 23, 2018, 1:59:25 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Database classes reorganized. Now TDbConnectProfile is class which holds information about connection to database.
  • Modified: TDbManager is top most class for managing other database classes.
  • Modified: TDbConnectParams class contains client specific parameters for connect profile.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/URegistry.pas

    r15 r20  
    3737    function DeleteKeyRecursive(const Key: string): Boolean;
    3838    function OpenKey(const Key: string; CanCreate: Boolean): Boolean;
     39    function GetValue(const Name: string; const DefaultValue: Integer): Integer; overload;
     40    function GetValue(const Name: string; const DefaultValue: string): string; overload;
     41    function GetValue(const Name: string; const DefaultValue: Boolean): Boolean; overload;
     42    function GetValue(const Name: string; const DefaultValue: Double): Double; overload;
     43    procedure SetValue(const Name: string; const Value: Integer); overload;
     44    procedure SetValue(const Name: string; const Value: string); overload;
     45    procedure SetValue(const Name: string; const Value: Boolean); overload;
     46    procedure SetValue(const Name: string; const Value: Double); overload;
    3947    property CurrentContext: TRegistryContext read GetCurrentContext write SetCurrentContext;
    4048  end;
     
    97105      Result := DefaultValue;
    98106    end;
     107end;
     108
     109function TRegistryEx.GetValue(const Name: string; const DefaultValue: Integer
     110  ): Integer;
     111begin
     112  Result := ReadIntegerWithDefault(Name, DefaultValue);
     113end;
     114
     115function TRegistryEx.GetValue(const Name: string; const DefaultValue: string
     116  ): string;
     117begin
     118  Result := ReadStringWithDefault(Name, DefaultValue);
     119end;
     120
     121function TRegistryEx.GetValue(const Name: string; const DefaultValue: Boolean
     122  ): Boolean;
     123begin
     124  Result := ReadBoolWithDefault(Name, DefaultValue);
     125end;
     126
     127function TRegistryEx.GetValue(const Name: string; const DefaultValue: Double
     128  ): Double;
     129begin
     130  Result := ReadFloatWithDefault(Name, DefaultValue);
     131end;
     132
     133procedure TRegistryEx.SetValue(const Name: string; const Value: Integer);
     134begin
     135  WriteInteger(Name, Value);
     136end;
     137
     138procedure TRegistryEx.SetValue(const Name: string; const Value: string);
     139begin
     140  WriteString(Name, Value);
     141end;
     142
     143procedure TRegistryEx.SetValue(const Name: string; const Value: Boolean);
     144begin
     145  WriteBool(Name, Value);
     146end;
     147
     148procedure TRegistryEx.SetValue(const Name: string; const Value: Double);
     149begin
     150  WriteFloat(Name, Value);
    99151end;
    100152
Note: See TracChangeset for help on using the changeset viewer.