Changeset 561 for PersistentData/Backend
- Timestamp:
- Sep 10, 2022, 6:26:39 PM (2 years ago)
- Location:
- PersistentData/Backend
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
PersistentData/Backend/UPDClientINI.pas
r361 r561 1 1 unit UPDClientINI; 2 3 {$mode delphi}4 2 5 3 interface … … 23 21 procedure Disconnect; override; 24 22 end; 23 25 24 26 25 implementation … … 49 48 begin 50 49 Disconnect; 51 inherited Destroy;50 inherited; 52 51 end; 53 52 -
PersistentData/Backend/UPDClientMemory.pas
r387 r561 1 1 unit UPDClientMemory; 2 3 {$mode Delphi}{$H+}4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, UPDClient, SpecializedList;6 Classes, SysUtils, UPDClient, Generics.Collections; 9 7 10 8 type … … 21 19 function SearchObject(Id: Integer): TObjectProxy; 22 20 public 23 Objects: T ListObject;21 Objects: TObjectProxies; 24 22 procedure ObjectLoad(AObject: TObjectProxy); override; 25 23 procedure ObjectSave(AObject: TObjectProxy); override; … … 40 38 resourcestring 41 39 SObjectNotFound = 'Object with id %s not found'; 40 42 41 43 42 implementation … … 97 96 else begin 98 97 AObject.Id := GetNewObjectId; 99 Obj := TObjectProxy(Objects.AddNew(TObjectProxy.Create));98 Obj := Objects.AddProxy; 100 99 Obj.Assign(AObject); 101 100 end; … … 119 118 NewObject: TObjectProxy; 120 119 Table: string; 120 Item: TPair<string, string>; 121 121 begin 122 122 AList.Objects.Clear; … … 132 132 133 133 if AList.ColummsFilterUse then begin 134 for P := 0 to Properties.Count - 1do135 if AList.ColumnsFilter.IndexOf( Properties.Keys[I]) <> -1 then136 NewObject.Properties.Add( Properties.Keys[I], Properties[I].Value);134 for Item in Properties do 135 if AList.ColumnsFilter.IndexOf(Item.Key) <> -1 then 136 NewObject.Properties.Add(Item.Key, Item.Value); 137 137 end else NewObject.Properties.Assign(Properties); 138 138 end; … … 147 147 procedure TPDClientMemory.ListSave(AList: TListProxy); 148 148 begin 149 150 149 end; 151 150 152 151 procedure TPDClientMemory.TypeDefine(AType: TPDType); 153 152 begin 154 155 153 end; 156 154 157 155 procedure TPDClientMemory.TypeUndefine(AType: TPDType); 158 156 begin 159 160 157 end; 161 158 162 159 function TPDClientMemory.TypeIsDefined(AType: TPDType): Boolean; 163 160 begin 164 161 Result := False; 165 162 end; 166 163 167 164 procedure TPDClientMemory.Install; 168 165 begin 169 170 166 end; 171 167 172 168 procedure TPDClientMemory.Uninstall; 173 169 begin 174 175 170 end; 176 171 … … 178 173 begin 179 174 inherited; 180 Objects := T ListObject.Create;175 Objects := TObjectProxies.Create; 181 176 BackendName := 'Memory'; 182 177 end; … … 184 179 destructor TPDClientMemory.Destroy; 185 180 begin 186 Objects.Free;187 inherited Destroy;181 FreeAndNil(Objects); 182 inherited; 188 183 end; 189 184 190 185 procedure TPDClientMemory.Connect; 191 186 begin 192 inherited Connect;187 inherited; 193 188 end; 194 189 195 190 procedure TPDClientMemory.Disconnect; 196 191 begin 197 inherited Disconnect;192 inherited; 198 193 end; 199 194 -
PersistentData/Backend/UPDClientMySQL.pas
r362 r561 1 1 unit UPDClientMySQL; 2 2 3 {$mode delphi}4 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, USqlDatabase, UPDClient, SpecializedDictionary;6 Classes, SysUtils, USqlDatabase, UPDClient, UGenerics; 9 7 10 8 type … … 22 20 function GetConnected: Boolean; override; 23 21 procedure Init; override; 22 function GetConnectionString: string; override; 24 23 public 25 24 procedure ObjectLoad(AObject: TObjectProxy); override; … … 45 44 end; 46 45 46 47 47 implementation 48 49 48 50 49 resourcestring 51 50 SMissingBaseType = 'Missing base typ for %s'; 52 51 SUndefinedType = 'Undefined type in %0:s.%1:s'; 53 54 52 55 53 { TPDClientMySQL } … … 155 153 procedure TPDClientMySQL.ListSave(AList: TListProxy); 156 154 begin 157 158 155 end; 159 156 … … 245 242 end; 246 243 244 function TPDClientMySQL.GetConnectionString: string; 245 begin 246 Result := 'Host:' + Host + ',Port:' + IntToStr(Port) + ',User:' + User + 247 ',Password:' + Password + ',Schema:' + Schema; 248 end; 249 247 250 constructor TPDClientMySQL.Create(AOwner: TComponent); 248 251 begin … … 255 258 begin 256 259 FreeAndNil(FDatabase); 257 inherited Destroy;260 inherited; 258 261 end; 259 262 -
PersistentData/Backend/UPDClientRegistry.pas
r361 r561 1 1 unit UPDClientRegistry; 2 3 {$mode delphi}4 2 5 3 interface … … 13 11 14 12 TPDClientRegistry = class(TPDClient) 13 public 15 14 Reg: TRegistry; 16 15 //procedure GetItemList(Condition: TCondition; ItemList: TItemList); override; … … 19 18 destructor Destroy; override; 20 19 end; 20 21 21 22 22 implementation … … 46 46 begin 47 47 Reg.Free; 48 inherited Destroy;48 inherited; 49 49 end; 50 50 -
PersistentData/Backend/UPDClientXMLRPC.pas
r361 r561 1 1 unit UPDClientXMLRPC; 2 3 {$mode delphi}4 2 5 3 interface … … 16 14 end; 17 15 16 18 17 implementation 19 20 18 21 19 { TPDClientXMLRPC }
Note:
See TracChangeset
for help on using the changeset viewer.