Changeset 30 for trunk/Packages/Common/RegistryEx.pas
- Timestamp:
- Jun 28, 2024, 11:08:43 PM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/RegistryEx.pas
r29 r30 1 unit URegistry;1 unit RegistryEx; 2 2 3 3 interface … … 38 38 function DeleteKeyRecursive(const Key: string): Boolean; 39 39 function OpenKey(const Key: string; CanCreate: Boolean): Boolean; 40 function GetValue(const Name: string; const DefaultValue: Integer): Integer; overload;41 function GetValue(const Name: string; const DefaultValue: string): string; overload;42 function GetValue(const Name: string; const DefaultValue: Boolean): Boolean; overload;43 function GetValue(const Name: string; const DefaultValue: Double): Double; overload;44 function GetValue(const Name: string; const DefaultValue: Char): Char; overload;45 procedure SetValue(const Name: string; const Value: Integer); overload;46 procedure SetValue(const Name: string; const Value: string); overload;47 procedure SetValue(const Name: string; const Value: Boolean); overload;48 procedure SetValue(const Name: string; const Value: Double); overload;49 procedure SetValue(const Name: string; const Value: Char); overload;50 40 property CurrentContext: TRegistryContext read GetCurrentContext write SetCurrentContext; 51 41 end; … … 120 110 end; 121 111 122 function TRegistryEx.GetValue(const Name: string; const DefaultValue: Integer123 ): Integer;124 begin125 Result := ReadIntegerWithDefault(Name, DefaultValue);126 end;127 128 function TRegistryEx.GetValue(const Name: string; const DefaultValue: string129 ): string;130 begin131 Result := ReadStringWithDefault(Name, DefaultValue);132 end;133 134 function TRegistryEx.GetValue(const Name: string; const DefaultValue: Boolean135 ): Boolean;136 begin137 Result := ReadBoolWithDefault(Name, DefaultValue);138 end;139 140 function TRegistryEx.GetValue(const Name: string; const DefaultValue: Double141 ): Double;142 begin143 Result := ReadFloatWithDefault(Name, DefaultValue);144 end;145 146 function TRegistryEx.GetValue(const Name: string; const DefaultValue: Char147 ): Char;148 begin149 Result := ReadCharWithDefault(Name, DefaultValue);150 end;151 152 procedure TRegistryEx.SetValue(const Name: string; const Value: Integer);153 begin154 WriteInteger(Name, Value);155 end;156 157 procedure TRegistryEx.SetValue(const Name: string; const Value: string);158 begin159 WriteString(Name, Value);160 end;161 162 procedure TRegistryEx.SetValue(const Name: string; const Value: Boolean);163 begin164 WriteBool(Name, Value);165 end;166 167 procedure TRegistryEx.SetValue(const Name: string; const Value: Double);168 begin169 WriteFloat(Name, Value);170 end;171 172 procedure TRegistryEx.SetValue(const Name: string; const Value: Char);173 begin174 WriteChar(Name, Value);175 end;176 177 112 function TRegistryEx.DeleteKeyRecursive(const Key: string): Boolean; 178 113 var … … 198 133 //CloseKey; 199 134 {$ENDIF} 200 Result := inherited OpenKey(Key, CanCreate);135 Result := inherited; 201 136 end; 202 137
Note:
See TracChangeset
for help on using the changeset viewer.