Changeset 20 for trunk/Packages/Common/URegistry.pas
- Timestamp:
- Mar 23, 2018, 1:59:25 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/URegistry.pas
r15 r20 37 37 function DeleteKeyRecursive(const Key: string): Boolean; 38 38 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; 39 47 property CurrentContext: TRegistryContext read GetCurrentContext write SetCurrentContext; 40 48 end; … … 97 105 Result := DefaultValue; 98 106 end; 107 end; 108 109 function TRegistryEx.GetValue(const Name: string; const DefaultValue: Integer 110 ): Integer; 111 begin 112 Result := ReadIntegerWithDefault(Name, DefaultValue); 113 end; 114 115 function TRegistryEx.GetValue(const Name: string; const DefaultValue: string 116 ): string; 117 begin 118 Result := ReadStringWithDefault(Name, DefaultValue); 119 end; 120 121 function TRegistryEx.GetValue(const Name: string; const DefaultValue: Boolean 122 ): Boolean; 123 begin 124 Result := ReadBoolWithDefault(Name, DefaultValue); 125 end; 126 127 function TRegistryEx.GetValue(const Name: string; const DefaultValue: Double 128 ): Double; 129 begin 130 Result := ReadFloatWithDefault(Name, DefaultValue); 131 end; 132 133 procedure TRegistryEx.SetValue(const Name: string; const Value: Integer); 134 begin 135 WriteInteger(Name, Value); 136 end; 137 138 procedure TRegistryEx.SetValue(const Name: string; const Value: string); 139 begin 140 WriteString(Name, Value); 141 end; 142 143 procedure TRegistryEx.SetValue(const Name: string; const Value: Boolean); 144 begin 145 WriteBool(Name, Value); 146 end; 147 148 procedure TRegistryEx.SetValue(const Name: string; const Value: Double); 149 begin 150 WriteFloat(Name, Value); 99 151 end; 100 152
Note:
See TracChangeset
for help on using the changeset viewer.