From 722a02bdbef191c1e06f5bb95fee4d7fccc895a7 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 2 Apr 2019 22:36:02 +0200 Subject: [PATCH 1/8] small changes --- Quick.Commons.pas | 6 ++++-- QuickLib.inc | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Quick.Commons.pas b/Quick.Commons.pas index 3645b32..f3c81d7 100644 --- a/Quick.Commons.pas +++ b/Quick.Commons.pas @@ -7,7 +7,7 @@ Author : Kike Pérez Version : 1.7 Created : 14/07/2017 - Modified : 29/03/2019 + Modified : 02/04/2019 This file is part of QuickLib: https://github.com/exilon/QuickLib @@ -1332,14 +1332,16 @@ initialization try GetEnvironmentPaths; except + {$IFDEF SHOW_ENVIRONMENTPATH_ERRORS} on E : Exception do begin if not IsService then begin if HasConsoleOutput then Writeln(Format('[WARN] GetEnvironmentPaths: %s',[E.Message])) - else raise EEnvironmentPath.Create(Format('Get environment path error: %s',[E.Message])); + else MessageBox(0,PWideChar(Format('Get environment path error: %s',[E.Message])),'GetEnvironmentPaths',MB_ICONEXCLAMATION); end; end; + {$ENDIF} end; {$ENDIF} diff --git a/QuickLib.inc b/QuickLib.inc index 337b3a5..be12827 100644 --- a/QuickLib.inc +++ b/QuickLib.inc @@ -150,4 +150,6 @@ {.$WARN UNIT_PLATFORM OFF} {$endif} +{.$define SHOW_ENVIRONMENTPATH_ERRORS} + From 9dbb4d55bd5abe3cfb84d37965b120826b97ecb4 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 6 Apr 2019 17:09:38 +0200 Subject: [PATCH 2/8] New Quick.Arrays.Helper --- Quick.Arrays.Helper.pas | 194 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 Quick.Arrays.Helper.pas diff --git a/Quick.Arrays.Helper.pas b/Quick.Arrays.Helper.pas new file mode 100644 index 0000000..8a11d82 --- /dev/null +++ b/Quick.Arrays.Helper.pas @@ -0,0 +1,194 @@ +{ *************************************************************************** + + Copyright (c) 2016-2019 Kike Pérez + + Unit : Quick.Arrays.Helper + Description : Array helpers + Author : Kike Pérez + Version : 1.0 + Created : 24/03/2019 + Modified : 29/03/2019 + + This file is part of QuickLib: https://github.com/exilon/QuickLib + + *************************************************************************** + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + *************************************************************************** } + +unit Quick.Arrays.Helper; + +{$i QuickLib.inc} + +interface + +uses + Generics.Defaults; + +type + + TArrayHelper = class + public + class function Count(var aArray : TArray) : Integer; + class procedure Add(var aArray : TArray; aItem : T); static; + class procedure Insert(var aArray : TArray; aItem : T; aIndex : Integer); static; + class procedure Remove(var aArray : TArray; aIndex : Integer); static; + class function Contains(var aArray : TArray; aItem : T) : Boolean; + class function IndexOf(var aArray : TArray; aItem : T) : Integer; + end; + + {$IFDEF FPC} + TStringArray = TArray; + {$ENDIF} + + TStringArrayHelper = record Helper for {$IFNDEF FPC}TArray{$ELSE}TStringArray{$ENDIF} + function Count : Integer; + procedure Add(const aValue : string); + procedure Insert(const aValue : string; aIndex : Integer); + procedure Remove(aIndex : Integer); + function Contains(const aItem : string) : Boolean; + function IndexOf(const aItem : string) : Integer; + end; + + {$IFDEF FPC} + TIntegerArray = TArray; + {$ENDIF} + + TIntegerArrayHelper = record Helper for {$IFNDEF FPC}TArray{$ELSE}TIntegerArray{$ENDIF} + function Count : Integer; + procedure Add(aValue : Integer); + procedure Insert(const aValue : Integer; aIndex : Integer); + procedure Remove(aIndex : Integer); + function Contains(aItem : Integer) : Boolean; + function IndexOf(aItem : Integer) : Integer; + end; + + +implementation + + +{ TArray } + +class function TArrayHelper.Count(var aArray : TArray) : Integer; +begin + Result := High(aArray)+1; +end; + +class procedure TArrayHelper.Add(var aArray : TArray; aItem : T); +begin + SetLength(aArray, Length(aArray) + 1); + aArray[High(aArray)] := aItem; +end; + +class procedure TArrayHelper.Remove(var aArray : TArray; aIndex : Integer); +begin + System.Delete(aArray,aIndex,1); +end; + +class procedure TArrayHelper.Insert(var aArray : TArray; aItem : T; aIndex : Integer); +begin + System.Insert(aItem,aArray,aIndex); +end; + +class function TArrayHelper.Contains(var aArray : TArray; aItem : T) : Boolean; +var + icomparer : IEqualityComparer; + i : Integer; +begin + Result := False; + icomparer := TEqualityComparer.Default; + for i := Low(aArray) to High(aArray) do + begin + if icomparer.Equals(aArray[i],aItem) then Exit(True); + end; +end; + +class function TArrayHelper.IndexOf(var aArray : TArray; aItem : T) : Integer; +var + icomparer : IEqualityComparer; + i : Integer; +begin + icomparer := TEqualityComparer.Default; + for i := Low(aArray) to High(aArray) do + begin + if icomparer.Equals(aArray[i],aItem) then Exit(i); + end; + Result := -1; +end; + +{ TStringArrayHelper } + +function TStringArrayHelper.Count : Integer; +begin + Result := TArrayHelper.Count(Self); +end; + +procedure TStringArrayHelper.Add(const aValue : string); +begin + TArrayHelper.Add(Self,aValue); +end; + +procedure TStringArrayHelper.Insert(const aValue : string; aIndex : Integer); +begin + TArrayHelper.Insert(Self,aValue,aIndex); +end; + +procedure TStringArrayHelper.Remove(aIndex : Integer); +begin + TArrayHelper.Remove(Self,aIndex); +end; + +function TStringArrayHelper.Contains(const aItem : string) : Boolean; +begin + Result := TArrayHelper.Contains(Self,aItem); +end; + +function TStringArrayHelper.IndexOf(const aItem : string) : Integer; +begin + Result := TArrayHelper.IndexOf(Self,aItem); +end; + +{ TIntegerArrayHelper } + +function TIntegerArrayHelper.Count : Integer; +begin + Result := TArrayHelper.Count(Self); +end; + +procedure TIntegerArrayHelper.Add(aValue : Integer); +begin + TArrayHelper.Add(Self,aValue); +end; + +procedure TIntegerArrayHelper.Insert(const aValue : Integer; aIndex : Integer); +begin + TArrayHelper.Insert(Self,aValue,aIndex); +end; + +procedure TIntegerArrayHelper.Remove(aIndex : Integer); +begin + TArrayHelper.Remove(Self,aIndex); +end; + +function TIntegerArrayHelper.Contains(aItem : Integer) : Boolean; +begin + Result := TArrayHelper.Contains(Self,aItem); +end; + +function TIntegerArrayHelper.IndexOf(aItem : Integer) : Integer; +begin + Result := TArrayHelper.IndexOf(Self,aItem); +end; + +end. From 57a4f064adc9eb7a284f8776a11ac0ad72c028b1 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 6 Apr 2019 17:09:49 +0200 Subject: [PATCH 3/8] New Quick.Arrays --- Quick.Arrays.pas | 260 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 Quick.Arrays.pas diff --git a/Quick.Arrays.pas b/Quick.Arrays.pas new file mode 100644 index 0000000..4fa5b9d --- /dev/null +++ b/Quick.Arrays.pas @@ -0,0 +1,260 @@ +{ *************************************************************************** + + Copyright (c) 2016-2019 Kike Pérez + + Unit : Quick.Arrays + Description : Multifuntional Arrays + Author : Kike Pérez + Version : 1.2 + Created : 24/03/2019 + Modified : 03/04/2019 + + This file is part of QuickLib: https://github.com/exilon/QuickLib + + *************************************************************************** + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + *************************************************************************** } + +unit Quick.Arrays; + +{$i QuickLib.inc} + +interface + +uses + SysUtils, + Generics.Defaults, + Generics.Collections, + Quick.Value; + +type + + TXArray = record + type + TEnumerator = class(Generics.Collections.TEnumerator) + private + fArray : ^TArray; + fIndex : Integer; + protected + function DoGetCurrent: T; override; + function DoMoveNext: Boolean; override; + public + constructor Create(var aArray: TArray); + end; + private + fArray : TArray; + function GetItem(Index : Integer) : T; + procedure SetItem(Index : Integer; const aValue : T); + function GetCapacity: Integer; + function GetCount: Integer; + procedure SetCapacity(const Value: Integer); + public + function GetEnumerator: TEnumerator; + property AsArray : TArray read fArray; + property Items[Index : Integer] : T read GetItem write SetItem; default; + property Count : Integer read GetCount; + property Capacity : Integer read GetCapacity write SetCapacity; + function Add(aValue : T) : Integer; + procedure Insert(aItem : T; aIndex : Integer); + procedure Delete(aIndex : Integer); + procedure Remove(aItem : T); + function Contains(aItem : T) : Boolean; + function IndexOf(aItem : T) : Integer; + class operator Implicit(const Value : TxArray) : TArray; + end; + + TFlexArray = TXArray; + + TFlexPairArray = TArray; + + TFlexPairArrayHelper = record helper for TFlexPairArray + public + function GetValue(const aName : string) : TFlexValue; + function GetPair(const aName : string) : TFlexPair; + function Add(const aName: string; aValue : TFlexValue): TFlexValue; + function Exists(const aName : string) : Boolean; + function Remove(const aName : string) : Boolean; + end; + + +implementation + + +{ TxArray } + +function TxArray.GetItem(Index : Integer) : T; +begin + Result := fArray[Index]; +end; + +procedure TXArray.SetCapacity(const Value: Integer); +begin + if Value = High(fArray) then Exit; + + if Value < 0 then SetLength(fArray,1) + else SetLength(fArray, Value); +end; + +procedure TxArray.SetItem(Index : Integer; const aValue : T); +begin + fArray[Index] := aValue; +end; + +function TXArray.GetCapacity: Integer; +begin + Result := High(fArray) + 1; +end; + +function TXArray.GetCount: Integer; +begin + Result := High(fArray) + 1; +end; + +function TxArray.GetEnumerator: TEnumerator; +begin + Result := TEnumerator.Create(fArray); +end; + +function TxArray.Add(aValue : T) : Integer; +begin + SetLength(fArray, Length(fArray) + 1); + fArray[High(fArray)] := aValue; + Result := High(fArray); +end; + +procedure TxArray.Delete(aIndex : Integer); +begin + System.Delete(fArray,aIndex,1); +end; + +procedure TxArray.Remove(aItem : T); +var + nindex : Integer; +begin + nindex := IndexOf(aItem); + if nindex > -1 then System.Delete(fArray,nindex,1); +end; + +procedure TxArray.Insert(aItem : T; aIndex : Integer); +begin + System.Insert(aItem,fArray,aIndex); +end; + +function TxArray.Contains(aItem : T) : Boolean; +var + icomparer : IEqualityComparer; + i : Integer; +begin + Result := False; + icomparer := TEqualityComparer.Default; + for i := Low(fArray) to High(fArray) do + begin + if icomparer.Equals(fArray[i],aItem) then Exit(True); + end; +end; + +function TxArray.IndexOf(aItem : T) : Integer; +var + icomparer : IEqualityComparer; + i : Integer; +begin + icomparer := TEqualityComparer.Default; + for i := Low(fArray) to High(fArray) do + begin + if icomparer.Equals(fArray[i],aItem) then Exit(i); + end; + Result := -1; +end; + +class operator TxArray.Implicit(const Value : TxArray) : TArray; +begin + Result := Value.fArray; +end; + + +{ TXArray.TEnumerator } + +constructor TXArray.TEnumerator.Create(var aArray: TArray); +begin + fIndex := -1; + fArray := @aArray; +end; + +function TXArray.TEnumerator.DoGetCurrent: T; +begin + Result := TArray(fArray^)[fIndex]; +end; + +function TXArray.TEnumerator.DoMoveNext: Boolean; +begin + Inc(fIndex); + Result := fIndex < High(TArray(fArray^))+1; +end; + +{ TFlexPairArrayHelper } + +function TFlexPairArrayHelper.Add(const aName: string; aValue : TFlexValue): TFlexValue; +begin + SetLength(Self,Length(Self)+1); + Self[High(Self)].Name := aName; + Self[High(Self)].Value := aValue; +end; + +function TFlexPairArrayHelper.Exists(const aName: string): Boolean; +var + i : Integer; +begin + Result := False; + for i := Low(Self) to High(Self) do + begin + if CompareText(Self[i].Name,aName) = 0 then Exit(True) + end; +end; + +function TFlexPairArrayHelper.GetPair(const aName: string): TFlexPair; +var + i : Integer; +begin + for i := Low(Self) to High(Self) do + begin + if CompareText(Self[i].Name,aName) = 0 then Exit(Self[i]); + end; +end; + +function TFlexPairArrayHelper.GetValue(const aName: string): TFlexValue; +var + i : Integer; +begin + for i := Low(Self) to High(Self) do + begin + if CompareText(Self[i].Name,aName) = 0 then Exit(Self[i].Value); + end; +end; + +function TFlexPairArrayHelper.Remove(const aName: string): Boolean; +var + i : Integer; +begin + for i := Low(Self) to High(Self) do + begin + if CompareText(Self[i].Name,aName) = 0 then + begin + System.Delete(Self,i,1); + Exit(True); + end; + end; +end; + +end. From d2837c04e382272015e0f1b7c1d30452e0e8d879 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 6 Apr 2019 17:11:32 +0200 Subject: [PATCH 4/8] Quick.Value improved & more fpc compatibility --- Quick.Value.pas | 84 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 4 deletions(-) diff --git a/Quick.Value.pas b/Quick.Value.pas index 70e7780..e7d5e45 100644 --- a/Quick.Value.pas +++ b/Quick.Value.pas @@ -5,9 +5,9 @@ Unit : Quick.Value Description : Autofree value record Author : Kike Pérez - Version : 1.4 + Version : 1.5 Created : 07/01/2019 - Modified : 14/03/2019 + Modified : 03/04/2019 This file is part of QuickLib: https://github.com/exilon/QuickLib @@ -265,7 +265,7 @@ TFlexValue = record procedure Clear; inline; procedure _AddRef; inline; procedure _Release; inline; - {$IFNDEF FPC} + {$IFNDEF FPCS} class operator Implicit(const Value : TFlexValue) : string; class operator Implicit(Value : TFlexValue) : Integer; class operator Implicit(Value : TFlexValue) : Int64; @@ -275,9 +275,25 @@ TFlexValue = record class operator Implicit(Value : TFlexValue) : TClass; class operator Implicit(Value : TFlexValue) : TObject; class operator Implicit(Value : TFlexValue) : Pointer; + class operator Implicit(Value : TFlexValue) : Variant; + class operator Implicit(const Value : string) : TFlexValue; + class operator Implicit(Value : Integer) : TFlexValue; + class operator Implicit(Value : Int64) : TFlexValue; + class operator Implicit(Value : Extended) : TFlexValue; + class operator Implicit(Value : TDateTime) : TFlexValue; + class operator Implicit(Value : Boolean) : TFlexValue; + class operator Implicit(Value : TClass) : TFlexValue; + class operator Implicit(Value : TObject) : TFlexValue; + class operator Implicit(Value : Pointer) : TFlexValue; + class operator Implicit(Value : Variant) : TFlexValue; {$ENDIF} end; + TFlexPair = record + Name : string; + Value : TFlexValue; + end; + implementation @@ -478,7 +494,11 @@ function TFlexValue.CastToObject: TObject; case fDataType of dtObject, dtOwnedObject : Result := (fDataIntf as IValueObject).Value; + {$IFNDEF FPC} dtPointer : Result := TObject((fDataIntf as IValueObject).Value); + {$ELSE} + dtPointer : Result := TObject((fDataIntf as IValuePointer).Value); + {$ENDIF} dtNull : Result := nil; else raise Exception.Create('DataType not supported'); end; @@ -566,7 +586,7 @@ constructor TFlexValue.Create(const Value: TVarRec); {$ENDIF} end; -{$IFNDEF FPC} +{$IFNDEF FPCS} class operator TFlexValue.Implicit(Value: TFlexValue): Boolean; begin Result := Value.AsBoolean; @@ -612,6 +632,61 @@ constructor TFlexValue.Create(const Value: TVarRec); Result := Value.AsExtended; end; +class operator TFlexValue.Implicit(Value: TFlexValue): Variant; +begin + Result := Value.AsVariant; +end; + +class operator TFlexValue.Implicit(Value: Variant): TFlexValue; +begin + Result.AsVariant := Value; +end; + +class operator TFlexValue.Implicit(const Value : string) : TFlexValue; +begin + Result.AsString := Value; +end; + +class operator TFlexValue.Implicit(Value : Integer) : TFlexValue; +begin + Result.AsInteger := Value; +end; + +class operator TFlexValue.Implicit(Value : Int64) : TFlexValue; +begin + Result.AsInt64 := Value; +end; + +class operator TFlexValue.Implicit(Value : Extended) : TFlexValue; +begin + Result.AsExtended := Value; +end; + +class operator TFlexValue.Implicit(Value : TDateTime) : TFlexValue; +begin + Result.AsDateTime := Value; +end; + +class operator TFlexValue.Implicit(Value : Boolean) : TFlexValue; +begin + Result.AsBoolean := Value; +end; + +class operator TFlexValue.Implicit(Value : TClass) : TFlexValue; +begin + Result.AsClass := Value; +end; + +class operator TFlexValue.Implicit(Value : TObject) : TFlexValue; +begin + Result.AsObject := Value; +end; + +class operator TFlexValue.Implicit(Value : Pointer) : TFlexValue; +begin + Result.AsPointer := Value; +end; + {$ENDIF} function TFlexValue.IsBoolean: Boolean; @@ -917,4 +992,5 @@ procedure TValueObject.SetValue(const Value: TObject); fData := Value; end; + end. From 56b61fab6554852ad374c9bc4d6ad240459ed160 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 6 Apr 2019 17:12:55 +0200 Subject: [PATCH 5/8] AutoMapper custom mapping functions --- Quick.AutoMapper.pas | 192 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 164 insertions(+), 28 deletions(-) diff --git a/Quick.AutoMapper.pas b/Quick.AutoMapper.pas index 307bece..48c00da 100644 --- a/Quick.AutoMapper.pas +++ b/Quick.AutoMapper.pas @@ -5,9 +5,9 @@ Unit : Quick.AutoMapper Description : Auto Mapper object properties Author : Kike Pérez - Version : 1.1 + Version : 1.2 Created : 25/08/2018 - Modified : 23/09/2018 + Modified : 31/03/2019 This file is part of QuickLib: https://github.com/exilon/QuickLib @@ -36,13 +36,29 @@ interface uses SysUtils, Generics.Collections, - //{$IFDEF FPC} typinfo, - //{$ENDIF} + Quick.Value, + {$IFDEF FPC} + Variants, + {$ENDIF} RTTI; type + {$IFNDEF FPC} + TFlexValue = TValue; + {$ELSE} + TFlexValue = variant; + {$ENDIF} + + {$IFNDEF FPC} + TMappingProc = reference to procedure(const aSrcObj : TClass1; const aTargetName : string; out Value : TFlexValue); + TAfterMappingProc = reference to procedure(const aSrcObj : TClass1; aTgtObj : TClass2); + {$ELSE} + TMappingProc = procedure(const aSrcObj : TObject; const aTargetName : string; out Value : TFlexValue) of object; + TAfterMappingProc = procedure(const aSrcObj : TClass1; aTgtObj : TClass2) of object; + {$ENDIF} + TCustomMapping = class private fMapDictionary : TDictionary; @@ -55,7 +71,12 @@ TCustomMapping = class TObjMapper = class public - class procedure Map(aSrcObj : TObject; aTgtObj : TObject; aCustomMapping: TCustomMapping = nil); + class procedure Map(aSrcObj : TObject; aTgtObj : TObject; aCustomMapping: TCustomMapping = nil); overload; + {$IFNDEF FPC} + class procedure Map(aSrcObj : TObject; aTgtObj : TObject; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping = nil); overload; + {$ELSE} + class procedure Map(aSrcObj : TObject; aTgtObj : TObject; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping = nil); overload; + {$ENDIF} end; TListMapper = class @@ -65,22 +86,46 @@ TListMapper = class TObjListMapper = class public - class procedure Map(aSrcObjList : TObject; aTgtObjList : TObject; aCustomMapping : TCustomMapping = nil); + class procedure Map(aSrcObjList : TObject; aTgtObjList : TObject; aCustomMapping : TCustomMapping = nil); overload; + {$IFNDEF FPC} + class procedure Map(aSrcObjList : TObject; aTgtObjList : TObject; aDoMappingProc : TMappingProc; aCustomMapping : TCustomMapping = nil); overload; + {$ELSE} + class procedure Map(aSrcObjList : TObject; aTgtObjList : TObject; aDoMappingProc : TMappingProc; aCustomMapping : TCustomMapping = nil); overload; + {$ENDIF} end; TMapper = class public class function Map(aSrcObj : TObject; aCustomMapping: TCustomMapping = nil): T; overload; class procedure Map(aSrcObj : TObject; aTgtObj : T; aCustomMapping : TCustomMapping = nil); overload; + {$IFNDEF FPC} + class function Map(aSrcObj : TObject; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping = nil): T; overload; + class procedure Map(aSrcObj : TObject; aTgtObj : T; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping = nil); overload; + {$ELSE} + class function Map(aSrcObj : TObject; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping = nil): T; overload; + class procedure Map(aSrcObj : TObject; aTgtObj : T; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping); + {$ENDIF} end; TAutoMapper = class private fCustomMapping : TCustomMapping; + {$IFNDEF FPC} + fOnDoMapping : TMappingProc; + {$ELSE} + fOnDoMapping : TMappingProc; + {$ENDIF} + fOnAfterMapping : TAfterMappingProc; public constructor Create; destructor Destroy; override; property CustomMapping : TCustomMapping read fCustomMapping write fCustomMapping; + {$IFNDEF FPC} + property OnDoMapping : TMappingProc read fOnDoMapping write fOnDoMapping; + {$ELSE} + property OnDoMapping : TMappingProc read fOnDoMapping write fOnDoMapping; + {$ENDIF} + property OnAfterMapping : TAfterMappingProc read fOnAfterMapping write fOnAfterMapping; function Map(aSrcObj : TClass1) : TClass2; overload; {$IFNDEF FPC} function Map(aSrcObj : TClass2) : TClass1; overload; @@ -97,26 +142,42 @@ implementation { TObjMapper } class procedure TObjMapper.Map(aSrcObj : TObject; aTgtObj : TObject; aCustomMapping: TCustomMapping = nil); +begin + Map{$IFNDEF FPC}{$ENDIF}(aSrcObj,aTgtObj,nil,aCustomMapping); +end; + +{$IFNDEF FPC} +class procedure TObjMapper.Map(aSrcObj : TObject; aTgtObj : TObject; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping = nil); +{$ELSE} +class procedure TObjMapper.Map(aSrcObj : TObject; aTgtObj : TObject; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping = nil); +{$ENDIF} var ctx : TRttiContext; rType : TRttiType; tgtprop : TRttiProperty; mapname : string; obj : TObject; + manualmapping : Boolean; + value : TFlexValue; + {$IFNDEF FPC} clname : string; + objvalue : TValue; + {$ENDIF} begin - if aTgtObj = nil then aTgtObj := GetTypeData(aTgtObj.ClassInfo).classType.Create; + //if aTgtObj = nil then aTgtObj := GetTypeData(aTgtObj.ClassInfo).classType.Create; + if aTgtObj = nil then raise EAutoMapperError.Create('TObjMapper: Target Object passed must be created before'); + {$IFNDEF FPC} + objvalue := TValue.From(aSrcObj); + {$ENDIF} rType := ctx.GetType(aSrcObj.ClassInfo); for tgtprop in ctx.GetType(aTgtObj.ClassInfo).GetProperties do begin if tgtprop.IsWritable then begin - if tgtprop.Name = 'Agent' - then Sleep(0); if not tgtprop.PropertyType.IsInstance then begin - if Assigned(aCustomMapping) then + if Assigned(aCustomMapping) and (not Assigned(aDoMappingProc)) then begin if aCustomMapping.GetMap(tgtprop.Name,mapname) then begin @@ -144,11 +205,34 @@ class procedure TObjMapper.Map(aSrcObj : TObject; aTgtObj : TObject; aCustomMapp else begin try - {$IFNDEF FPC} - if rType.GetProperty(tgtprop.Name) <> nil then tgtprop.SetValue(aTgtObj,rType.GetProperty(tgtprop.Name).GetValue(aSrcObj)); - {$ELSE} - if rType.GetProperty(tgtprop.Name) <> nil then SetPropValue(aTgtObj,tgtprop.Name,GetPropValue(aSrcObj,tgtprop.Name)); - {$ENDIF} + if Assigned(aDoMappingProc) then + begin + {$IFNDEF FPC} + aDoMappingProc(objvalue.AsType,tgtprop.Name,value); + manualmapping := not value.IsEmpty; + {$ELSE} + aDoMappingProc(aSrcObj,tgtprop.Name,value); + manualmapping := not varType(value) = varEmpty; + {$ENDIF} + end + else manualmapping := False; + + if manualmapping then + begin + {$IFNDEF FPC} + tgtprop.SetValue(aTgtObj,value); + {$ELSE} + SetPropValue(aTgtObj,tgtprop.Name,value); + {$ENDIF} + end + else + begin + {$IFNDEF FPC} + if rType.GetProperty(tgtprop.Name) <> nil then tgtprop.SetValue(aTgtObj,rType.GetProperty(tgtprop.Name).GetValue(aSrcObj)); + {$ELSE} + if rType.GetProperty(tgtprop.Name) <> nil then SetPropValue(aTgtObj,tgtprop.Name,GetPropValue(aSrcObj,tgtprop.Name)); + {$ENDIF} + end; except on E : Exception do raise EAUtoMapperError.CreateFmt('Error mapping property "%s" : %s',[tgtprop.Name,e.message]); end; @@ -168,8 +252,7 @@ class procedure TObjMapper.Map(aSrcObj : TObject; aTgtObj : TObject; aCustomMapp {$IFNDEF FPC} clname := rType.GetProperty(tgtprop.Name).GetValue(aSrcObj).AsObject.ClassName; if clname.StartsWith('TObjectList') then TObjListMapper.Map(rType.GetProperty(tgtprop.Name).GetValue(aSrcObj).AsObject,obj,aCustomMapping) - else if clname.StartsWith('TList') then TListMapper.Map(rType.GetProperty(tgtprop.Name).GetValue(aSrcObj).AsObject,obj,aCustomMapping) - else TObjMapper.Map(rType.GetProperty(tgtprop.Name).GetValue(aSrcObj).AsObject,obj,aCustomMapping) + else TObjMapper.Map(rType.GetProperty(tgtprop.Name).GetValue(aSrcObj).AsObject,obj,aCustomMapping) {$ELSE} TObjMapper.Map(GetObjectProp(aSrcObj,tgtprop.Name),obj,aCustomMapping); SetObjectProp(aTgtObj,tgtprop.Name,obj); @@ -182,45 +265,93 @@ class procedure TObjMapper.Map(aSrcObj : TObject; aTgtObj : TObject; aCustomMapp end; class function TMapper.Map(aSrcObj : TObject; aCustomMapping: TCustomMapping = nil) : T; +begin + Result := Map{$IFNDEF FPC}{$ENDIF}(aSrcObj,nil,aCustomMapping); +end; + +{$IFNDEF FPC} +class function TMapper.Map(aSrcObj : TObject; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping = nil): T; +{$ELSE} +class function TMapper.Map(aSrcObj : TObject; aDoMappingProc : TMappingProc; aCustomMapping: TCustomMapping = nil): T; +{$ENDIF} var obj : T; begin obj := T.Create; - TObjMapper.Map(aSrcObj,obj,aCustomMapping); + {$IFNDEF FPC} + TObjMapper.Map(aSrcObj,obj,aDoMappingProc,aCustomMapping); + {$ELSE} + TObjMapper.Map(aSrcObj,obj,aDoMappingProc,aCustomMapping); + {$ENDIF} Result := obj; end; class procedure TMapper.Map(aSrcObj : TObject; aTgtObj : T; aCustomMapping : TCustomMapping = nil); begin - TObjMapper.Map(aSrcObj, aTgtObj, aCustomMapping); + {$IFNDEF FPC} + Map(aSrcObj,aTgtObj,nil,aCustomMapping); + {$ELSE} + Map(aSrcObj,aTgtObj,nil,aCustomMapping); + {$ENDIF} end; +{$IFNDEF FPC} +class procedure TMapper.Map(aSrcObj : TObject; aTgtObj : T; aDoMappingProc : TMappingProc; aCustomMapping : TCustomMapping = nil); +{$ELSE} +class procedure TMapper.Map(aSrcObj : TObject; aTgtObj : T; aDoMappingProc : TMappingProc; aCustomMapping : TCustomMapping); +{$ENDIF} +begin + {$IFNDEF FPC} + TObjMapper.Map(aSrcObj, aTgtObj, aDoMappingProc, aCustomMapping); + {$ELSE} + TObjMapper.Map(aSrcObj, aTgtObj, aDoMappingProc, aCustomMapping); + {$ENDIF} +end; + + { TAutoMapper } constructor TAutoMapper.Create; begin fCustomMapping := TCustomMapping.Create; + fOnDoMapping := nil; + fOnAfterMapping := nil; end; destructor TAutoMapper.Destroy; begin if Assigned(fCustomMapping) then fCustomMapping.Free; + fOnDoMapping := nil; + fOnAfterMapping := nil; inherited; end; function TAutoMapper.Map(aSrcObj: TClass1): TClass2; +var + objvalue : TValue; + obj : TObject; begin - Result := TMapper.Map(aSrcObj,fCustomMapping); + obj := aSrcObj as TObject; + //objvalue := TValue.From(aSrcObj).AsObject; + {$IFNDEF FPC} + Result := TMapper.Map(obj,fOnDoMapping,fCustomMapping); + {$ELSE} + Result := TMapper.Map(obj,fOnDoMapping,fCustomMapping); + {$ENDIF} + if Assigned(fOnAfterMapping) then fOnAfterMapping(aSrcObj,Result); end; {$IFNDEF FPC} function TAutoMapper.Map(aSrcObj: TClass2): TClass1; +begin + Result := TMapper.Map(aSrcObj,fOnDoMapping,fCustomMapping); +end; {$ELSE} function TAutoMapper.Map(aSrcObj: TClass2; dummy : Boolean = True): TClass1; -{$ENDIF} begin - Result := TMapper.Map(aSrcObj,fCustomMapping); + Result := TMapper.Map(aSrcObj,fOnDoMapping,fCustomMapping); end; +{$ENDIF} { TCustomMappingFields } @@ -283,11 +414,6 @@ class procedure TListMapper.Map(aSrcList, aTgtList: TObject; aCustomMapping: TCu TObjMapper.Map(value.GetArrayElement(i).AsObject,obj,aCustomMapping); TList(aTgtList).Add(obj); end - else if typinfo.Kind = tkRecord then - begin - valuecop := value.GetArrayElement(i); - //?? - end else begin valuecop := value.GetArrayElement(i); @@ -310,7 +436,16 @@ class procedure TListMapper.Map(aSrcList, aTgtList: TObject; aCustomMapping: TCu { TObjListMapper } class procedure TObjListMapper.Map(aSrcObjList, aTgtObjList: TObject; aCustomMapping: TCustomMapping); +begin + {$IFNDEF FPC} + Map(aSrcObjList,aTgtObjList,nil,aCustomMapping); + {$ELSE} + Map(aSrcObjList,aTgtObjList,nil,aCustomMapping); + {$ENDIF} +end; + {$IFNDEF FPC} +class procedure TObjListMapper.Map(aSrcObjList : TObject; aTgtObjList : TObject; aDoMappingProc : TMappingProc; aCustomMapping : TCustomMapping = nil); var rtype: TRttiType; rtype2 : TRttiType; @@ -336,12 +471,13 @@ class procedure TObjListMapper.Map(aSrcObjList, aTgtObjList: TObject; aCustomMap for i := 0 to value.GetArrayLength - 1 do begin obj := typinfo.TypeData.ClassType.Create; - TObjMapper.Map(value.GetArrayElement(i).AsObject,obj,aCustomMapping); + TObjMapper.Map(value.GetArrayElement(i).AsObject,obj,aDoMappingProc,aCustomMapping); TObjectList(aTgtObjList).Add(obj); end; end; end; {$ELSE} +class procedure TObjListMapper.Map(aSrcObjList : TObject; aTgtObjList : TObject; aDoMappingProc : TMappingProc; aCustomMapping : TCustomMapping = nil); begin end; From b2f1ed3fee92ba25d1d9db0b8007e2f33534d8be Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 6 Apr 2019 17:15:50 +0200 Subject: [PATCH 6/8] JsonSerializer improvements: TObjectList & TXArray output json like TArray --- Quick.Json.Serializer.pas | 173 +++++++++++++++++++++++++++++--------- 1 file changed, 132 insertions(+), 41 deletions(-) diff --git a/Quick.Json.Serializer.pas b/Quick.Json.Serializer.pas index 37c1647..8afec01 100644 --- a/Quick.Json.Serializer.pas +++ b/Quick.Json.Serializer.pas @@ -5,9 +5,9 @@ Unit : Quick.JSON.Serializer Description : Json Serializer Author : Kike Pérez - Version : 1.7 + Version : 1.8 Created : 21/05/2018 - Modified : 20/03/2019 + Modified : 01/04/2019 This file is part of QuickLib: https://github.com/exilon/QuickLib @@ -103,7 +103,12 @@ TRTTIJson = class function GetValue(aAddr: Pointer; aTypeInfo: PTypeInfo): TValue; overload; function IsAllowedProperty(aObject : TObject; const aPropertyName : string) : Boolean; function IsGenericList(aObject : TObject) : Boolean; + function IsGenericXArray(const aClassName : string) : Boolean; function GetPropertyValue(Instance : TObject; const PropertyName : string) : TValue; + function GetPropertyValueFromObject(Instance : TObject; const PropertyName : string) : TValue; + {$IFNDEF FPC} + function GetFieldValueFromRecord(aValue : TValue; const FieldName : string) : TValue; + {$ENDIF} procedure SetPropertyValue(Instance : TObject; aPropInfo : PPropInfo; aValue : TValue); overload; procedure SetPropertyValue(Instance : TObject; const PropertyName : string; aValue : TValue); overload; {$IFDEF FPC} @@ -125,6 +130,7 @@ TRTTIJson = class function DeserializeObject(aObject : TObject; const aJson : TJSONObject) : TObject; overload; {$IFNDEF FPC} function DeserializeList(aObject: TObject; const aName : string; const aJson: TJSONObject) : TObject; + procedure DeserializeXArray(Instance : TObject; aRecord : TValue; aProperty : TRttiProperty; const aPropertyName : string; aJson : TJsonObject); {$ENDIF} function DeserializeProperty(aObject : TObject; const aName : string; aProperty : TRttiProperty; const aJson : TJSONObject) : TObject; overload; {$IFNDEF FPC} @@ -160,6 +166,7 @@ TJsonSerializer = class(TInterfacedObject,IJsonSerializer) function JsonToObject(aType : TClass; const aJson: string) : TObject; overload; function JsonToObject(aObject : TObject; const aJson: string) : TObject; overload; function ObjectToJson(aObject : TObject; aIndent : Boolean = False): string; + function ObjectToJsonString(aObject : TObject; aIndent : Boolean = False): string; end; PPByte = ^PByte; @@ -428,12 +435,6 @@ function TRTTIJson.DeserializeObject(aObject: TObject; const aJson: TJSONObject) if (aJson = nil) or ((aJson as TJSONValue) is TJSONNull) or (aJson.Count = 0) or (Result = nil) then Exit; - //if IsGenericList(aObject) then - //begin - // Result := DeserializeList(Result,aObject.ClassName,aJson); - // Exit; - //end; - try rType := ctx.GetType(aObject.ClassInfo); try @@ -453,6 +454,14 @@ function TRTTIJson.DeserializeObject(aObject: TObject; const aJson: TJSONObject) begin Result := DeserializeList(Result,propertyname,aJson); end + else if (rProp.GetValue(aObject).IsObject) and (IsGenericList(rProp.GetValue(aObject).AsObject)) then + begin + DeserializeList(rProp.GetValue(aObject).AsObject,'List',TJSONObject(aJson.GetValue(propertyname))); + end + else if (not rProp.GetValue(aObject).IsObject) and (IsGenericXArray(rProp.GetValue(aObject){$IFNDEF NEXTGEN}.TypeInfo.Name{$ELSE}.TypeInfo.NameFld.ToString{$ENDIF})) then + begin + DeserializeXArray(Result,rProp.GetValue(aObject),rProp,propertyname,aJson); + end else {$ENDIF} Result := DeserializeProperty(Result,propertyname,rProp,aJson); @@ -486,8 +495,6 @@ function TRTTIJson.DeserializeList(aObject: TObject; const aName : string; const {$ENDIF} begin Result := aObject; - member := GetJsonPairByName(aJson,aName); - //member := TJSONPair(aJson.GetValue(aName)); rType := ctx.GetType(aObject.ClassInfo); try @@ -497,7 +504,9 @@ function TRTTIJson.DeserializeList(aObject: TObject; const aName : string; const ctx.Free; end; - jArray := TJSONObject.ParseJSONValue(member.ToJSON) as TJSONArray; + member := GetJsonPairByName(aJson,aName); + if member = nil then jArray := TJSONObject.ParseJSONValue(aJson.ToJSON) as TJSONArray + else jArray := TJSONObject.ParseJSONValue(member.ToJSON) as TJSONArray; try rvalue := DeserializeDynArray(rProp.PropertyType.Handle,Result,jArray); //i := jarray.Count; @@ -510,6 +519,7 @@ function TRTTIJson.DeserializeList(aObject: TObject; const aName : string; const {$IFDEF DELPHIRX103_UP} if (TObjectList(aObject) <> nil) and (rvalue.IsArray) then begin + TObjectList(aObject).Clear; for i := 0 to rvalue.GetArrayLength - 1 do begin TObjectList(aObject).Add(rvalue.GetArrayElement(i).AsObject); @@ -535,6 +545,42 @@ function TRTTIJson.DeserializeList(aObject: TObject; const aName : string; const end; {$ENDIF} +{$IFNDEF FPC} +procedure TRTTIJson.DeserializeXArray(Instance : TObject; aRecord : TValue; aProperty : TRttiProperty; const aPropertyName : string; aJson : TJsonObject); +var + ctx : TRttiContext; + rRec : TRttiRecordType; + rfield : TRttiField; + rValue : TValue; + member : TJSONPair; + jArray : TJSONArray; +begin + rRec := ctx.GetType(aRecord.TypeInfo).AsRecord; + try + rfield := rRec.GetField('fArray'); + if rfield <> nil then + begin + rValue := nil; + //member := TJSONPair(aJson.GetValue(rField.Name)); + member := GetJsonPairByName(aJson,aPropertyName); + if (member <> nil) and (rField.FieldType.TypeKind = tkDynArray) then + begin + jArray := TJSONObject.ParseJSONValue(member.ToJSON) as TJSONArray; + try + rValue := DeserializeDynArray(rField.FieldType.Handle,nil,jArray); + finally + jArray.Free; + end; + end; + end; + if not rValue.IsEmpty then rField.SetValue(aRecord.GetReferenceToRawData,rValue); + aProperty.SetValue(Instance,aRecord); + finally + ctx.Free; + end; +end; +{$ENDIF} + function TRTTIJson.DeserializeProperty(aObject : TObject; const aName : string; aProperty : TRttiProperty; const aJson : TJSONObject) : TObject; var rValue : TValue; @@ -815,10 +861,17 @@ function TRTTIJson.IsGenericList(aObject : TObject) : Boolean; var cname : string; begin + if aObject = nil then Exit(False); + cname := aObject.ClassName; Result := (cname.StartsWith('TObjectList')) or (cname.StartsWith('TList')); end; +function TRTTIJson.IsGenericXArray(const aClassName : string) : Boolean; +begin + Result := aClassName.StartsWith('TXArray'); +end; + function TRTTIJson.GetJsonPairByName(aJson: TJSONObject; const aName: string): TJSONPair; var candidate : TJSONPair; @@ -834,6 +887,7 @@ function TRTTIJson.GetJsonPairByName(aJson: TJSONObject; const aName: string): T for i := 0 to aJson.Count - 1 do begin candidate := aJson.Pairs[I]; + if candidate.JsonValue = nil then Exit(nil); if CompareText(candidate.JsonString{$IFNDEF FPC}.Value{$ENDIF},aName) = 0 then Exit(TJsonPair(candidate.JsonValue)); end; @@ -884,6 +938,29 @@ function TRTTIJson.GetPropertyValue(Instance : TObject; const PropertyName : str end; end; +function TRTTIJson.GetPropertyValueFromObject(Instance : TObject; const PropertyName : string) : TValue; +var + ctx : TRttiContext; + rprop : TRttiProperty; +begin + rprop := ctx.GetType(Instance.ClassInfo).GetProperty(PropertyName); + Result := rprop.GetValue(Instance); +end; + +{$IFNDEF FPC} +function TRTTIJson.GetFieldValueFromRecord(aValue : TValue; const FieldName : string) : TValue; +var + ctx : TRttiContext; + rec : TRttiRecordType; + rfield : TRttiField; +begin + rec := ctx.GetType(aValue.TypeInfo).AsRecord; + rfield := rec.GetField(FieldName); + if rfield <> nil then Result := rField.GetValue(aValue.GetReferenceToRawData) + else Result := nil; +end; +{$ENDIF} + procedure TRTTIJson.SetPropertyValue(Instance : TObject; const PropertyName : string; aValue : TValue); var pinfo : PPropInfo; @@ -999,27 +1076,25 @@ function TRTTIJson.Serialize(aObject: TObject): TJSONObject; {$IFNDEF FPC} if comment <> '' then Result.AddPair(TJSONPair.Create('#Comment#->'+propertyname,Comment)); {$ENDIF} - //listtype := ctx.GetType(rProp.GetValue(aObject).TypeInfo); - //if (listtype.ClassParent.ClassName.StartsWith('TObjectList')) then - //begin - // jpair := Serialize(propertyname,rProp.GetValue(aObject)); - // Result.AddPair(propertyname,(jpair.JsonValue as TJSONObject).GetValue('List').Clone as TJsonValue); - // jpair.Free; - //listtype := ctx.GetType(rProp.GetValue(aObject).AsObject.ClassInfo); - //listprop := listtype.GetProperty('List'); - //listvalue := listprop.GetValue(aObject); - //jpair := Serialize('Groups',listvalue); - //if jpair <> nil then Result.AddPair(jpair) - // else jpair.Free; - //Exit; - //end - //else begin + if (rProp.GetValue(aObject).IsObject) and (IsGenericList(rProp.GetValue(aObject).AsObject)) then + begin + jpair := Serialize(propertyname,GetPropertyValueFromObject(rProp.GetValue(aObject).AsObject,'List')); + end {$IFNDEF FPC} - jpair := Serialize(propertyname,rProp.GetValue(aObject)); - {$ELSE} - jpair := Serialize(aObject,rProp.PropertyType.TypeKind,propertyname); + else if (not rProp.GetValue(aObject).IsObject) and (IsGenericXArray(rProp.GetValue(aObject){$IFNDEF NEXTGEN}.TypeInfo.Name{$ELSE}.TypeInfo.NameFld.ToString{$ENDIF})) then + begin + jpair := Serialize(propertyname,GetFieldValueFromRecord(rProp.GetValue(aObject),'fArray')); + end {$ENDIF} + else + begin + {$IFNDEF FPC} + jpair := Serialize(propertyname,rProp.GetValue(aObject)); + {$ELSE} + jpair := Serialize(aObject,rProp.PropertyType.TypeKind,propertyname); + {$ENDIF} + end; //s := jpair.JsonValue.ToString; if jpair <> nil then begin @@ -1078,19 +1153,22 @@ function TRTTIJson.Serialize(const aName : string; aValue : TValue) : TJSONPair; try for i := 0 to aValue.GetArrayLength - 1 do begin - jValue := nil; - jPair := Serialize(aName,GetValue(PPByte(aValue.GetReferenceToRawData)^ + rDynArray.ElementType.TypeSize * i, rDynArray.ElementType)); - try - //jValue := TJsonValue(jPair.JsonValue.Clone); - jValue := jPair.JsonValue; - if jValue <> nil then - begin - jArray.AddElement(jValue); - jPair.JsonValue.Owned := False; + if not GetValue(PPByte(aValue.GetReferenceToRawData)^ + rDynArray.ElementType.TypeSize * i, rDynArray.ElementType).IsEmpty then + begin + jValue := nil; + jPair := Serialize(aName,GetValue(PPByte(aValue.GetReferenceToRawData)^ + rDynArray.ElementType.TypeSize * i, rDynArray.ElementType)); + try + //jValue := TJsonValue(jPair.JsonValue.Clone); + jValue := jPair.JsonValue; + if jValue <> nil then + begin + jArray.AddElement(jValue); + jPair.JsonValue.Owned := False; + end; + finally + jPair.Free; + if jValue <> nil then jValue.Owned := True; end; - finally - jPair.Free; - if jValue <> nil then jValue.Owned := True; end; end; Result.JsonValue := jArray; @@ -1482,6 +1560,19 @@ function TJsonSerializer.ObjectToJson(aObject : TObject; aIndent : Boolean = Fal end; end; +function TJsonSerializer.ObjectToJsonString(aObject : TObject; aIndent : Boolean = False): string; +var + json: TJSONObject; +begin + json := fRTTIJson.Serialize(aObject); + try + Result := json.ToString; + if aIndent then Result := TJsonUtils.JsonFormat(Result); + finally + json.Free; + end; +end; + procedure TJsonSerializer.SetUseEnumNames(const Value: Boolean); begin fUseEnumNames := Value; From 7739dc2ac56c8d218dceb4fdbc0a3d504492b323 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 6 Apr 2019 17:19:20 +0200 Subject: [PATCH 7/8] samples updated --- .../delphi/QuickArrayHelper/ArrayHelpers.dpr | 38 + .../QuickArrayHelper/ArrayHelpers.dproj | 678 +++++++++++++ .../FlexArrays/ManageFlexArray.dpr | 46 + .../FlexArrays/ManageFlexArray.dproj | 678 +++++++++++++ .../FlexPairArrays/ManageFlexPairArray.dpr | 47 + .../FlexPairArrays/ManageFlexPairArray.dproj | 680 +++++++++++++ .../QuickArrays/ManageArrays/ManageArrays.dpr | 56 ++ .../ManageArrays/ManageArrays.dproj | 678 +++++++++++++ .../QuickAutoMapper/AutoMappingObjects.dpr | 18 + .../QuickAutoMapper/AutoMappingObjects.dproj | 2 +- .../JsonSerializerTest/JsonSerializerTest.dpr | 125 +++ .../JsonSerializerTest.dproj | 687 +++++++++++++ .../JsonSerializerTest2/JsonSerializer.dpr | 15 + .../JsonSerializerTest2/JsonSerializer.dproj | 899 ++++++++++++++++++ .../JsonSerializerTest2/frmMain.fmx | 43 + .../JsonSerializerTest2/main.fmx | 39 + .../JsonSerializerTest2/main.pas | 273 ++++++ .../AutoMapperObjects.deployproj | 230 ++++- .../QuickAutoMapper/AutoMapperObjects.dproj | 169 +++- samples/firemonkey/QuickAutoMapper/Main.pas | 12 +- .../ConfigToFile/ConfigToFile.deployproj | 241 +++-- .../ConfigToFile/ConfigToFile.dproj | 162 +++- .../JsonSerializerTest1.lpi | 60 ++ .../JsonSerializerTest1.lpr | 124 +++ samples/fpc/QuickArrayHelper/ArrayHelpers.lpi | 60 ++ samples/fpc/QuickArrayHelper/ArrayHelpers.pas | 35 + .../FlexArrays/ManageFlexArrays.lpi | 60 ++ .../FlexArrays/ManageFlexArrays.lpr | 44 + .../FlexPairArrays/ManageFlexPairArrays.lpi | 60 ++ .../FlexPairArrays/ManageFlexPairArrays.lpr | 48 + .../ManageXArrays/ManageArrays.lpi | 60 ++ .../ManageXArrays/ManageArrays.pas | 57 ++ .../fpc/QuickAutoMapper/AutoMapperObjects.lpr | 37 +- 33 files changed, 6329 insertions(+), 132 deletions(-) create mode 100644 samples/delphi/QuickArrayHelper/ArrayHelpers.dpr create mode 100644 samples/delphi/QuickArrayHelper/ArrayHelpers.dproj create mode 100644 samples/delphi/QuickArrays/FlexArrays/ManageFlexArray.dpr create mode 100644 samples/delphi/QuickArrays/FlexArrays/ManageFlexArray.dproj create mode 100644 samples/delphi/QuickArrays/FlexPairArrays/ManageFlexPairArray.dpr create mode 100644 samples/delphi/QuickArrays/FlexPairArrays/ManageFlexPairArray.dproj create mode 100644 samples/delphi/QuickArrays/ManageArrays/ManageArrays.dpr create mode 100644 samples/delphi/QuickArrays/ManageArrays/ManageArrays.dproj create mode 100644 samples/delphi/QuickJsonSerializer/JsonSerializerTest/JsonSerializerTest.dpr create mode 100644 samples/delphi/QuickJsonSerializer/JsonSerializerTest/JsonSerializerTest.dproj create mode 100644 samples/delphi/QuickJsonSerializer/JsonSerializerTest2/JsonSerializer.dpr create mode 100644 samples/delphi/QuickJsonSerializer/JsonSerializerTest2/JsonSerializer.dproj create mode 100644 samples/delphi/QuickJsonSerializer/JsonSerializerTest2/frmMain.fmx create mode 100644 samples/delphi/QuickJsonSerializer/JsonSerializerTest2/main.fmx create mode 100644 samples/delphi/QuickJsonSerializer/JsonSerializerTest2/main.pas create mode 100644 samples/fpc/JsonSerializerTest1/JsonSerializerTest1.lpi create mode 100644 samples/fpc/JsonSerializerTest1/JsonSerializerTest1.lpr create mode 100644 samples/fpc/QuickArrayHelper/ArrayHelpers.lpi create mode 100644 samples/fpc/QuickArrayHelper/ArrayHelpers.pas create mode 100644 samples/fpc/QuickArrays/FlexArrays/ManageFlexArrays.lpi create mode 100644 samples/fpc/QuickArrays/FlexArrays/ManageFlexArrays.lpr create mode 100644 samples/fpc/QuickArrays/FlexPairArrays/ManageFlexPairArrays.lpi create mode 100644 samples/fpc/QuickArrays/FlexPairArrays/ManageFlexPairArrays.lpr create mode 100644 samples/fpc/QuickArrays/ManageXArrays/ManageArrays.lpi create mode 100644 samples/fpc/QuickArrays/ManageXArrays/ManageArrays.pas diff --git a/samples/delphi/QuickArrayHelper/ArrayHelpers.dpr b/samples/delphi/QuickArrayHelper/ArrayHelpers.dpr new file mode 100644 index 0000000..0fac5f6 --- /dev/null +++ b/samples/delphi/QuickArrayHelper/ArrayHelpers.dpr @@ -0,0 +1,38 @@ +program ArrayHelpers; + +{$APPTYPE CONSOLE} + +{$R *.res} + +uses + System.SysUtils, + Quick.Commons, + Quick.Console, + Quick.Arrays.Helper; + +var + + myarray : TArray; + +begin + try + ReportMemoryLeaksOnShutdown := True; + + myarray.Add('one'); + myarray.Add('two'); + myarray.Add('three'); + coutFmt('count: %d',[myarray.Count],etInfo); + if myarray.Contains('two') then cout('found "two" in array',etInfo) + else cout('not found',etInfo); + + coutFmt('"three" in position %d',[myarray.IndexOf('three')],etInfo); + + TArrayHelper.Add(myarray,'Four'); + + cout('Press to Exit',ccYellow); + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/delphi/QuickArrayHelper/ArrayHelpers.dproj b/samples/delphi/QuickArrayHelper/ArrayHelpers.dproj new file mode 100644 index 0000000..cb637f6 --- /dev/null +++ b/samples/delphi/QuickArrayHelper/ArrayHelpers.dproj @@ -0,0 +1,678 @@ + + + {4594DE3D-BC84-4B2A-9E88-DBB1FB897360} + 18.6 + None + ArrayHelpers.dpr + True + Debug + Win32 + 1 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + ArrayHelpers + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;CoolTrayIcon_D210_XE7;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services-ads-7.0.0.dex.jar;google-play-services-analytics-7.0.0.dex.jar;google-play-services-base-7.0.0.dex.jar;google-play-services-gcm-7.0.0.dex.jar;google-play-services-identity-7.0.0.dex.jar;google-play-services-maps-7.0.0.dex.jar;google-play-services-panorama-7.0.0.dex.jar;google-play-services-plus-7.0.0.dex.jar;google-play-services-wallet-7.0.0.dex.jar + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;UbuntuProgressPackage;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;JvGlobus;FireDACADSDriver;JvPluginSystem;tmswizdXE12;DBXMSSQLDriver;JvMM;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;JvBands;vcldb;bindcompfmx;svn;JvJans;DBXOracleDriver;JvNet;inetdb;JvAppFrm;FmxTeeUI;emsedge;JvDotNetCtrls;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;JvWizards;FireDACDBXDriver;dbexpress;IndyCore;vclx;JvPageComps;dsnap;DataSnapCommon;emsclient;FireDACCommon;JvDB;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;JvCmp;JvHMI;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;GR32_D;JvCustom;vcl;IndyIPServer;DBXSybaseASEDriver;JvXPCtrls;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;Jcl;JvCore;emshosting;JvCrypt;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;JvDlgs;JvRuntimeDesign;ibxpress;Tee;JvManagedThreads;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;JvTimeFramework;JvSystem;JvStdCtrls;tmsexdXE12;bindcomp;appanalytics;CoolTrayIcon_D210_XE7;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;JvDocking;dbxcds;VclSmp;KernowSoftwareFMX;adortl;FireDACODBCDriver;JvPascalInterpreter;TMSFMXPackPkgDXE12;JclVcl;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;JvControls;JvPrintPreview;Analog_XE7;JclContainers;fmxase;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;IndyIPServer;DBXSybaseASEDriver;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;tmsexdXE12;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + Application + + + + ArrayHelpers.dpr + + + + + + true + + + + + true + + + + + true + + + + + true + + + + + true + + + + + ArrayHelpers.exe + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 1 + + + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\values-v21 + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + False + False + False + False + False + True + False + + + 12 + + + + + diff --git a/samples/delphi/QuickArrays/FlexArrays/ManageFlexArray.dpr b/samples/delphi/QuickArrays/FlexArrays/ManageFlexArray.dpr new file mode 100644 index 0000000..6c224b6 --- /dev/null +++ b/samples/delphi/QuickArrays/FlexArrays/ManageFlexArray.dpr @@ -0,0 +1,46 @@ +program ManageFlexArray; + +{$APPTYPE CONSOLE} + +{$R *.res} + +uses + System.SysUtils, + Quick.Commons, + Quick.Console, + Quick.Arrays; + +type + TUser = class + private + fName : string; + public + property Name : string read fName write fName; + end; + +var + xarThings : TFlexArray; + user : TUser; + +begin + try + xarThings.Add(10); + xarThings.Add('Hello'); + user := TUser.Create; + try + user.Name := 'Joe'; + xarThings.Add(user); + + cout('Integer Item = %d',[xarThings[0].AsInteger],etInfo); + cout('String Item = %s',[xarThings[1].AsString],etInfo); + cout('Record Item = %s',[TUser(xarThings[2]).Name],etInfo); + finally + user.Free; + end; + cout('Press to Exit',ccYellow); + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/delphi/QuickArrays/FlexArrays/ManageFlexArray.dproj b/samples/delphi/QuickArrays/FlexArrays/ManageFlexArray.dproj new file mode 100644 index 0000000..d5af3e1 --- /dev/null +++ b/samples/delphi/QuickArrays/FlexArrays/ManageFlexArray.dproj @@ -0,0 +1,678 @@ + + + {D9DCB399-8BA2-4CC9-81F9-77B5B4ED663D} + 18.6 + None + ManageFlexArray.dpr + True + Debug + Win32 + 1 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + ManageFlexArray + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;CoolTrayIcon_D210_XE7;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services-ads-7.0.0.dex.jar;google-play-services-analytics-7.0.0.dex.jar;google-play-services-base-7.0.0.dex.jar;google-play-services-gcm-7.0.0.dex.jar;google-play-services-identity-7.0.0.dex.jar;google-play-services-maps-7.0.0.dex.jar;google-play-services-panorama-7.0.0.dex.jar;google-play-services-plus-7.0.0.dex.jar;google-play-services-wallet-7.0.0.dex.jar + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;UbuntuProgressPackage;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;JvGlobus;FireDACADSDriver;JvPluginSystem;tmswizdXE12;DBXMSSQLDriver;JvMM;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;JvBands;vcldb;bindcompfmx;svn;JvJans;DBXOracleDriver;JvNet;inetdb;JvAppFrm;FmxTeeUI;emsedge;JvDotNetCtrls;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;JvWizards;FireDACDBXDriver;dbexpress;IndyCore;vclx;JvPageComps;dsnap;DataSnapCommon;emsclient;FireDACCommon;JvDB;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;JvCmp;JvHMI;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;GR32_D;JvCustom;vcl;IndyIPServer;DBXSybaseASEDriver;JvXPCtrls;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;Jcl;JvCore;emshosting;JvCrypt;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;JvDlgs;JvRuntimeDesign;ibxpress;Tee;JvManagedThreads;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;JvTimeFramework;JvSystem;JvStdCtrls;tmsexdXE12;bindcomp;appanalytics;CoolTrayIcon_D210_XE7;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;JvDocking;dbxcds;VclSmp;KernowSoftwareFMX;adortl;FireDACODBCDriver;JvPascalInterpreter;TMSFMXPackPkgDXE12;JclVcl;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;JvControls;JvPrintPreview;Analog_XE7;JclContainers;fmxase;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;IndyIPServer;DBXSybaseASEDriver;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;tmsexdXE12;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + Application + + + + ManageFlexArray.dpr + + + + + + true + + + + + true + + + + + true + + + + + true + + + + + true + + + + + ManageFlexArray.exe + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 1 + + + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\values-v21 + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + False + False + False + False + False + True + False + + + 12 + + + + + diff --git a/samples/delphi/QuickArrays/FlexPairArrays/ManageFlexPairArray.dpr b/samples/delphi/QuickArrays/FlexPairArrays/ManageFlexPairArray.dpr new file mode 100644 index 0000000..a338d48 --- /dev/null +++ b/samples/delphi/QuickArrays/FlexPairArrays/ManageFlexPairArray.dpr @@ -0,0 +1,47 @@ +program ManageFlexPairArray; + +{$APPTYPE CONSOLE} + +{$R *.res} + +uses + System.SysUtils, + Quick.Commons, + Quick.Console, + Quick.Arrays; + +type + TUser = class + private + fName : string; + public + property Name : string read fName write fName; + end; + +var + flexarray : TFlexPairArray; + user : TUser; + +begin + try + flexarray.Add('onenumber',10); + flexarray.Add('other','Hello boy!'); + user := TUser.Create; + try + user.Name := 'Joe'; + flexarray.Add('myuser',user); + + cout('Integer Item = %d',[flexarray.GetValue('onenumber').AsInteger],etInfo); + cout('String Item = %s',[flexarray.GetValue('other').AsString],etInfo); + cout('Record Item = %s',[TUser(flexarray.GetValue('myuser')).Name],etInfo); + finally + user.Free; + end; + + cout('Press to Exit',ccYellow); + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/delphi/QuickArrays/FlexPairArrays/ManageFlexPairArray.dproj b/samples/delphi/QuickArrays/FlexPairArrays/ManageFlexPairArray.dproj new file mode 100644 index 0000000..4a096d7 --- /dev/null +++ b/samples/delphi/QuickArrays/FlexPairArrays/ManageFlexPairArray.dproj @@ -0,0 +1,680 @@ + + + {D9DCB399-8BA2-4CC9-81F9-77B5B4ED663D} + 18.6 + None + ManageFlexPairArray.dpr + True + Debug + Win32 + 5 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + ManageFlexPairArray + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;CoolTrayIcon_D210_XE7;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services-ads-7.0.0.dex.jar;google-play-services-analytics-7.0.0.dex.jar;google-play-services-base-7.0.0.dex.jar;google-play-services-gcm-7.0.0.dex.jar;google-play-services-identity-7.0.0.dex.jar;google-play-services-maps-7.0.0.dex.jar;google-play-services-panorama-7.0.0.dex.jar;google-play-services-plus-7.0.0.dex.jar;google-play-services-wallet-7.0.0.dex.jar + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts + Debug + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;UbuntuProgressPackage;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;JvGlobus;FireDACADSDriver;JvPluginSystem;tmswizdXE12;DBXMSSQLDriver;JvMM;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;JvBands;vcldb;bindcompfmx;svn;JvJans;DBXOracleDriver;JvNet;inetdb;JvAppFrm;FmxTeeUI;emsedge;JvDotNetCtrls;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;JvWizards;FireDACDBXDriver;dbexpress;IndyCore;vclx;JvPageComps;dsnap;DataSnapCommon;emsclient;FireDACCommon;JvDB;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;JvCmp;JvHMI;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;GR32_D;JvCustom;vcl;IndyIPServer;DBXSybaseASEDriver;JvXPCtrls;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;Jcl;JvCore;emshosting;JvCrypt;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;JvDlgs;JvRuntimeDesign;ibxpress;Tee;JvManagedThreads;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;JvTimeFramework;JvSystem;JvStdCtrls;tmsexdXE12;bindcomp;appanalytics;CoolTrayIcon_D210_XE7;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;JvDocking;dbxcds;VclSmp;KernowSoftwareFMX;adortl;FireDACODBCDriver;JvPascalInterpreter;TMSFMXPackPkgDXE12;JclVcl;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;JvControls;JvPrintPreview;Analog_XE7;JclContainers;fmxase;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;IndyIPServer;DBXSybaseASEDriver;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;tmsexdXE12;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + Application + + + + ManageFlexPairArray.dpr + + + + + + true + + + + + true + + + + + true + + + + + true + + + + + true + + + + + ManageFlexPairArray.exe + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 1 + + + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\values-v21 + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + False + False + False + False + True + True + False + + + 12 + + + + + diff --git a/samples/delphi/QuickArrays/ManageArrays/ManageArrays.dpr b/samples/delphi/QuickArrays/ManageArrays/ManageArrays.dpr new file mode 100644 index 0000000..2c8b793 --- /dev/null +++ b/samples/delphi/QuickArrays/ManageArrays/ManageArrays.dpr @@ -0,0 +1,56 @@ +program ManageArrays; + +{$APPTYPE CONSOLE} + +{$R *.res} + +uses + System.SysUtils, + Quick.Commons, + Quick.Console, + Quick.Arrays; + +type + + TUser = record + Name : string; + Age : Integer; + end; + +var + userarray : TXArray; + user : TUser; + normalarray : TArray; + +begin + try + ReportMemoryLeaksOnShutdown := True; + + user.Name := 'Joe'; + user.Age := 30; + userarray.Add(user); + user.Name := 'Peter'; + user.Age := 32; + userarray.Add(user); + user.Name := 'James'; + user.Age := 40; + userarray.Add(user); + + if userarray.Contains(user) then cout('found user in array',etInfo); + + for user in userarray do + begin + coutFmt('User: %s',[user.Name],etInfo); + end; + + normalarray := userarray; + + coutFmt('Copied array value 1: %s',[normalarray[1].Name],etInfo); + + cout('Press to Exit',ccYellow); + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/delphi/QuickArrays/ManageArrays/ManageArrays.dproj b/samples/delphi/QuickArrays/ManageArrays/ManageArrays.dproj new file mode 100644 index 0000000..18a0d5b --- /dev/null +++ b/samples/delphi/QuickArrays/ManageArrays/ManageArrays.dproj @@ -0,0 +1,678 @@ + + + {4594DE3D-BC84-4B2A-9E88-DBB1FB897360} + 18.6 + None + ManageArrays.dpr + True + Debug + Win32 + 1 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + ManageArrays + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;CoolTrayIcon_D210_XE7;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services-ads-7.0.0.dex.jar;google-play-services-analytics-7.0.0.dex.jar;google-play-services-base-7.0.0.dex.jar;google-play-services-gcm-7.0.0.dex.jar;google-play-services-identity-7.0.0.dex.jar;google-play-services-maps-7.0.0.dex.jar;google-play-services-panorama-7.0.0.dex.jar;google-play-services-plus-7.0.0.dex.jar;google-play-services-wallet-7.0.0.dex.jar + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;UbuntuProgressPackage;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;JvGlobus;FireDACADSDriver;JvPluginSystem;tmswizdXE12;DBXMSSQLDriver;JvMM;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;JvBands;vcldb;bindcompfmx;svn;JvJans;DBXOracleDriver;JvNet;inetdb;JvAppFrm;FmxTeeUI;emsedge;JvDotNetCtrls;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;JvWizards;FireDACDBXDriver;dbexpress;IndyCore;vclx;JvPageComps;dsnap;DataSnapCommon;emsclient;FireDACCommon;JvDB;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;JvCmp;JvHMI;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;GR32_D;JvCustom;vcl;IndyIPServer;DBXSybaseASEDriver;JvXPCtrls;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;Jcl;JvCore;emshosting;JvCrypt;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;JvDlgs;JvRuntimeDesign;ibxpress;Tee;JvManagedThreads;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;JvTimeFramework;JvSystem;JvStdCtrls;tmsexdXE12;bindcomp;appanalytics;CoolTrayIcon_D210_XE7;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;JvDocking;dbxcds;VclSmp;KernowSoftwareFMX;adortl;FireDACODBCDriver;JvPascalInterpreter;TMSFMXPackPkgDXE12;JclVcl;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;JvControls;JvPrintPreview;Analog_XE7;JclContainers;fmxase;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;IndyIPServer;DBXSybaseASEDriver;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;tmsexdXE12;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + Application + + + + ManageArrays.dpr + + + + + + true + + + + + true + + + + + true + + + + + true + + + + + true + + + + + ManageArrays.exe + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 1 + + + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\values-v21 + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + False + False + False + False + False + True + False + + + 12 + + + + + diff --git a/samples/delphi/QuickAutoMapper/AutoMappingObjects.dpr b/samples/delphi/QuickAutoMapper/AutoMappingObjects.dpr index 46b522d..fdef5e9 100644 --- a/samples/delphi/QuickAutoMapper/AutoMappingObjects.dpr +++ b/samples/delphi/QuickAutoMapper/AutoMappingObjects.dpr @@ -189,8 +189,26 @@ begin //User2 := TMapper.Map(User); AutoMapper := TAutoMapper.Create; try + + //option1: you can define auto map different named properties AutoMapper.CustomMapping.AddMap('Cash','Money'); AutoMapper.CustomMapping.AddMap('Id','IdUser'); + + //option2: you can decide to modify each property manually or allow to auto someones + AutoMapper.OnDoMapping := procedure(const aSrcObj : TUser; const aTargetName : string; out Value : TFlexValue) + begin + if aTargetName = 'Money' then Value := aSrcObj.Cash * 2 + else if aTargetName = 'IdUser' then Value := aSrcObj.Id; + end; + + //option3: you can modify some properties after automapping done + AutoMapper.OnAfterMapping := procedure(const aSrcObj : TUser; aTgtObj : TUser2) + begin + aTgtObj.Money := aSrcObj.Cash * 2; + aTgtObj.IdUser := aSrcObj.Id; + end; + + User2 := AutoMapper.Map(User); //User2 := TUser2.Create; //User.MapTo(User2); diff --git a/samples/delphi/QuickAutoMapper/AutoMappingObjects.dproj b/samples/delphi/QuickAutoMapper/AutoMappingObjects.dproj index 397638e..48d9552 100644 --- a/samples/delphi/QuickAutoMapper/AutoMappingObjects.dproj +++ b/samples/delphi/QuickAutoMapper/AutoMappingObjects.dproj @@ -1,7 +1,7 @@  {3F29272C-7851-41C3-B29E-C0ACD8029C21} - 18.5 + 18.6 None AutoMappingObjects.dpr True diff --git a/samples/delphi/QuickJsonSerializer/JsonSerializerTest/JsonSerializerTest.dpr b/samples/delphi/QuickJsonSerializer/JsonSerializerTest/JsonSerializerTest.dpr new file mode 100644 index 0000000..28192db --- /dev/null +++ b/samples/delphi/QuickJsonSerializer/JsonSerializerTest/JsonSerializerTest.dpr @@ -0,0 +1,125 @@ +program JsonSerializerTest; + +{$APPTYPE CONSOLE} + +{$R *.res} + +uses + System.SysUtils, + System.Generics.Collections, + Quick.Commons, + Quick.Console, + Quick.Json.Serializer; + +type + THost = class + private + fName : string; + fIP : string; + fPort : Integer; + published + property Name : string read fName write fName; + property IP : string read fIP write fIP; + property Port : Integer read fPort write fPort; + end; + + THostList = TObjectList; + + TConfig = class + private + fHosts : THostList; + fDebugMode : Boolean; + fLevel : Integer; + published + constructor Create; + destructor Destroy; override; + property Hosts : THostList read fHosts write fHosts; + property DebugMode : Boolean read fDebugMode write fDebugMode; + property Level : Integer read fLevel write fLevel; + end; + +const + jsonstring = '{"Hosts":[{"Name":"Host 1 año perfeción","IP":"127.0.0.1","Port":80},{"Name":"Host 2","IP":"192.168.1.1","Port":443}],"DebugMode":true,"Level":1}'; + jsonstring2 = '{"Hosts":{"List":[{"Name":"Host 1","IP":"127.0.0.2","Port":80},{"Name":"Host 2","IP":"192.168.1.2","Port":443}]},"DebugMode":true,"Level":2}'; + +var + config : TConfig; + host : THost; + serializer : TJsonSerializer; + json : string; + +{ TConfig } + +constructor TConfig.Create; +begin + fHosts := THostList.Create(True); +end; + +destructor TConfig.Destroy; +begin + fHosts.Free; + inherited; +end; + +begin + try + serializer := TJsonSerializer.Create(slPublishedProperty); + try + + //created from object + cout('Create from object',ccYellow); + config := TConfig.Create; + try + host := THost.Create; + host.Name := 'Host 1'; + host.IP := '127.0.0.1'; + host.Port := 80; + config.DebugMode := True; + config.Level := 1; + config.Hosts.Add(host); + + host := THost.Create; + host.Name := 'Host 2'; + host.IP := '192.168.1.1'; + host.Port := 443; + config.Hosts.Add(host); + + json := serializer.ObjectToJson(config,True); + cout(json,ccWhite); + coutFmt('Capacity: %d / Count: %d',[config.Hosts.Capacity,config.Hosts.Count],etInfo); + finally + config.Free; + end; + + //from json string without list property + cout('Create from jsonstring without "List" property',ccYellow); + config := TConfig.Create; + try + serializer.JsonToObject(config,jsonstring); + json := serializer.ObjectToJson(config,True); + cout(json,ccWhite); + coutFmt('Capacity: %d / Count: %d',[config.Hosts.Capacity,config.Hosts.Count],etInfo); + finally + config.Free; + end; + + //from json string with list property + cout('Create from jsonstring with "List" property',ccYellow); + config := TConfig.Create; + try + serializer.JsonToObject(config,jsonstring2); + json := serializer.ObjectToJson(config,True); + cout(json,ccWhite); + coutFmt('Capacity: %d / Count: %d',[config.Hosts.Capacity,config.Hosts.Count],etInfo); + finally + config.Free; + end; + finally + serializer.Free; + end; + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/delphi/QuickJsonSerializer/JsonSerializerTest/JsonSerializerTest.dproj b/samples/delphi/QuickJsonSerializer/JsonSerializerTest/JsonSerializerTest.dproj new file mode 100644 index 0000000..2a3a9b8 --- /dev/null +++ b/samples/delphi/QuickJsonSerializer/JsonSerializerTest/JsonSerializerTest.dproj @@ -0,0 +1,687 @@ + + + {1E6AF047-A308-4453-8889-BF6630FA9D12} + 18.6 + None + JsonSerializerTest.dpr + True + Debug + Win32 + 5 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + JsonSerializerTest + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;CoolTrayIcon_D210_XE7;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services-ads-7.0.0.dex.jar;google-play-services-analytics-7.0.0.dex.jar;google-play-services-base-7.0.0.dex.jar;google-play-services-gcm-7.0.0.dex.jar;google-play-services-identity-7.0.0.dex.jar;google-play-services-maps-7.0.0.dex.jar;google-play-services-panorama-7.0.0.dex.jar;google-play-services-plus-7.0.0.dex.jar;google-play-services-wallet-7.0.0.dex.jar + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts + Debug + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;UbuntuProgressPackage;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;JvGlobus;FireDACADSDriver;JvPluginSystem;tmswizdXE12;DBXMSSQLDriver;JvMM;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;JvBands;vcldb;bindcompfmx;svn;JvJans;DBXOracleDriver;JvNet;inetdb;JvAppFrm;FmxTeeUI;emsedge;JvDotNetCtrls;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;JvWizards;FireDACDBXDriver;dbexpress;IndyCore;vclx;JvPageComps;dsnap;DataSnapCommon;emsclient;FireDACCommon;JvDB;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;JvCmp;JvHMI;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;GR32_D;JvCustom;vcl;IndyIPServer;DBXSybaseASEDriver;JvXPCtrls;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;Jcl;JvCore;emshosting;JvCrypt;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;JvDlgs;JvRuntimeDesign;ibxpress;Tee;JvManagedThreads;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;JvTimeFramework;JvSystem;JvStdCtrls;tmsexdXE12;bindcomp;appanalytics;CoolTrayIcon_D210_XE7;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;JvDocking;dbxcds;VclSmp;KernowSoftwareFMX;adortl;FireDACODBCDriver;JvPascalInterpreter;TMSFMXPackPkgDXE12;JclVcl;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;JvControls;JvPrintPreview;Analog_XE7;JclContainers;fmxase;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;FireDACIBDriver;fmx;fmxdae;vclib;FlatButtonSet;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;IndyIPServer;DBXSybaseASEDriver;PngComponents;IndySystem;FireDACDb2Driver;dsnapcon;tmsxlsdXE12;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;tmsdXE12;FireDACTDataDriver;DBXOdbcDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;emsserverresource;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;GR32_R;CustomIPTransport;vcldsnap;tmsexdXE12;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + Application + + + + JsonSerializerTest.dpr + + + + + + true + + + + + Contents\MacOS\ + JsonSerializerTest.rsm + true + + + + + true + + + + + true + + + + + true + + + + + true + + + + + JsonSerializerTest + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 1 + + + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\values-v21 + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + False + False + False + False + True + True + False + + + 12 + + + + + diff --git a/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/JsonSerializer.dpr b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/JsonSerializer.dpr new file mode 100644 index 0000000..65220c3 --- /dev/null +++ b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/JsonSerializer.dpr @@ -0,0 +1,15 @@ +program JsonSerializer; + +uses + System.StartUpCopy, + FMX.Forms, + main in 'main.pas' {Form1}; + +{$R *.res} + +begin + ReportMemoryLeaksOnShutdown := True; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/JsonSerializer.dproj b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/JsonSerializer.dproj new file mode 100644 index 0000000..8886555 --- /dev/null +++ b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/JsonSerializer.dproj @@ -0,0 +1,899 @@ + + + {9C6576EF-31E8-4604-A9A1-B9FAC5DBF05A} + JsonSerializer.dpr + True + Debug + 7 + Application + FMX + 18.6 + Win64 + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + false + false + false + false + false + 00400000 + JsonSerializer + 3082 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + $(BDS)\bin\delphi_PROJECTICON.ico + $(BDS)\bin\delphi_PROJECTICNS.icns + .\bin\$(Platform)\$(Config) + .\bin\$(Platform)\$(Config)\dcu + + + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + true + true + true + true + true + true + true + true + true + true + android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services-ads-7.0.0.dex.jar;google-play-services-analytics-7.0.0.dex.jar;google-play-services-base-7.0.0.dex.jar;google-play-services-identity-7.0.0.dex.jar;google-play-services-maps-7.0.0.dex.jar;google-play-services-panorama-7.0.0.dex.jar;google-play-services-plus-7.0.0.dex.jar;google-play-services-wallet-7.0.0.dex.jar + + + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera + iPhoneAndiPad + true + Debug + $(MSBuildProjectName) + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_750x1334.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2208.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2208x1242.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1125x2436.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2436x1125.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_828x1792.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1136x640.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2688.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1334x750.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1792x828.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2688x1242.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_83.5x83.5.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2224.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2388.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_2048x2732.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2224x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2388x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2732x2048.png + + + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_750x1334.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2208.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2208x1242.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1125x2436.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2436x1125.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_828x1792.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1136x640.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2688.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1334x750.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1792x828.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2688x1242.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_83.5x83.5.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2224.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2388.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_2048x2732.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2224x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2388x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2732x2048.png + + + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera + iPhoneAndiPad + true + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_750x1334.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2208.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2208x1242.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1125x2436.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2436x1125.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_828x1792.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1136x640.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2688.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1334x750.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1792x828.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2688x1242.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_83.5x83.5.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2224.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2388.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_2048x2732.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2224x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2388x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2732x2048.png + + + $(BDS)\bin\delphi_PROJECTICNS.icns + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts + Debug + true + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + + + RELEASE;$(DCC_Define) + 0 + false + 0 + + + true + PerMonitor + + + true + PerMonitorV2 + + + DEBUG;$(DCC_Define) + false + true + + + true + + + Debug + + + true + + + $(BDS)\bin\delphi_PROJECTICNS.icns + true + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts + + + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + PerMonitor + true + 1033 + + + true + PerMonitorV2 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + + + + + JsonSerializer.dpr + + + DBExpress Enterprise Data Explorer Integration + Embarcadero C++Builder Office 2000 Servers Package + Embarcadero C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + File C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\AdvChartDXE12.bpl not found + File C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\AdvChartDEDXE12.bpl not found + File C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\vcwDXE12.bpl not found + File C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\vcwdeDXE12.bpl not found + File C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\TMSFMXPackPkgDEDXE12.bpl not found + + + + False + False + False + False + True + True + True + + + + + true + + + + + true + + + + + Info.plist + true + + + + + true + + + + + true + + + + + true + + + + + JsonSerializer + true + + + + + JsonSerializer.icns + true + + + + + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 1 + + + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\values-v21 + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + 12 + + + + +
diff --git a/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/frmMain.fmx b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/frmMain.fmx new file mode 100644 index 0000000..6b3910b --- /dev/null +++ b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/frmMain.fmx @@ -0,0 +1,43 @@ +object Form1: TForm1 + Left = 0 + Top = 0 + Caption = 'Form1' + ClientHeight = 552 + ClientWidth = 750 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + OnCreate = FormCreate + OnClose = FormClose + DesignerMasterStyle = 0 + object Memo1: TMemo + Touch.InteractiveGestures = [Pan, LongTap, DoubleTap] + DataDetectorTypes = [] + Anchors = [akLeft, akTop, akRight, akBottom] + Position.X = 8.000000000000000000 + Position.Y = 8.000000000000000000 + Size.Width = 737.000000000000000000 + Size.Height = 497.000000000000000000 + Size.PlatformDefault = False + TabOrder = 0 + Viewport.Width = 733.000000000000000000 + Viewport.Height = 493.000000000000000000 + end + object btnToJson: TButton + Anchors = [akLeft, akBottom] + Position.X = 544.000000000000000000 + Position.Y = 520.000000000000000000 + TabOrder = 2 + Text = 'ToJson' + OnClick = btnToJsonClick + end + object btnFromJson: TButton + Anchors = [akLeft, akBottom] + Enabled = False + Position.X = 656.000000000000000000 + Position.Y = 520.000000000000000000 + TabOrder = 1 + Text = 'FromJson' + OnClick = btnFromJsonClick + end +end diff --git a/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/main.fmx b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/main.fmx new file mode 100644 index 0000000..197bc7c --- /dev/null +++ b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/main.fmx @@ -0,0 +1,39 @@ +object Form1: TForm1 + Left = 0 + Top = 0 + Caption = 'Form1' + ClientHeight = 552 + ClientWidth = 1182 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + OnCreate = FormCreate + OnClose = FormClose + DesignerMasterStyle = 0 + object Memo1: TMemo + Touch.InteractiveGestures = [Pan, LongTap, DoubleTap] + DataDetectorTypes = [] + Position.X = 8.000000000000000000 + Position.Y = 8.000000000000000000 + Size.Width = 1169.000000000000000000 + Size.Height = 497.000000000000000000 + Size.PlatformDefault = False + TabOrder = 0 + Viewport.Width = 1165.000000000000000000 + Viewport.Height = 493.000000000000000000 + end + object btnToJson: TButton + Position.X = 544.000000000000000000 + Position.Y = 520.000000000000000000 + TabOrder = 2 + Text = 'ToJson' + OnClick = btnToJsonClick + end + object btnFromJson: TButton + Position.X = 656.000000000000000000 + Position.Y = 520.000000000000000000 + TabOrder = 1 + Text = 'FromJson' + OnClick = btnFromJsonClick + end +end diff --git a/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/main.pas b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/main.pas new file mode 100644 index 0000000..5aecaad --- /dev/null +++ b/samples/delphi/QuickJsonSerializer/JsonSerializerTest2/main.pas @@ -0,0 +1,273 @@ +unit main; + +interface + +uses + System.SysUtils, + System.Types, + System.UITypes, + System.Classes, + System.Variants, + System.Generics.Collections, + FMX.Types, + FMX.Controls, + FMX.Forms, + FMX.Graphics, + FMX.Dialogs, + FMX.Controls.Presentation, + FMX.ScrollBox, + FMX.Memo, + FMX.StdCtrls, + Quick.JsonRecord, + Quick.Base64, + Quick.Json.Serializer; + +type + + TID = Int64; + + TContactType = (ctInternal, ctExternal); + TMessageState = (msPending, msSent, msNotSent); + + TRecipientArray = array of TID; + + TRecipient = record + ID : TID; + RType : TContactType; + Confirm : TMessageState; + end; + + TGenre = (gnMale, gnFemale); + + TGroupType = (gtInternal, gtExternal); + + TDayOfWeek = (wdSunday, wdMonday, wdThuesday, wdWednesday, wdThursday, wdFriday, wdSaturday); + + TUserStatus = (usAtOffice, usAtHome, usOnVacation); + + TDays = set of TDayOfWeek; + +const + DEF_WORKDAYS : TDays = [wdMonday, wdThuesday, wdWednesday, wdThursday, wdFriday]; + DEF_WEEKEND : TDays = [wdSaturday, wdSunday]; + +type + + TDepartment = record + Id : TID; + Name : string; + end; + + TContactIdArray = array of TID; + + TGroup = class + private + fId : TID; + fGType : TGroupType; + published + property Id : TID read fId write fId; + property GType : TGroupType read fGType write fGType; + end; + + TOptions = class + private + fOption1 : Integer; + fOption2 : string; + fAllowGroups : TGroupType; + published + property Option1 : Integer read fOption1 write fOption1; + property Option2 : string read fOption2 write fOption2; + property AllowGroups : TGroupType read fAllowGroups write fAllowGroups; + end; + + TConnectionInfo = record + IP : string; + ConnectionDate : TDateTime; + end; + + TConnectionArray = array of TConnectionInfo; + + TGroupList = TObjectList; + + TWorkingTime = class + private + fName : string; + fWorkDays : TDays; + fFreeDays : TDays; + published + property Name : string read fName write fName; + property WorkDays : TDays read fWorkDays write fWorkDays; + property FreeDays : TDays read fFreeDays write fFreeDays; + end; + + TLevelPrivilege = array of TID; + + TUser = class(TJsonRecord) + private + fId : TID; + fName : string; + fSurname : string; + fAge : Integer; + fAddress : string; + fPath : string; + fOptions : TOptions; + fLastConnections : TConnectionArray; + fMarried : Boolean; + fWorkingTime : TWorkingTime; + fGenre : TGenre; + fDepartment : TDepartment; + fBalance : Double; + fHireDate : TDateTime; + fLevelPrivilege : TLevelPrivilege; + fObservations : string; + fStatus : TUserStatus; + fGroups : TGroupList; + public + constructor Create; + destructor Destroy; override; + published + [TCommentProperty('Is user Id')] + property Id : TID read fId write fId; + property Name : string read fName write fName; + property Surname : string read fSurname write fSurname; + property Age : Integer read fAge write fAge; + [TCommentProperty('gnFemale or gnMale')] + property Genre : TGenre read fGenre write fGenre; + property Department : TDepartment read fDepartment write fDepartment; + property Address : string read fAddress write fAddress; + property Path : string read fPath write fPath; + property Balance : Double read fBalance write fBalance; + [TCustomNameProperty('IsMarried')] + property Married : Boolean read fMarried write fMarried; + property WorkingTime : TWorkingTime read fWorkingTime write fWorkingTime; + property HireDate : TDateTime read fHireDate write fHireDate; + [TCommentProperty('Possible values = usAtOffice, usAtHome or usOnVacation')] + property Status : TUserStatus read fStatus write fStatus; + property LastConnections : TConnectionArray read fLastConnections write fLastConnections; + property Observations : string read fObservations write fObservations; + property LevelPrivilege : TLevelPrivilege read fLevelPrivilege write fLevelPrivilege; + property Options : TOptions read fOptions write fOptions; + property Groups : TGroupList read fGroups write fGroups; + end; + + TUserList = TObjectList; + + + TForm1 = class(TForm) + Memo1: TMemo; + btnToJson: TButton; + btnFromJson: TButton; + procedure FormCreate(Sender: TObject); + procedure btnToJsonClick(Sender: TObject); + procedure btnFromJsonClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + private + { Private declarations } + public + { Public declarations } + end; + +var + Form1: TForm1; + Serializer : TJsonSerializer; + User : TUser; + User2 : TUser; + UserList : TUserList; + +implementation + +{$R *.fmx} + +procedure TForm1.btnFromJsonClick(Sender: TObject); +var + s : string; +begin + if User2 <> nil then User2.Free; + User2 := TUser.Create; + User2.FromJson(Memo1.Text); + //User2 := TUser.CreateFromJson(Memo1.Text); + //User2.CreateFromJson(Memo1.Text); + Memo1.Lines.Add('User2 as json:'); + Memo1.Lines.Add(User2.ToJson(True)); + Memo1.Lines.Add(Format('Groups.OwnedObjects=%s',[BoolToStr(User2.Groups.OwnsObjects,True)])); + Memo1.Lines.Add(Format('Groups.Count=%d',[User2.Groups.Count])); + Memo1.Lines.Add(Format('Groups.Capacity=%d',[User2.Groups.Capacity])); + ShowMessage(Format('%s %s from %s',[User2.Name,User2.Surname,User2.Address])); +end; + +procedure TForm1.btnToJsonClick(Sender: TObject); +begin + Memo1.Text := User.ToJson(True); +end; + +procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); +begin + if Assigned(User) then User.Free; + if Assigned(User2) then User2.Free; + Serializer.Free; +end; + +procedure TForm1.FormCreate(Sender: TObject); +var + lastcon : TConnectionInfo; + group : TGroup; + department : TDepartment; +begin + serializer := TJsonSerializer.Create(TSerializeLevel.slPublishedProperty); + user := TUser.Create; + user.Id := 77; + user.Name := 'Joe'; + user.Surname := 'Smith Valdés'; + user.Age := 30; + user.Married := True; + user.Address := 'Sunset st. 2 \b'; + User.Path := 'C:\documents\files'; + user.Options.Option1 := 1; + user.Options.Option2 := 'good'; + user.Options.AllowGroups := gtExternal; + user.Balance := 99.9; + user.HireDate := Now(); + user.LevelPrivilege := [1,2,3,4]; + user.WorkingTime.Name:= 'WeekConfig'; + user.WorkingTime.WorkDays := DEF_WORKDAYS; + user.WorkingTime.FreeDays := DEF_WEEKEND; + user.Observations := 'Good aptitude'; + department.Id := 10; + department.Name := 'IT'; + user.Department := department; + user.Status := TUserStatus.usOnVacation; + lastcon.IP := '127.0.0.1'; + lastcon.ConnectionDate := Now(); + User.LastConnections := [lastcon]; + lastcon.IP := '192.0.0.1'; + lastcon.ConnectionDate := Now(); + User.LastConnections := User.LastConnections + [lastcon]; + group := TGroup.Create; + group.Id := 1; + group.GType := gtInternal; + user.Groups.Add(group); + group := TGroup.Create; + group.Id := 2; + group.GType := gtExternal; + user.Groups.Add(group); + end; + + +{ TUser } + +constructor TUser.Create; +begin + fOptions := TOptions.Create; + fWorkingTime := TWorkingTime.Create; + fGroups := TGroupList.Create(True); +end; + +destructor TUser.Destroy; +begin + fOptions.Free; + fWorkingTime.Free; + fGroups.Free; + inherited; +end; + +end. diff --git a/samples/firemonkey/QuickAutoMapper/AutoMapperObjects.deployproj b/samples/firemonkey/QuickAutoMapper/AutoMapperObjects.deployproj index 552d240..fe5815f 100644 --- a/samples/firemonkey/QuickAutoMapper/AutoMapperObjects.deployproj +++ b/samples/firemonkey/QuickAutoMapper/AutoMapperObjects.deployproj @@ -7,7 +7,7 @@ emulator-5554 - 18177134-9BFD-46EA-8567-C7B81A17DACE + 0F914BDD-6E4A-40C7-8007-74A3CA5DE432
@@ -25,15 +25,6 @@ - - AutoMapperObjects.app\Contents\ - Info.plist - ProjectOSXInfoPList - 1 - - - True - AutoMapperObjects.app\Contents\Resources\ AutoMapperObjects.icns @@ -52,6 +43,15 @@ True + + AutoMapperObjects.app\..\ + AutoMapperObjects.entitlements + ProjectOSXEntitlements + 1 + + + True + AutoMapperObjects.app\Contents\MacOS\ libcgunwind.1.0.dylib @@ -61,7 +61,7 @@ True - + AutoMapperObjects.app\Contents\MacOS\ AutoMapperObjects ProjectOutput @@ -71,10 +71,10 @@ True True - - AutoMapperObjects.app\..\ - AutoMapperObjects.entitlements - ProjectOSXEntitlements + + AutoMapperObjects.app\Contents\ + Info.plist + ProjectOSXInfoPList 1 @@ -109,6 +109,15 @@ True + + AutoMapperObjects\classes\ + classes.dex + AndroidClassesDexFile + 1 + + + True + AutoMapperObjects\res\drawable-small\ splash_image.png @@ -127,7 +136,7 @@ True - + AutoMapperObjects\res\drawable\ splash_image_def.xml AndroidSplashImageDef @@ -145,7 +154,7 @@ True - + AutoMapperObjects\ AndroidManifest.xml ProjectAndroidManifest @@ -226,7 +235,7 @@ True - + AutoMapperObjects\res\values\ styles.xml AndroidSplashStyles @@ -244,7 +253,7 @@ True - + AutoMapperObjects\library\lib\armeabi-v7a\ libAutoMapperObjects.so ProjectOutput @@ -254,7 +263,7 @@ True True - + AutoMapperObjects\res\values-v21\ styles.xml AndroidSplashStylesV21 @@ -274,6 +283,24 @@ True + + AutoMapperObjects.app\ + Default-2048w-2732h@2x~ipad.png + iPad_Launch2048x2732 + 0 + + + True + + + AutoMapperObjects.app\ + Default-1668w-2224h@2x~ipad.png + iPad_Launch1668 + 0 + + + True + AutoMapperObjects.app\ Default-812h@3x.png @@ -310,20 +337,20 @@ True - + AutoMapperObjects.app\ - FM_ApplicationIcon_60x60.png - iPhone_AppIcon60 + Default-1668w-2388h@2x~ipad.png + iPad_Launch1668x2388 0 True - + AutoMapperObjects.app\ - Info.plist - ProjectiOSInfoPList - 1 + FM_ApplicationIcon_60x60.png + iPhone_AppIcon60 + 0 True @@ -346,20 +373,37 @@ True - + AutoMapperObjects.app\ - AutoMapperObjects - ProjectOutput - 1 + FM_ApplicationIcon_152x152.png + iPad_AppIcon152 + 0 True - True - + AutoMapperObjects.app\ - FM_ApplicationIcon_152x152.png - iPad_AppIcon152 + Default-Landscape-640w-1136h@2x.png + iPhone_Launch1136x640 + 0 + + + True + + + AutoMapperObjects.app\ + FM_ApplicationIcon_83.5x83.5.png + iPad_AppIcon83_5 + 0 + + + True + + + AutoMapperObjects.app\ + Default-Landscape-750w-1334h@2x.png + iPhone_Launch1334 0 @@ -446,6 +490,33 @@ True + + AutoMapperObjects.app\ + FM_ApplicationIcon_167x167.png + iPad_AppIcon167 + 0 + + + True + + + AutoMapperObjects.app\ + Default-Landscape-2048w-2732h@2x~ipad.png + iPad_Launch2732x2048 + 0 + + + True + + + AutoMapperObjects.app\ + Default-Landscape-1668w-2224h@2x~ipad.png + iPad_Launch2224 + 0 + + + True + AutoMapperObjects.app\ Default-Landscape@2x~ipad.png @@ -482,6 +553,34 @@ True + + AutoMapperObjects.app\ + Default-1242w-2688h@3x.png + iPhone_Launch1242x2688 + 0 + + + True + + + AutoMapperObjects.app\ + AutoMapperObjects + ProjectOutput + 1 + + + True + True + + + AutoMapperObjects.app\ + Info.plist + ProjectiOSInfoPList + 1 + + + True + AutoMapperObjects.app\ FM_ApplicationIcon_180x180.png @@ -491,6 +590,15 @@ True + + AutoMapperObjects.app\ + Default-828w-1792h@2x.png + iPhone_Launch828 + 0 + + + True + AutoMapperObjects.app\ FM_ApplicationIcon_76x76.png @@ -581,20 +689,20 @@ True - + AutoMapperObjects.app\ - AutoMapperObjects.entitlements - ProjectiOSEntitlements - 0 + libpcre.dylib + DependencyModule + 1 True - + AutoMapperObjects.app\ - libpcre.dylib - DependencyModule - 1 + FM_SpotlightSearchIcon_120x120.png + iPhone_Spotlight120 + 0 True @@ -608,6 +716,24 @@ True + + AutoMapperObjects.app\ + AutoMapperObjects.entitlements + ProjectiOSEntitlements + 0 + + + True + + + AutoMapperObjects.app\ + Default-Landscape-828w-1792h@2x.png + iPhone_Launch1792 + 0 + + + True + AutoMapperObjects.app\ Default-568h@2x.png @@ -626,6 +752,15 @@ True + + AutoMapperObjects.app\ + Default-Landscape-1668w-2388h@2x~ipad.png + iPad_Launch2388x1668 + 0 + + + True + AutoMapperObjects.app\ FM_SettingIcon_29x29.png @@ -635,6 +770,15 @@ True + + AutoMapperObjects.app\ + Default-Landscape-1242w-2688h@3x.png + iPhone_Launch2688x1242 + 0 + + + True + AutoMapperObjects.app\ Default-Landscape.png diff --git a/samples/firemonkey/QuickAutoMapper/AutoMapperObjects.dproj b/samples/firemonkey/QuickAutoMapper/AutoMapperObjects.dproj index a9f1c21..0220a29 100644 --- a/samples/firemonkey/QuickAutoMapper/AutoMapperObjects.dproj +++ b/samples/firemonkey/QuickAutoMapper/AutoMapperObjects.dproj @@ -1,12 +1,12 @@  {A09BFAB7-22BC-423E-9483-447ECD470543} - 18.5 + 18.6 FMX AutoMapperObjects.dpr True Debug - Win64 + Android 1119 Application @@ -130,7 +130,7 @@ DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSFaceIDUsageDescription=The reason for accessing the face id;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSFaceIDUsageDescription=The reason for accessing the face id;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false iPhoneAndiPad true Debug @@ -171,10 +171,25 @@ $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_100x100.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_29x29.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_828x1792.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1136x640.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2688.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1334x750.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1792x828.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2688x1242.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_83.5x83.5.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2224.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2388.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_2048x2732.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2224x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2388x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2732x2048.png DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FrameViewer;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;TMSFMXPackPkgDXE11;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSFaceIDUsageDescription=The reason for accessing the face id;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSFaceIDUsageDescription=The reason for accessing the face id;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false iPhoneAndiPad true Debug @@ -215,10 +230,25 @@ $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_100x100.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_29x29.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_828x1792.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1136x640.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2688.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1334x750.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1792x828.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2688x1242.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_83.5x83.5.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2224.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2388.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_2048x2732.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2224x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2388x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2732x2048.png DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSFaceIDUsageDescription=The reason for accessing the face id;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSFaceIDUsageDescription=The reason for accessing the face id;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false iPhoneAndiPad true $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_57x57.png @@ -257,10 +287,25 @@ $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_100x100.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_29x29.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_828x1792.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1136x640.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2688.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1334x750.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1792x828.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2688x1242.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_83.5x83.5.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2224.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2388.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_2048x2732.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2224x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2388x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2732x2048.png DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;inetdb;FmxTeeUI;fmx;fmxdae;dbexpress;IndyCore;dsnap;bindengine;DBXMySQLDriver;FireDACMySQLDriver;FireDACCommonODBC;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDACPgDriver;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;fmxobj;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;fmxase;$(DCC_UsePackage) - CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSContactsUsageDescription=The reason for accessing the contacts;NSLocationUsageDescription=The reason for accessing the location information of the user Debug true /usr/X11/bin/xterm -e "%debuggee%" @@ -374,12 +419,24 @@ true + + + Default-2048w-2732h@2x~ipad.png + true + + ic_launcher.png true + + + Default-1668w-2224h@2x~ipad.png + true + + Default-812h@3x.png @@ -425,18 +482,24 @@ true - + Info.plist true + + + Default-1668w-2388h@2x~ipad.png + true + + true - + Info.plist true @@ -459,7 +522,7 @@ true - + AutoMapperObjects true @@ -475,6 +538,23 @@ true + + + true + + + + + Default-Landscape-640w-1136h@2x.png + true + + + + + Default-Landscape-750w-1334h@2x.png + true + + Default-736h@3x.png @@ -543,6 +623,13 @@ true + + + Contents\MacOS\ + AutoMapperObjects.rsm + true + + true @@ -571,6 +658,29 @@ true + + + true + + + + + Default-Landscape-2048w-2732h@2x~ipad.png + true + + + + + Default-Landscape-1668w-2224h@2x~ipad.png + true + + + + + AutoMapperObjects.rsm + true + + Default-Landscape@2x~ipad.png @@ -594,11 +704,23 @@ true + + + Default-1242w-2688h@3x.png + true + + true + + + Default-828w-1792h@2x.png + true + + splash_image.png @@ -675,13 +797,13 @@ true - + AutoMapperObjects true - + true @@ -697,7 +819,7 @@ true - + true @@ -713,11 +835,22 @@ true + + + true + + true + + + Default-Landscape-828w-1792h@2x.png + true + + Default-568h@2x.png @@ -729,6 +862,12 @@ true + + + Default-Landscape-1668w-2388h@2x~ipad.png + true + + true @@ -739,6 +878,12 @@ true + + + Default-Landscape-1242w-2688h@3x.png + true + + libAutoMapperObjects.so diff --git a/samples/firemonkey/QuickAutoMapper/Main.pas b/samples/firemonkey/QuickAutoMapper/Main.pas index 8adf3a2..4bcd0bb 100644 --- a/samples/firemonkey/QuickAutoMapper/Main.pas +++ b/samples/firemonkey/QuickAutoMapper/Main.pas @@ -5,7 +5,7 @@ interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, - Quick.AutoMapper, Quick.JSONRecord, FMX.Controls.Presentation, + Quick.AutoMapper, Quick.JSONRecord, FMX.Controls.Presentation, Quick.Arrays, FMX.ScrollBox, FMX.Memo, System.Generics.Collections; type @@ -61,7 +61,7 @@ TUserBase = class(TJsonRecord) property Agent : TAgent read fAgent write fAgent; end; - TPointsList = TList; + TPointsList = TXArray; TUser = class(TUserBase) private @@ -129,7 +129,7 @@ constructor TUser.Create; begin fCar := TCar.Create; fCarList := TCarList.Create(True); - fPoints := TPointsList.Create; + //fPoints := TPointsList.Create; fAgentList := TAgentList.Create; end; @@ -137,7 +137,7 @@ destructor TUser.Destroy; begin fCar.Free; fCarList.Free; - fPoints.Free; + //fPoints.Free; fAgentList.Free; inherited; end; @@ -148,7 +148,7 @@ constructor TUser2.Create; begin fCar := TCar.Create; fCarList := TCarList.Create(True); - fPoints := TPointsList.Create; + //fPoints := TPointsList.Create; fAgentList := TAgentList.Create; end; @@ -156,7 +156,7 @@ destructor TUser2.Destroy; begin fCar.Free; fCarList.Free; - fPoints.Free; + //fPoints.Free; fAgentList.Free; inherited; end; diff --git a/samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.deployproj b/samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.deployproj index a0e8050..38a5558 100644 --- a/samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.deployproj +++ b/samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.deployproj @@ -4,10 +4,10 @@ 12 - + emulator-5554 - 1C21C043-741B-41E0-B191-AB259898400F + 0F914BDD-6E4A-40C7-8007-74A3CA5DE432 @@ -25,24 +25,14 @@ - - ConfigToFile.app\..\ - ConfigToFile.entitlements - ProjectOSXEntitlements - 1 - - - True - - - ConfigToFile.app\Contents\MacOS\ - ConfigToFile - ProjectOutput + + ConfigToFile.app\Contents\ + Info.plist + ProjectOSXInfoPList 1 True - True ConfigToFile.app\Contents\Resources\ @@ -62,28 +52,29 @@ True - + ConfigToFile.app\Contents\MacOS\ - libcgunwind.1.0.dylib - DependencyModule + ConfigToFile + ProjectOutput 1 True + True - - ConfigToFile.app\Contents\ - Info.plist - ProjectOSXInfoPList + + ConfigToFile.app\Contents\MacOS\ + libcgunwind.1.0.dylib + DependencyModule 1 True - - ConfigToFile.app\Contents\MacOS\ - ConfigToFile.rsm - DebugSymbols + + ConfigToFile.app\..\ + ConfigToFile.entitlements + ProjectOSXEntitlements 1 @@ -109,6 +100,15 @@ True + + ConfigToFile\classes\ + classes.dex + AndroidClassesDexFile + 1 + + + True + ConfigToFile\res\drawable-small\ splash_image.png @@ -127,7 +127,7 @@ True - + ConfigToFile\res\drawable\ splash_image_def.xml AndroidSplashImageDef @@ -145,7 +145,7 @@ True - + ConfigToFile\ AndroidManifest.xml ProjectAndroidManifest @@ -172,7 +172,7 @@ True - + ConfigToFile\library\lib\armeabi-v7a\ libConfigToFile.so ProjectOutput @@ -227,7 +227,7 @@ True - + ConfigToFile\res\values\ styles.xml AndroidSplashStyles @@ -245,7 +245,7 @@ True - + ConfigToFile\res\values-v21\ styles.xml AndroidSplashStylesV21 @@ -265,6 +265,24 @@ True + + ConfigToFile.app\ + Default-2048w-2732h@2x~ipad.png + iPad_Launch2048x2732 + 0 + + + True + + + ConfigToFile.app\ + Default-1668w-2224h@2x~ipad.png + iPad_Launch1668 + 0 + + + True + ConfigToFile.app\ Default-812h@3x.png @@ -274,6 +292,16 @@ True + + ConfigToFile.app\ + ConfigToFile + ProjectOutput + 1 + + + True + True + ConfigToFile.app\ FM_SpotlightSearchIcon_58x58.png @@ -301,10 +329,10 @@ True - + ConfigToFile.app\ - ConfigToFile.entitlements - ProjectiOSEntitlements + Default-1668w-2388h@2x~ipad.png + iPad_Launch1668x2388 0 @@ -346,6 +374,33 @@ True + + ConfigToFile.app\ + Default-Landscape-640w-1136h@2x.png + iPhone_Launch1136x640 + 0 + + + True + + + ConfigToFile.app\ + FM_ApplicationIcon_83.5x83.5.png + iPad_AppIcon83_5 + 0 + + + True + + + ConfigToFile.app\ + Default-Landscape-750w-1334h@2x.png + iPhone_Launch1334 + 0 + + + True + ConfigToFile.app\ Default-736h@3x.png @@ -400,6 +455,15 @@ True + + ConfigToFile.app\ + Info.plist + ProjectiOSInfoPList + 1 + + + True + ConfigToFile.app\ Default@2x.png @@ -427,6 +491,33 @@ True + + ConfigToFile.app\ + FM_ApplicationIcon_167x167.png + iPad_AppIcon167 + 0 + + + True + + + ConfigToFile.app\ + Default-Landscape-2048w-2732h@2x~ipad.png + iPad_Launch2732x2048 + 0 + + + True + + + ConfigToFile.app\ + Default-Landscape-1668w-2224h@2x~ipad.png + iPad_Launch2224 + 0 + + + True + ConfigToFile.app\ Default-Landscape@2x~ipad.png @@ -463,15 +554,14 @@ True - + ConfigToFile.app\ - ConfigToFile - ProjectOutput - 1 + Default-1242w-2688h@3x.png + iPhone_Launch1242x2688 + 0 True - True ConfigToFile.app\ @@ -482,20 +572,20 @@ True - + ConfigToFile.app\ - FM_ApplicationIcon_76x76.png - iPad_AppIcon76 + Default-828w-1792h@2x.png + iPhone_Launch828 0 True - + ConfigToFile.app\ - Info.plist - ProjectiOSInfoPList - 1 + FM_ApplicationIcon_76x76.png + iPad_AppIcon76 + 0 True @@ -536,19 +626,19 @@ True - + ConfigToFile.app\ - FM_ApplicationIcon_120x120.png - iPhone_AppIcon120 + Default-Landscape-736h@3x.png + iPhone_Launch2208 0 True - + ConfigToFile.app\ - Default-Landscape-736h@3x.png - iPhone_Launch2208 + FM_ApplicationIcon_120x120.png + iPhone_AppIcon120 0 @@ -572,6 +662,15 @@ True + + ConfigToFile.app\ + FM_SpotlightSearchIcon_120x120.png + iPhone_Spotlight120 + 0 + + + True + ConfigToFile.app\ libpcre.dylib @@ -581,6 +680,15 @@ True + + ConfigToFile.app\ + ConfigToFile.entitlements + ProjectiOSEntitlements + 0 + + + True + ConfigToFile.app\ FM_SpotlightSearchIcon_50x50.png @@ -590,6 +698,15 @@ True + + ConfigToFile.app\ + Default-Landscape-828w-1792h@2x.png + iPhone_Launch1792 + 0 + + + True + ConfigToFile.app\ Default-568h@2x.png @@ -608,6 +725,15 @@ True + + ConfigToFile.app\ + Default-Landscape-1668w-2388h@2x~ipad.png + iPad_Launch2388x1668 + 0 + + + True + ConfigToFile.app\ FM_SettingIcon_29x29.png @@ -617,6 +743,15 @@ True + + ConfigToFile.app\ + Default-Landscape-1242w-2688h@3x.png + iPhone_Launch2688x1242 + 0 + + + True + ConfigToFile.app\ Default-Landscape.png diff --git a/samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.dproj b/samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.dproj index 04cf152..139da7c 100644 --- a/samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.dproj +++ b/samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.dproj @@ -1,7 +1,7 @@  {D93EB58E-5F98-4C8B-9E16-A2DEF8DE9BF6} - 18.5 + 18.6 FMX ConfigToFile.dpr True @@ -121,7 +121,7 @@ DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false iPhoneAndiPad true Debug @@ -162,10 +162,25 @@ $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_100x100.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_29x29.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_828x1792.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1136x640.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2688.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1334x750.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1792x828.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2688x1242.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_83.5x83.5.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2224.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2388.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_2048x2732.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2224x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2388x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2732x2048.png DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false iPhoneAndiPad true Debug @@ -206,10 +221,25 @@ $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_100x100.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_29x29.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_828x1792.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1136x640.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2688.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1334x750.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1792x828.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2688x1242.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_83.5x83.5.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2224.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2388.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_2048x2732.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2224x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2388x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2732x2048.png DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;ibmonitor;FMXTee;soaprtl;DbxCommonDriver;ibxpress;xmlrtl;soapmidas;DataSnapNativeClient;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false iPhoneAndiPad true $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_57x57.png @@ -248,10 +278,25 @@ $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_100x100.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_29x29.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_828x1792.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1136x640.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2688.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1334x750.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1792x828.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2688x1242.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_83.5x83.5.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2224.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1668x2388.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_2048x2732.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2224x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2388x1668.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2732x2048.png DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXInterBaseDriver;emsclientfiredac;DataSnapFireDAC;tethering;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;ibxbindings;rtl;DbxClientDriver;FireDACDSDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) - CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSContactsUsageDescription=The reason for accessing the contacts;NSLocationUsageDescription=The reason for accessing the location information of the user Debug true @@ -357,12 +402,24 @@ true + + + Default-2048w-2732h@2x~ipad.png + true + + ic_launcher.png true + + + Default-1668w-2224h@2x~ipad.png + true + + Default-812h@3x.png @@ -396,7 +453,19 @@ true - + + + ConfigToFile.rsm + true + + + + + Default-1668w-2388h@2x~ipad.png + true + + + true @@ -411,7 +480,7 @@ true - + true @@ -433,12 +502,23 @@ true + + + Default-Landscape-640w-1136h@2x.png + true + + true - + + + true + + + ConfigToFile true @@ -456,6 +536,12 @@ true + + + Default-Landscape-750w-1334h@2x.png + true + + Default~ipad.png @@ -540,6 +626,23 @@ true + + + true + + + + + Default-Landscape-2048w-2732h@2x~ipad.png + true + + + + + Default-Landscape-1668w-2224h@2x~ipad.png + true + + Default-Landscape@2x~ipad.png @@ -563,17 +666,29 @@ true - + ConfigToFile true + + + Default-1242w-2688h@3x.png + true + + true + + + Default-828w-1792h@2x.png + true + + splash_image.png @@ -591,7 +706,7 @@ true - + Info.plist true @@ -603,7 +718,7 @@ true - + Info.plist true @@ -668,6 +783,11 @@ true + + + true + + true @@ -684,6 +804,12 @@ true + + + Default-Landscape-828w-1792h@2x.png + true + + Default-568h@2x.png @@ -695,6 +821,12 @@ true + + + Default-Landscape-1668w-2388h@2x~ipad.png + true + + true @@ -705,6 +837,12 @@ true + + + Default-Landscape-1242w-2688h@3x.png + true + + ConfigToFile.exe @@ -717,7 +855,7 @@ true - + Contents\MacOS\ ConfigToFile.rsm diff --git a/samples/fpc/JsonSerializerTest1/JsonSerializerTest1.lpi b/samples/fpc/JsonSerializerTest1/JsonSerializerTest1.lpi new file mode 100644 index 0000000..f0968b0 --- /dev/null +++ b/samples/fpc/JsonSerializerTest1/JsonSerializerTest1.lpi @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0"/> + </RunParams> + <Units Count="1"> + <Unit0> + <Filename Value="JsonSerializerTest1.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="JsonSerializerTest1"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\..\..\..\Quicklib"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/samples/fpc/JsonSerializerTest1/JsonSerializerTest1.lpr b/samples/fpc/JsonSerializerTest1/JsonSerializerTest1.lpr new file mode 100644 index 0000000..6938006 --- /dev/null +++ b/samples/fpc/JsonSerializerTest1/JsonSerializerTest1.lpr @@ -0,0 +1,124 @@ +program JsonSerializerTest1; + +{$mode delphi} + +uses + SysUtils, + Generics.Collections, + Quick.Commons, + Quick.Console, + Quick.Json.Serializer; + +type + THost = class + private + fName : string; + fIP : string; + fPort : Integer; + published + property Name : string read fName write fName; + property IP : string read fIP write fIP; + property Port : Integer read fPort write fPort; + end; + + THostList = TObjectList<THost>; + + TConfig = class + private + fHosts : THostList; + fDebugMode : Boolean; + fLevel : Integer; + public + constructor Create; + destructor Destroy; override; + published + property Hosts : THostList read fHosts write fHosts; + property DebugMode : Boolean read fDebugMode write fDebugMode; + property Level : Integer read fLevel write fLevel; + end; + +const + jsonstring = '{"Hosts":[{"Name":"Host 1 año perfección","IP":"127.0.0.1","Port":80},{"Name":"Host 2","IP":"192.168.1.1","Port":443}],"DebugMode":true,"Level":1}'; + jsonstring2 = '{"Hosts":{"List":[{"Name":"Host 1","IP":"127.0.0.2","Port":80},{"Name":"Host 2","IP":"192.168.1.2","Port":443}]},"DebugMode":true,"Level":2}'; + +var + config : TConfig; + host : THost; + serializer : TJsonSerializer; + json : string; + +{ TConfig } + +constructor TConfig.Create; +begin + fHosts := THostList.Create(True); +end; + +destructor TConfig.Destroy; +begin + fHosts.Free; + inherited; +end; + +begin + try + serializer := TJsonSerializer.Create(slPublishedProperty); + try + + //created from object + cout('Create from object',ccYellow); + config := TConfig.Create; + try + host := THost.Create; + host.Name := 'Host 1'; + host.IP := '127.0.0.1'; + host.Port := 80; + config.DebugMode := True; + config.Level := 1; + config.Hosts.Add(host); + + host := THost.Create; + host.Name := 'Host 2'; + host.IP := '192.168.1.1'; + host.Port := 443; + config.Hosts.Add(host); + + json := serializer.ObjectToJson(config,True); + cout(json,ccWhite); + coutFmt('Capacity: %d / Count: %d',[config.Hosts.Capacity,config.Hosts.Count],etInfo); + finally + config.Free; + end; + + //from json string without list property + cout('Create from jsonstring without "List" property',ccYellow); + config := TConfig.Create; + try + serializer.JsonToObject(config,jsonstring); + json := serializer.ObjectToJson(config,True); + cout(json,ccWhite); + coutFmt('Capacity: %d / Count: %d',[config.Hosts.Capacity,config.Hosts.Count],etInfo); + finally + config.Free; + end; + + //from json string with list property + cout('Create from jsonstring with "List" property',ccYellow); + config := TConfig.Create; + try + serializer.JsonToObject(config,jsonstring2); + json := serializer.ObjectToJson(config,True); + cout(json,ccWhite); + coutFmt('Capacity: %d / Count: %d',[config.Hosts.Capacity,config.Hosts.Count],etInfo); + finally + config.Free; + end; + finally + serializer.Free; + end; + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/fpc/QuickArrayHelper/ArrayHelpers.lpi b/samples/fpc/QuickArrayHelper/ArrayHelpers.lpi new file mode 100644 index 0000000..32353a8 --- /dev/null +++ b/samples/fpc/QuickArrayHelper/ArrayHelpers.lpi @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="ArrayHelpers"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0"/> + </RunParams> + <Units Count="1"> + <Unit0> + <Filename Value="ArrayHelpers.pas"/> + <IsPartOfProject Value="True"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="ArrayHelpers"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\..\.."/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/samples/fpc/QuickArrayHelper/ArrayHelpers.pas b/samples/fpc/QuickArrayHelper/ArrayHelpers.pas new file mode 100644 index 0000000..0c95a1c --- /dev/null +++ b/samples/fpc/QuickArrayHelper/ArrayHelpers.pas @@ -0,0 +1,35 @@ +program ArrayHelpers; + +{$Mode delphi} + +uses + SysUtils, + Quick.Commons, + Quick.Console, + Quick.Arrays.Helper; + +var + + myarray : TStringArray; + +begin + try + myarray.Add('one'); + myarray.Add('two'); + myarray.Add('three'); + coutFmt('count: %d',[myarray.Count],etInfo); + if myarray.Contains('two') then cout('found "two" in array',etInfo) + else cout('not found',etInfo); + + coutFmt('"three" in position %d',[myarray.IndexOf('three')],etInfo); + + TArrayHelper<string>.Add(myarray,'four'); + + cout('Press <Enter> to Exit',ccYellow); + + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/fpc/QuickArrays/FlexArrays/ManageFlexArrays.lpi b/samples/fpc/QuickArrays/FlexArrays/ManageFlexArrays.lpi new file mode 100644 index 0000000..5abf2f8 --- /dev/null +++ b/samples/fpc/QuickArrays/FlexArrays/ManageFlexArrays.lpi @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="ManageFlexArrays"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0"/> + </RunParams> + <Units Count="1"> + <Unit0> + <Filename Value="ManageFlexArrays.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="ManageFlexArrays"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\..\..\..\..\quicklib"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/samples/fpc/QuickArrays/FlexArrays/ManageFlexArrays.lpr b/samples/fpc/QuickArrays/FlexArrays/ManageFlexArrays.lpr new file mode 100644 index 0000000..a135b9b --- /dev/null +++ b/samples/fpc/QuickArrays/FlexArrays/ManageFlexArrays.lpr @@ -0,0 +1,44 @@ +program ManageFlexArrays; + +{$MODE DELPHI} + +uses + SysUtils, + Quick.Commons, + Quick.Console, + Quick.Arrays; + +type + TUser = class + private + fName : string; + public + property Name : string read fName write fName; + end; + +var + flexarray : TFlexArray; + user : TUser; + +begin + try + flexarray.Add(10); + flexarray.Add('Hello'); + user := TUser.Create; + try + user.Name := 'Joe'; + flexarray.Add(user); + + cout('Integer Item = %d',[flexarray[0].AsInteger],etInfo); + cout('String Item = %s',[flexarray[1].AsString],etInfo); + cout('Record Item = %s',[TUser(flexarray[2].AsObject).Name],etInfo); + finally + user.Free; + end; + cout('Press <Enter> to Exit',ccYellow); + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/fpc/QuickArrays/FlexPairArrays/ManageFlexPairArrays.lpi b/samples/fpc/QuickArrays/FlexPairArrays/ManageFlexPairArrays.lpi new file mode 100644 index 0000000..e0968e3 --- /dev/null +++ b/samples/fpc/QuickArrays/FlexPairArrays/ManageFlexPairArrays.lpi @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="ManageFlexPairArrays"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0"/> + </RunParams> + <Units Count="1"> + <Unit0> + <Filename Value="ManageFlexPairArrays.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="ManageFlexPairArrays"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\..\..\..\..\quicklib"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/samples/fpc/QuickArrays/FlexPairArrays/ManageFlexPairArrays.lpr b/samples/fpc/QuickArrays/FlexPairArrays/ManageFlexPairArrays.lpr new file mode 100644 index 0000000..5750705 --- /dev/null +++ b/samples/fpc/QuickArrays/FlexPairArrays/ManageFlexPairArrays.lpr @@ -0,0 +1,48 @@ +program ManageFlexPairArrays; + +{$APPTYPE CONSOLE} + +{$MODE DELPHI} + +uses + SysUtils, + Quick.Commons, + Quick.Console, + Quick.Value, + Quick.Arrays; + +type + TUser = class + private + fName : string; + public + property Name : string read fName write fName; + end; + +var + flexarray : TFlexPairArray; + user : TUser; + +begin + try + flexarray.Add('onenumber',10); + flexarray.Add('other','Hello boy!'); + user := TUser.Create; + try + user.Name := 'Joe'; + flexarray.Add('myuser',user); + + cout('Integer Item = %d',[flexarray.GetValue('onenumber').AsInteger],etInfo); + cout('String Item = %s',[flexarray.GetValue('other').AsString],etInfo); + cout('Record Item = %s',[TUser(flexarray.GetValue('myuser').AsObject).Name],etInfo); + finally + user.Free; + end; + + cout('Press <Enter> to Exit',ccYellow); + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/fpc/QuickArrays/ManageXArrays/ManageArrays.lpi b/samples/fpc/QuickArrays/ManageXArrays/ManageArrays.lpi new file mode 100644 index 0000000..6018944 --- /dev/null +++ b/samples/fpc/QuickArrays/ManageXArrays/ManageArrays.lpi @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="ManageArrays"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0"/> + </RunParams> + <Units Count="1"> + <Unit0> + <Filename Value="ManageArrays.pas"/> + <IsPartOfProject Value="True"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="ManageArrays"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\..\..\..\quicklib"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/samples/fpc/QuickArrays/ManageXArrays/ManageArrays.pas b/samples/fpc/QuickArrays/ManageXArrays/ManageArrays.pas new file mode 100644 index 0000000..824ff1b --- /dev/null +++ b/samples/fpc/QuickArrays/ManageXArrays/ManageArrays.pas @@ -0,0 +1,57 @@ +program ManageArrays; + +{$Mode delphi} + +uses + SysUtils, + Quick.Commons, + Quick.Console, + Quick.Arrays; + +type + + TUser = record + Name : string; + Age : Integer; + end; + + TUserArray = TXArray<TUser>; + +var + userarray : TUserArray; + user : TUser; + normalarray : TArray<TUser>; + + +begin + try + user.Name := 'Joe'; + user.Age := 30; + userarray.Add(user); + user.Name := 'Peter'; + user.Age := 32; + userarray.Add(user); + user.Name := 'James'; + user.Age := 40; + userarray.Add(user); + + if userarray.Contains(user) then cout('found user in array',etInfo); + + cout('List users:',ccYellow); + for user in userarray do + begin + coutFmt('User: %s',[user.Name],etInfo); + end; + + normalarray := userarray; + + coutFmt('Copied array value 1: %s',[normalarray[1].Name],etInfo); + + cout('Press <Enter> to Exit',ccYellow); + + ConsoleWaitForEnterKey; + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; +end. diff --git a/samples/fpc/QuickAutoMapper/AutoMapperObjects.lpr b/samples/fpc/QuickAutoMapper/AutoMapperObjects.lpr index f01c70e..a1e088c 100644 --- a/samples/fpc/QuickAutoMapper/AutoMapperObjects.lpr +++ b/samples/fpc/QuickAutoMapper/AutoMapperObjects.lpr @@ -1,5 +1,7 @@ program AutoMapperObjects; +{$mode delphi} + uses SysUtils, Generics.Collections, @@ -34,7 +36,7 @@ TCar = class property CarType : TCarType read fCarType write fCarType; end; - TCarList = specialize TObjectList<TCar>; + TCarList = TObjectList<TCar>; TAgent = class private @@ -45,7 +47,7 @@ TAgent = class property Status : TAgentStatus read fStatus write fStatus; end; - TAgentList = specialize TList<TAgent>; + TAgentList = TList<TAgent>; TArrayNumbers = array of Integer; @@ -64,7 +66,7 @@ TUserBase = class(TJsonRecord) property Agent : TAgent read fAgent write fAgent; end; - TPointsList = specialize TList<Integer>; + TPointsList = TList<Integer>; TUser = class(TUserBase) private @@ -110,10 +112,15 @@ TUser2 = class(TUserBase) property AgentList : TAgentList read fAgentList write fAgentList; end; + TUserMapping = class + class procedure DoMapping(const aSrcObj : TObject; const aTargetName : string; out Value : TFlexValue); + class Procedure DoAfterMapping(const aSrcObj : TUser; aTgtObj : TUser2); + end; + var User : TUser; User2 : TUser2; - AutoMapper : specialize TAutoMapper<TUser,TUser2>; + AutoMapper : TAutoMapper<TUser,TUser2>; job : TJob; car : TCar; agent : TAgent; @@ -164,6 +171,18 @@ destructor TUser2.Destroy; inherited; end; +class procedure TUserMapping.DoMapping(const aSrcObj : TObject; const aTargetName : string; out Value : TFlexValue); +begin + if aTargetName = 'Money' then Value := TUser(aSrcObj).Cash * 2 + else if aTargetName = 'IdUser' then Value := TUser(aSrcObj).Id; +end; + +class procedure TUserMapping.DoAfterMapping(const aSrcObj : TUser; aTgtObj : TUser2); +begin + aTgtObj.Money := aSrcObj.Cash * 2; + aTgtObj.IdUser := aSrcObj.Id; +end; + begin try Console.LogVerbose := LOG_ALL; @@ -201,10 +220,18 @@ destructor TUser2.Destroy; agent.Status := TAgentStatus.stFail; User.AgentList.Add(agent); //User2 := TMapper<TUser2>.Map(User); - AutoMapper := specialize TAutoMapper<TUser,TUser2>.Create; + AutoMapper := TAutoMapper<TUser,TUser2>.Create; try + //option1: you can define auto map different named properties AutoMapper.CustomMapping.AddMap('Cash','Money'); AutoMapper.CustomMapping.AddMap('Id','IdUser'); + + //option2: you can decide to modify each property manually or allow to auto someones + AutoMapper.OnDoMapping := TUserMapping.DoMapping; + + //option3: you can modify some properties after automapping done + AutoMapper.OnAfterMapping := TUserMapping.DoAfterMapping; + User2 := AutoMapper.Map(User); //User2 := TUser2.Create; //User.MapTo(User2); From 577b58be974fdc5545c2bf38e50b183fc9e1080c Mon Sep 17 00:00:00 2001 From: Unknown <kike@exilon.es> Date: Sat, 6 Apr 2019 17:19:30 +0200 Subject: [PATCH 8/8] readme updated --- README.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 230fad8..9d262aa 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ -------- Small delphi/Firemonkey(Windows, Linux, Android, OSX & IOS) and fpc(Windows & Linux) library containing interesting and quick to implement functions, created to simplify application development and crossplatform support and improve productivity. +* NEW: FlexArray, FlexPair & FlexPairArray. +* NEW: AutoMapper mapping procedures (see documentation below) +* NEW: JsonSerializer improved +* NEW: TXArray: array like TList * NEW: Delphi Linux compatibility * NEW: QuickConfigJson reload if config file changed * NEW: First version with OSX/IOS partial support @@ -422,7 +426,7 @@ finally end; ``` -**Quick.AutoMapper:** Map fields from one class to another class. Allows custom mappings to match different fields. +**Quick.AutoMapper:** Map fields from one class to another class. Allows custom mappings to match different fields and custom mapping procedure to cast/convert fields manually. ```delphi //Map values from User1 to User2 @@ -430,8 +434,25 @@ TMapper<TUser2>.Map(User); //Map custom mappings AutoMapper := TAutoMapper<TUser,TUser2>.Create; + +//option1: you can define auto map different named properties AutoMapper.CustomMapping.AddMap('Cash','Money'); AutoMapper.CustomMapping.AddMap('Id','IdUser'); + +//option2: you can decide to modify each property manually or allow to auto someones +AutoMapper.OnDoMapping := procedure(const aSrcObj : TUser; const aTargetName : string; out Value : TFlexValue) + begin + if aTargetName = 'Money' then Value := aSrcObj.Cash * 2 + else if aTargetName = 'IdUser' then Value := aSrcObj.Id; + end; + +//option3: you can modify some properties after automapping done +AutoMapper.OnAfterMapping := procedure(const aSrcObj : TUser; aTgtObj : TUser2) + begin + aTgtObj.Money := aSrcObj.Cash * 2; + aTgtObj.IdUser := aSrcObj.Id; + end; + User2 := AutoMapper.Map(User); ``` @@ -478,4 +499,60 @@ begin //get user by "Name" index writeln(users.Get('Name','Peter').SurName); end; + +**Quick.Arrays:** Improved arrays. +- TXArray: Array with methods like TList. +```delphi +var + users : TXArray<TUser>; +begin + users.Add(User); + if users.Count:= TIndexedObjectList<TUser>.Create(True); + //create index by property "Name" + users.Indexes.Add('Name','Name',TClassField.cfProperty); + //create index by private field "Id" + users.Indexes.Add('Id','fId',TClassField.cfField); + //get user by "Name" index + writeln(users.Get('Name','Peter').SurName); +end; ``` +- TFlexArray: Array with methods like TList than can storage different value types into same array. +```delphi +var + flexarray : TFlexArray; +begin + flexarray.Add(10); + flexarray.Add('Hello'); + user := TUser.Create; + try + user.Name := 'Joe'; + flexarray.Add(user); + + cout('Integer Item = %d',[flexarray[0].AsInteger],etInfo); + cout('String Item = %s',[flexarray[1].AsString],etInfo); + cout('Record Item = %s',[TUser(flexarray[2]).Name],etInfo); + finally + user.Free; + end; +end; +``` +- TFlexPairArray: Array with methods like TList than can storage different value types into same array, and search by item name. +```delphi +var + flexarray : TFlexPairArray; +begin + flexarray.Add('onenumber',10); + flexarray.Add('other','Hello boy!'); + user := TUser.Create; + try + user.Name := 'Joe'; + flexarray.Add('myuser',user); + + cout('Integer Item = %d',[flexarray.GetValue('onenumber').AsInteger],etInfo); + cout('String Item = %s',[flexarray.GetValue('other').AsString],etInfo); + cout('Record Item = %s',[TUser(flexarray.GetValue('myuser')).Name],etInfo); + finally + user.Free; + end; +end; +``` \ No newline at end of file