Explorar o código

samples updated

Unknown %!s(int64=7) %!d(string=hai) anos
pai
achega
e2cd315960
Modificáronse 24 ficheiros con 1311 adicións e 660 borrados
  1. 24 13
      samples/delphi/QuickConfig/ConfigToFileAndRegistry/Main.pas
  2. 1 551
      samples/delphi/QuickConfig/ConfigToFileAndRegistry/Win64/Debug/Config.json
  3. 17 0
      samples/delphi/QuickJsonSerializer/JsonSerializer.dpr
  4. 289 0
      samples/delphi/QuickJsonSerializer/JsonSerializer.dproj
  5. BIN=BIN
      samples/delphi/QuickJsonSerializer/JsonSerializer.res
  6. 43 0
      samples/delphi/QuickJsonSerializer/frmMain.fmx
  7. 236 0
      samples/delphi/QuickJsonSerializer/frmMain.pas
  8. 1 0
      samples/fpc/QuickConfig/ConfigToFileAndRegistry/QuickConfig.lpi
  9. 1 0
      samples/fpc/QuickConfig/ConfigToFileAndRegistry/backup/QuickConfig.lpi
  10. 24 6
      samples/fpc/QuickConfig/ConfigToFileAndRegistry/backup/umain.lfm
  11. 101 40
      samples/fpc/QuickConfig/ConfigToFileAndRegistry/backup/umain.pas
  12. BIN=BIN
      samples/fpc/QuickConfig/ConfigToFileAndRegistry/lib/i386-win32/QuickConfig.or
  13. 24 6
      samples/fpc/QuickConfig/ConfigToFileAndRegistry/lib/i386-win32/umain.lfm
  14. 24 6
      samples/fpc/QuickConfig/ConfigToFileAndRegistry/umain.lfm
  15. 101 38
      samples/fpc/QuickConfig/ConfigToFileAndRegistry/umain.pas
  16. BIN=BIN
      samples/fpc/QuickJsonSerializer/JsonSerializer.ico
  17. 84 0
      samples/fpc/QuickJsonSerializer/JsonSerializer.lpi
  18. 22 0
      samples/fpc/QuickJsonSerializer/JsonSerializer.lpr
  19. BIN=BIN
      samples/fpc/QuickJsonSerializer/JsonSerializer.res
  20. BIN=BIN
      samples/fpc/QuickJsonSerializer/lib/i386-win32/JsonSerializer.or
  21. BIN=BIN
      samples/fpc/QuickJsonSerializer/lib/i386-win32/JsonSerializer.res
  22. 40 0
      samples/fpc/QuickJsonSerializer/lib/i386-win32/main.lfm
  23. 40 0
      samples/fpc/QuickJsonSerializer/main.lfm
  24. 239 0
      samples/fpc/QuickJsonSerializer/main.pas

+ 24 - 13
samples/delphi/QuickConfig/ConfigToFileAndRegistry/Main.pas

@@ -44,19 +44,27 @@ type
     fTitle : string;
     fHidden : Boolean;
     fSessionName: string;
+    fSizes : TArray<Integer>;
+    fLastFilename : string;
+    fWindowPos : TWinPos;
+    fHistory : TArray<TProcessType>;
+    fComplex : TProcessType;
+    fModifyDate : TDateTime;
+    fWorkList : TObjectList<TWorker>;
+  published
+    property Sizes : TArray<Integer> read fSizes write fSizes;
+    property LastFilename : string read fLastFilename write fLastFilename;
+    property WindowPos : TWinPos read fWindowPos write fWindowPos;
+    property History : TArray<TProcessType> read fHistory write fHistory;
+    property Complex : TProcessType read fComplex write fComplex;
+    property ModifyDate : TDateTime read fModifyDate write fModifyDate;
+    property Title : string read fTitle write fTitle;
+    property SessionName : string read fSessionName write fSessionName;
   public
-    Sizes : array of Integer;
-    LastFilename : string;
-    WindowPos : TWinPos;
-    History : array of TProcessType;
-    Complex : TProcessType;
-    ModifyDate : TDateTime;
-    WorkList : TObjectList<TWorker>;
+    property WorkList : TObjectList<TWorker> read fWorkList write fWorkList;
     constructor Create; override;
     destructor Destroy; override;
     procedure DefaultValues;
-    property Title : string read fTitle write fTitle;
-    property SessionName : string read fSessionName write fSessionName;
   end;
 
   TMainForm = class(TForm)
@@ -119,16 +127,19 @@ end;
 
 procedure TMainForm.SetConfig(cConfig : TMyConfig);
 var
+  winpos : TWinpos;
   protype : TProcessType;
   i : Integer;
   worker : TWorker;
 begin
   cConfig.LastFilename := 'library.txt';
   cConfig.Sizes := [23,11,554,12,34,29,77,30,48,59,773,221,98,3,22,983,122,231,433,12,31,987];
-  cConfig.WindowPos.PosX := 640;
-  cConfig.WindowPos.PosX := 480;
-  cConfig.Complex.Priority := msHigh;
-  cConfig.Complex.Redundant := False;
+  winpos.PosX := 640;
+  winpos.PosX := 480;
+  cConfig.WindowPos := winpos;
+  protype.Priority := msHigh;
+  protype.Redundant := False;
+  cConfig.Complex := protype;
   cConfig.Title := 'a fresh title';
   cConfig.SessionName := 'First Session';
   for I := 0 to 22 do

+ 1 - 551
samples/delphi/QuickConfig/ConfigToFileAndRegistry/Win64/Debug/Config.json

@@ -1,551 +1 @@
-{
-  "Sizes": [
-    23,
-    11,
-    554,
-    12,
-    34,
-    29,
-    77,
-    30,
-    48,
-    59,
-    773,
-    221,
-    98,
-    3,
-    22,
-    983,
-    122,
-    231,
-    433,
-    12,
-    31,
-    987
-  ],
-  "LastFilename": "library.txt",
-  "WindowPos": {
-    "PosX": 480,
-    "PosY": 0
-  },
-  "History": [
-    {
-      "Id": 0,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 1,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 2,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 3,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 4,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 5,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 6,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 7,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 8,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 9,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 10,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 11,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 12,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 13,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 14,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 15,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 0,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 1,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 2,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 3,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 4,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 5,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 6,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 7,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 8,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 9,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 10,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 11,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 12,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 13,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 14,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 15,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 0,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 1,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 2,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 3,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 4,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 5,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 6,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 7,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 8,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 9,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 10,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 11,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 12,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 13,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 14,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 15,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 0,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 1,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 2,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 3,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 4,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 5,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 6,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 7,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 8,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 9,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 10,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 11,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 12,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 13,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 14,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 15,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 0,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 1,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 2,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 3,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 4,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 5,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 6,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 7,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 8,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 9,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 10,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 11,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 12,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 13,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 14,
-      "Priority": 0,
-      "Redundant": true
-    },
-    {
-      "Id": 15,
-      "Priority": 0,
-      "Redundant": true
-    }
-  ],
-  "Complex": {
-    "Id": 0,
-    "Priority": 2,
-    "Redundant": false
-  },
-  "ModifyDate": "11/11/2017 16:37:39",
-  "WorkList": {
-    "FOwnsObjects": true,
-    "FListHelper": {
-      "FCount": 23
-    },
-    "FItems": [
-      {
-        "Name": "Process 0",
-        "Active": false
-      },
-      {
-        "Name": "Process 1",
-        "Active": false
-      },
-      {
-        "Name": "Process 2",
-        "Active": false
-      },
-      {
-        "Name": "Process 3",
-        "Active": false
-      },
-      {
-        "Name": "Process 4",
-        "Active": false
-      },
-      {
-        "Name": "Process 5",
-        "Active": false
-      },
-      {
-        "Name": "Process 6",
-        "Active": false
-      },
-      {
-        "Name": "Process 7",
-        "Active": false
-      },
-      {
-        "Name": "Process 8",
-        "Active": false
-      },
-      {
-        "Name": "Process 9",
-        "Active": false
-      },
-      {
-        "Name": "Process 10",
-        "Active": false
-      },
-      {
-        "Name": "Process 11",
-        "Active": false
-      },
-      {
-        "Name": "Process 12",
-        "Active": false
-      },
-      {
-        "Name": "Process 13",
-        "Active": false
-      },
-      {
-        "Name": "Process 14",
-        "Active": false
-      },
-      {
-        "Name": "Process 15",
-        "Active": false
-      },
-      {
-        "Name": "Process 16",
-        "Active": false
-      },
-      {
-        "Name": "Process 17",
-        "Active": false
-      },
-      {
-        "Name": "Process 18",
-        "Active": false
-      },
-      {
-        "Name": "Process 19",
-        "Active": false
-      },
-      {
-        "Name": "Process 20",
-        "Active": false
-      },
-      {
-        "Name": "Process 21",
-        "Active": false
-      },
-      {
-        "Name": "Process 22",
-        "Active": false
-      },
-      null,
-      null,
-      null,
-      null,
-      null,
-      null,
-      null,
-      null,
-      null
-    ],
-    "FComparer": {}
-  },
-  "Title": "a fresh title",
-  "SessionName": "First Session"
-}
+{"Sizes":[23,11,554,12,34,29,77,30,48,59,773,221,98,3,22,983,122,231,433,12,31,987],"LastFilename":"library.txt","WindowPos":{"PosX":480,"PosY":0},"History":[{"Id":0,"Priority":"msLow","Redundant":true},{"Id":1,"Priority":"msLow","Redundant":true},{"Id":2,"Priority":"msLow","Redundant":true},{"Id":3,"Priority":"msLow","Redundant":true},{"Id":4,"Priority":"msLow","Redundant":true},{"Id":5,"Priority":"msLow","Redundant":true},{"Id":6,"Priority":"msLow","Redundant":true},{"Id":7,"Priority":"msLow","Redundant":true},{"Id":8,"Priority":"msLow","Redundant":true},{"Id":9,"Priority":"msLow","Redundant":true},{"Id":10,"Priority":"msLow","Redundant":true},{"Id":11,"Priority":"msLow","Redundant":true},{"Id":12,"Priority":"msLow","Redundant":true},{"Id":13,"Priority":"msLow","Redundant":true},{"Id":14,"Priority":"msLow","Redundant":true},{"Id":15,"Priority":"msLow","Redundant":true}],"Complex":{"Id":88586818,"Priority":"msHigh","Redundant":false},"ModifyDate":"2018-07-17T14:38:51.937Z","Title":"a fresh title","SessionName":"First Session"}

+ 17 - 0
samples/delphi/QuickJsonSerializer/JsonSerializer.dpr

@@ -0,0 +1,17 @@
+program JsonSerializer;
+
+uses
+  System.StartUpCopy,
+  FMX.Forms,
+  main in 'C:\Users\Kike\Documents\Embarcadero\Studio\Projects\JsonUtilsTest\main.pas' {Form1},
+  jsonit in 'C:\Users\Kike\Documents\Embarcadero\Studio\Projects\JsonUtilsTest\jsonit.pas',
+  Quick.Json.Serializer in 'C:\Users\Kike\Documents\Embarcadero\Studio\Projects\JsonUtilsTest\Quick.Json.Serializer.pas';
+
+{$R *.res}
+
+begin
+  ReportMemoryLeaksOnShutdown := True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.

+ 289 - 0
samples/delphi/QuickJsonSerializer/JsonSerializer.dproj

@@ -0,0 +1,289 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+    <PropertyGroup>
+        <ProjectGuid>{9C6576EF-31E8-4604-A9A1-B9FAC5DBF05A}</ProjectGuid>
+        <MainSource>JsonSerializer.dpr</MainSource>
+        <Base>True</Base>
+        <Config Condition="'$(Config)'==''">Debug</Config>
+        <TargetedPlatforms>1025</TargetedPlatforms>
+        <AppType>Application</AppType>
+        <FrameworkType>FMX</FrameworkType>
+        <ProjectVersion>18.4</ProjectVersion>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Android' and '$(Base)'=='true') or '$(Base_Android)'!=''">
+        <Base_Android>true</Base_Android>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='iOSDevice32' and '$(Base)'=='true') or '$(Base_iOSDevice32)'!=''">
+        <Base_iOSDevice32>true</Base_iOSDevice32>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='iOSDevice64' and '$(Base)'=='true') or '$(Base_iOSDevice64)'!=''">
+        <Base_iOSDevice64>true</Base_iOSDevice64>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='iOSSimulator' and '$(Base)'=='true') or '$(Base_iOSSimulator)'!=''">
+        <Base_iOSSimulator>true</Base_iOSSimulator>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='OSX32' and '$(Base)'=='true') or '$(Base_OSX32)'!=''">
+        <Base_OSX32>true</Base_OSX32>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+        <Base_Win32>true</Base_Win32>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+        <Base_Win64>true</Base_Win64>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
+        <Cfg_1>true</Cfg_1>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
+        <Cfg_1_Win32>true</Cfg_1_Win32>
+        <CfgParent>Cfg_1</CfgParent>
+        <Cfg_1>true</Cfg_1>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
+        <Cfg_2>true</Cfg_2>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='iOSDevice32' and '$(Cfg_2)'=='true') or '$(Cfg_2_iOSDevice32)'!=''">
+        <Cfg_2_iOSDevice32>true</Cfg_2_iOSDevice32>
+        <CfgParent>Cfg_2</CfgParent>
+        <Cfg_2>true</Cfg_2>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='iOSDevice64' and '$(Cfg_2)'=='true') or '$(Cfg_2_iOSDevice64)'!=''">
+        <Cfg_2_iOSDevice64>true</Cfg_2_iOSDevice64>
+        <CfgParent>Cfg_2</CfgParent>
+        <Cfg_2>true</Cfg_2>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='iOSSimulator' and '$(Cfg_2)'=='true') or '$(Cfg_2_iOSSimulator)'!=''">
+        <Cfg_2_iOSSimulator>true</Cfg_2_iOSSimulator>
+        <CfgParent>Cfg_2</CfgParent>
+        <Cfg_2>true</Cfg_2>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='OSX32' and '$(Cfg_2)'=='true') or '$(Cfg_2_OSX32)'!=''">
+        <Cfg_2_OSX32>true</Cfg_2_OSX32>
+        <CfgParent>Cfg_2</CfgParent>
+        <Cfg_2>true</Cfg_2>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
+        <Cfg_2_Win32>true</Cfg_2_Win32>
+        <CfgParent>Cfg_2</CfgParent>
+        <Cfg_2>true</Cfg_2>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base)'!=''">
+        <DCC_E>false</DCC_E>
+        <DCC_F>false</DCC_F>
+        <DCC_K>false</DCC_K>
+        <DCC_N>false</DCC_N>
+        <DCC_S>false</DCC_S>
+        <DCC_ImageBase>00400000</DCC_ImageBase>
+        <SanitizedProjectName>JsonSerializer</SanitizedProjectName>
+        <VerInfo_Locale>3082</VerInfo_Locale>
+        <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
+        <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
+        <Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
+        <Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Android)'!=''">
+        <VerInfo_Keys>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=</VerInfo_Keys>
+        <BT_BuildType>Debug</BT_BuildType>
+        <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+        <Android_LauncherIcon36>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png</Android_LauncherIcon36>
+        <Android_LauncherIcon48>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png</Android_LauncherIcon48>
+        <Android_LauncherIcon72>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png</Android_LauncherIcon72>
+        <Android_LauncherIcon96>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png</Android_LauncherIcon96>
+        <Android_LauncherIcon144>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png</Android_LauncherIcon144>
+        <Android_SplashImage426>$(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png</Android_SplashImage426>
+        <Android_SplashImage470>$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png</Android_SplashImage470>
+        <Android_SplashImage640>$(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png</Android_SplashImage640>
+        <Android_SplashImage960>$(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png</Android_SplashImage960>
+        <AUP_ACCESS_COARSE_LOCATION>true</AUP_ACCESS_COARSE_LOCATION>
+        <AUP_ACCESS_FINE_LOCATION>true</AUP_ACCESS_FINE_LOCATION>
+        <AUP_CALL_PHONE>true</AUP_CALL_PHONE>
+        <AUP_CAMERA>true</AUP_CAMERA>
+        <AUP_INTERNET>true</AUP_INTERNET>
+        <AUP_READ_CALENDAR>true</AUP_READ_CALENDAR>
+        <AUP_READ_EXTERNAL_STORAGE>true</AUP_READ_EXTERNAL_STORAGE>
+        <AUP_WRITE_CALENDAR>true</AUP_WRITE_CALENDAR>
+        <AUP_WRITE_EXTERNAL_STORAGE>true</AUP_WRITE_EXTERNAL_STORAGE>
+        <AUP_READ_PHONE_STATE>true</AUP_READ_PHONE_STATE>
+        <EnabledSysJars>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</EnabledSysJars>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_iOSDevice32)'!=''">
+        <VerInfo_Keys>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 &amp; 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</VerInfo_Keys>
+        <VerInfo_UIDeviceFamily>iPhoneAndiPad</VerInfo_UIDeviceFamily>
+        <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+        <BT_BuildType>Debug</BT_BuildType>
+        <VerInfo_BundleId>$(MSBuildProjectName)</VerInfo_BundleId>
+        <iPhone_AppIcon60>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png</iPhone_AppIcon60>
+        <iPhone_AppIcon120>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png</iPhone_AppIcon120>
+        <iPhone_Spotlight40>$(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png</iPhone_Spotlight40>
+        <iPhone_Spotlight80>$(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png</iPhone_Spotlight80>
+        <iPad_SpotLight40>$(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png</iPad_SpotLight40>
+        <iPad_SpotLight80>$(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png</iPad_SpotLight80>
+        <iPad_AppIcon76>$(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png</iPad_AppIcon76>
+        <iPad_AppIcon152>$(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png</iPad_AppIcon152>
+        <iPad_Launch768x1024>$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png</iPad_Launch768x1024>
+        <iPad_Launch1024x768>$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png</iPad_Launch1024x768>
+        <iPad_Launch1536x2048>$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png</iPad_Launch1536x2048>
+        <iPad_Launch2048x1536>$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png</iPad_Launch2048x1536>
+        <iPhone_AppIcon87>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_87x87.png</iPhone_AppIcon87>
+        <iPhone_AppIcon180>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png</iPhone_AppIcon180>
+        <iPhone_Launch750>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_750x1334.png</iPhone_Launch750>
+        <iPhone_Launch1242>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2208.png</iPhone_Launch1242>
+        <iPhone_Launch2208>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2208x1242.png</iPhone_Launch2208>
+        <iPhone_Launch1125>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1125x2436.png</iPhone_Launch1125>
+        <iPhone_Launch2436>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2436x1125.png</iPhone_Launch2436>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_iOSDevice64)'!=''">
+        <iPhone_AppIcon87>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_87x87.png</iPhone_AppIcon87>
+        <iPhone_AppIcon180>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png</iPhone_AppIcon180>
+        <iPhone_Launch750>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_750x1334.png</iPhone_Launch750>
+        <iPhone_Launch1242>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2208.png</iPhone_Launch1242>
+        <iPhone_Launch2208>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2208x1242.png</iPhone_Launch2208>
+        <iPhone_Launch1125>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1125x2436.png</iPhone_Launch1125>
+        <iPhone_Launch2436>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2436x1125.png</iPhone_Launch2436>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_iOSSimulator)'!=''">
+        <VerInfo_Keys>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 &amp; 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</VerInfo_Keys>
+        <VerInfo_UIDeviceFamily>iPhoneAndiPad</VerInfo_UIDeviceFamily>
+        <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+        <iPhone_AppIcon60>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png</iPhone_AppIcon60>
+        <iPhone_AppIcon120>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png</iPhone_AppIcon120>
+        <iPhone_Spotlight40>$(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png</iPhone_Spotlight40>
+        <iPhone_Spotlight80>$(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png</iPhone_Spotlight80>
+        <iPad_SpotLight40>$(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png</iPad_SpotLight40>
+        <iPad_SpotLight80>$(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png</iPad_SpotLight80>
+        <iPad_AppIcon76>$(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png</iPad_AppIcon76>
+        <iPad_AppIcon152>$(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png</iPad_AppIcon152>
+        <iPad_Launch768x1024>$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png</iPad_Launch768x1024>
+        <iPad_Launch1024x768>$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png</iPad_Launch1024x768>
+        <iPad_Launch1536x2048>$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png</iPad_Launch1536x2048>
+        <iPad_Launch2048x1536>$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png</iPad_Launch2048x1536>
+        <iPhone_AppIcon87>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_87x87.png</iPhone_AppIcon87>
+        <iPhone_AppIcon180>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png</iPhone_AppIcon180>
+        <iPhone_Launch750>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_750x1334.png</iPhone_Launch750>
+        <iPhone_Launch1242>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2208.png</iPhone_Launch1242>
+        <iPhone_Launch2208>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2208x1242.png</iPhone_Launch2208>
+        <iPhone_Launch1125>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1125x2436.png</iPhone_Launch1125>
+        <iPhone_Launch2436>$(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2436x1125.png</iPhone_Launch2436>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_OSX32)'!=''">
+        <Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win32)'!=''">
+        <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+        <BT_BuildType>Debug</BT_BuildType>
+        <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+        <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
+        <VerInfo_Locale>1033</VerInfo_Locale>
+        <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+        <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
+        <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
+        <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win64)'!=''">
+        <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
+        <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_1)'!=''">
+        <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+        <DCC_DebugInformation>0</DCC_DebugInformation>
+        <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+        <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
+        <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
+        <AppEnableHighDPI>true</AppEnableHighDPI>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2)'!=''">
+        <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+        <DCC_Optimize>false</DCC_Optimize>
+        <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2_iOSDevice32)'!=''">
+        <DCC_RemoteDebug>true</DCC_RemoteDebug>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2_iOSDevice64)'!=''">
+        <BT_BuildType>Debug</BT_BuildType>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2_iOSSimulator)'!=''">
+        <DCC_RemoteDebug>true</DCC_RemoteDebug>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2_OSX32)'!=''">
+        <Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
+        <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
+        <AppEnableHighDPI>true</AppEnableHighDPI>
+        <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
+    </PropertyGroup>
+    <ItemGroup>
+        <DelphiCompile Include="$(MainSource)">
+            <MainSource>MainSource</MainSource>
+        </DelphiCompile>
+        <DCCReference Include="C:\Users\Kike\Documents\Embarcadero\Studio\Projects\JsonUtilsTest\main.pas">
+            <Form>Form1</Form>
+        </DCCReference>
+        <DCCReference Include="C:\Users\Kike\Documents\Embarcadero\Studio\Projects\JsonUtilsTest\jsonit.pas"/>
+        <DCCReference Include="C:\Users\Kike\Documents\Embarcadero\Studio\Projects\JsonUtilsTest\Quick.Json.Serializer.pas"/>
+        <BuildConfiguration Include="Debug">
+            <Key>Cfg_2</Key>
+            <CfgParent>Base</CfgParent>
+        </BuildConfiguration>
+        <BuildConfiguration Include="Base">
+            <Key>Base</Key>
+        </BuildConfiguration>
+        <BuildConfiguration Include="Release">
+            <Key>Cfg_1</Key>
+            <CfgParent>Base</CfgParent>
+        </BuildConfiguration>
+    </ItemGroup>
+    <ProjectExtensions>
+        <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+        <Borland.ProjectType/>
+        <BorlandProject>
+            <Delphi.Personality>
+                <Source>
+                    <Source Name="MainSource">JsonSerializer.dpr</Source>
+                </Source>
+            </Delphi.Personality>
+            <Platforms>
+                <Platform value="Android">False</Platform>
+                <Platform value="iOSDevice32">False</Platform>
+                <Platform value="iOSDevice64">True</Platform>
+                <Platform value="iOSSimulator">False</Platform>
+                <Platform value="OSX32">False</Platform>
+                <Platform value="Win32">True</Platform>
+                <Platform value="Win64">False</Platform>
+            </Platforms>
+        </BorlandProject>
+        <ProjectFileVersion>12</ProjectFileVersion>
+    </ProjectExtensions>
+    <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
+    <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
+</Project>

BIN=BIN
samples/delphi/QuickJsonSerializer/JsonSerializer.res


+ 43 - 0
samples/delphi/QuickJsonSerializer/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

+ 236 - 0
samples/delphi/QuickJsonSerializer/frmMain.pas

@@ -0,0 +1,236 @@
+unit frmMain;
+
+interface
+
+uses
+  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
+  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
+  FMX.Controls.Presentation, FMX.ScrollBox, FMX.Memo, FMX.StdCtrls, Quick.Json.Serializer,
+  System.Generics.Collections;
+
+type
+
+  TID = Int64;
+
+  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;
+  public
+    property Id : TID read fId write fId;
+    property GType : TGroupType read fGType write fGType;
+  end;
+
+  TOptions = class
+  private
+    fOption1 : Integer;
+    fOption2 : string;
+    fAllowGroups : TGroupType;
+  public
+    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;
+    Contacts : TContactIdArray;
+  end;
+
+  TConnectionArray = array of TConnectionInfo;
+
+  TGroupList = TObjectList<TGroup>;
+  //TGroupList = class(TObjectList<TGroup>);
+
+  TWorkingTime = class
+  private
+    fWorkDays : TDays;
+    fFreeDays : TDays;
+  public
+    property WorkDays : TDays read fWorkDays write fWorkDays;
+    property FreeDays : TDays read fFreeDays write fFreeDays;
+  end;
+
+  TLevelPrivilege = array of TID;
+
+  TUser = class
+  private
+    fId : TID;
+    fName : string;
+    fSurname : string;
+    fAge : Integer;
+    fAddress : string;
+    fOptions : TOptions;
+    fLastConnections : TConnectionArray;
+    fMarried : Boolean;
+    fWorkingTime : TWorkingTime;
+    [TCommentProperty('gnFemale or gnMale')]
+    fGenre : TGenre;
+    fHireDate : TDateTime;
+    fLevelPrivilege : TLevelPrivilege;
+    fObservations : string;
+    fStatus : TUserStatus;
+    fGroups : TGroupList;
+  public
+    constructor Create;
+    destructor Destroy; override;
+    [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;
+    property Address : string read fAddress write fAddress;
+    [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<TUser>;
+
+
+  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;
+  UserList : TUserList;
+
+implementation
+
+{$R *.fmx}
+
+procedure TForm1.btnFromJsonClick(Sender: TObject);
+var
+  newuser : TUser;
+begin
+  newuser := TUser.Create;
+  try
+    newuser := serializer.JsonToObject(newuser,Memo1.Text) as TUser;
+    //newuser.Groups := serializer.JsonToObject(newuser.Groups,Memo1.Text) as TGroupList;
+    Memo1.Lines.Add('NewUser:');
+    Memo1.Lines.Add(serializer.ObjectToJson(newuser));
+    Memo1.Lines.Add('TGroup OwnsObjects: ' + BoolToStr(newuser.Groups.OwnsObjects,True));
+    Memo1.Lines.Add('TGroup Capacity: ' + newuser.Groups.Capacity.ToString);
+    Memo1.Lines.Add('TGroup Count: ' + newuser.Groups.Count.ToString);
+    Memo1.Lines.Add(newuser.Groups[0].Id.ToString);
+    //Memo1.Lines.Add(serializer.ObjectToJson(newuser.Groups));
+  finally
+    newuser.Free;
+  end;
+end;
+
+procedure TForm1.btnToJsonClick(Sender: TObject);
+begin
+  Memo1.Text := serializer.ObjectToJson(User);
+  btnFromJson.Enabled := True;
+end;
+
+procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
+begin
+  User.Free;
+  serializer.Free;
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+var
+  lastcon : TConnectionInfo;
+  group : TGroup;
+begin
+  serializer := TJsonSerializer.Create(slPublicProperty);
+  user := TUser.Create;
+  user.Id := 77;
+  user.Name := 'Joe';
+  user.Surname := 'Smith';
+  user.Age := 30;
+  user.Married := True;
+  user.Address := 'Sunset st. 2';
+  user.Options.Option1 := 1;
+  user.Options.Option2 := 'good';
+  user.Options.AllowGroups := gtExternal;
+  user.HireDate := Now();
+  user.LevelPrivilege := [1,2,3,4];
+  user.WorkingTime.WorkDays := DEF_WORKDAYS;
+  user.WorkingTime.FreeDays := DEF_WEEKEND;
+  user.Observations := 'Good aptitude';
+  user.Status := TUserStatus.usOnVacation;
+  lastcon.IP := '127.0.0.1';
+  lastcon.ConnectionDate := Now();
+  lastcon.Contacts := [1,2,3,4,5];
+  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.

+ 1 - 0
samples/fpc/QuickConfig/ConfigToFileAndRegistry/QuickConfig.lpi

@@ -47,6 +47,7 @@
         <Filename Value="umain.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="uMain"/>
       </Unit2>

+ 1 - 0
samples/fpc/QuickConfig/ConfigToFileAndRegistry/backup/QuickConfig.lpi

@@ -47,6 +47,7 @@
         <Filename Value="umain.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="uMain"/>
       </Unit2>

+ 24 - 6
samples/fpc/QuickConfig/ConfigToFileAndRegistry/backup/umain.lfm

@@ -1,28 +1,28 @@
 object Form1: TForm1
   Left = 379
-  Height = 433
+  Height = 457
   Top = 229
   Width = 592
   Caption = 'Form1'
-  ClientHeight = 433
+  ClientHeight = 457
   ClientWidth = 592
   OnClose = FormClose
   OnCreate = FormCreate
   LCLVersion = '1.9.0.0'
   object btnSaveJson: TButton
-    Left = 456
+    Left = 448
     Height = 25
     Top = 384
-    Width = 107
+    Width = 120
     Caption = 'Save to Json'
     OnClick = btnSaveJsonClick
     TabOrder = 0
   end
   object btnLoadJson: TButton
-    Left = 336
+    Left = 312
     Height = 25
     Top = 384
-    Width = 107
+    Width = 123
     Caption = 'Load From Json'
     OnClick = btnLoadJsonClick
     TabOrder = 1
@@ -36,4 +36,22 @@ object Form1: TForm1
     ScrollBars = ssAutoBoth
     TabOrder = 2
   end
+  object btnSaveRegistry: TButton
+    Left = 448
+    Height = 25
+    Top = 416
+    Width = 120
+    Caption = 'Save to Registry'
+    OnClick = btnSaveRegistryClick
+    TabOrder = 3
+  end
+  object btnLoadRegistry: TButton
+    Left = 312
+    Height = 25
+    Top = 416
+    Width = 123
+    Caption = 'Load From Registry'
+    OnClick = btnLoadRegistryClick
+    TabOrder = 4
+  end
 end

+ 101 - 40
samples/fpc/QuickConfig/ConfigToFileAndRegistry/backup/umain.pas

@@ -7,65 +7,92 @@ interface
 uses
   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
   Quick.Config,
-  //Quick.Config.Provider.Registry,
+  Quick.Config.Provider.Registry,
   Generics.Collections,
+  registry,
   Quick.Config.Provider.Json;
 
 type
 
   TMyPriority = (msLow, msMed, msHigh);
 
-  TWinPos = record
-    PosX : Integer;
-    PosY : Integer;
+  TWinPos = class
+  private
+    fPosX : Integer;
+    fPosY : Integer;
+  published
+    property PosX : Integer read fPosX write fPosX;
+    property PosY : Integer read fPosY write fPosY;
   end;
 
-  TProcessType = record
-    Id : Integer;
-    Priority : TMyPriority;
-    Redundant : Boolean;
+  TProcessType = class
+  private
+    fId : Integer;
+    fPriority : TMyPriority;
+    fRedundant : Boolean;
+  published
+    property Id : Integer read fId write fId;
+    property Priority : TMyPriority read fPriority write fPriority;
+    property Redundant : Boolean read fRedundant write fRedundant;
   end;
 
   TWorker = class
-    Name : string;
-    Active : Boolean;
+  private
+    fName : string;
+    fActive : Boolean;
+  published
+    property Name : string read fName write fName;
+    property Active : Boolean read fActive write fActive;
   end;
 
-  {$M+} TMyConfig2 = class(TAppConfig)
+  TMyConfig2 = class(TAppConfig)
   private
     fhola : Integer;
   published
     property hola : Integer read fhola write fhola;
   end;
 
-  {$M+} TMyConfig = class(TAppConfig)
+  TMyConfig = class(TAppConfig)
   private
     fTitle : string;
     fHidden : Boolean;
     fSessionName: string;
+    fSizes : TArray<Integer>;
+    fLastFilename : string;
+    fWindowPos : TWinPos;
+    fHistory : TArray<TProcessType>;
+    fComplex : TProcessType;
+    fModifyDate : TDateTime;
+    fWorkList : TObjectList<TWorker>;
   public
-    Sizes : array of Integer;
-    LastFilename : string;
-    WindowPos : TWinPos;
-    History : array of TProcessType;
-    Complex : TProcessType;
-    ModifyDate : TDateTime;
-    WorkList : TObjectList<TWorker>;
     constructor Create; override;
     destructor Destroy; override;
     procedure DefaultValues;
+    property Hidden : Boolean read fHidden write fHidden;
+  published
     property Title : string read fTitle write fTitle;
     property SessionName : string read fSessionName write fSessionName;
+    property Sizes : TArray<Integer> read fSizes write fSizes;
+    property LastFilename : string read fLastFilename write fLastFilename;
+    //property WindowPos : TWinPos read fWindowPos write fWindowPos;
+    property History : TArray<TProcessType> read fHistory write fHistory;
+    property Complex : TProcessType read fComplex write fComplex;
+    property ModifyDate : TDateTime read fModifyDate write fModifyDate;
+    //property WorkList : TObjectList<TWorker> read fWorkList write fWorkList;
   end;
 
   { TForm1 }
 
   TForm1 = class(TForm)
+    btnLoadRegistry: TButton;
     btnSaveJson: TButton;
     btnLoadJson: TButton;
+    btnSaveRegistry: TButton;
     meInfo: TMemo;
     procedure btnLoadJsonClick(Sender: TObject);
+    procedure btnLoadRegistryClick(Sender: TObject);
     procedure btnSaveJsonClick(Sender: TObject);
+    procedure btnSaveRegistryClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormCreate(Sender: TObject);
   private
@@ -79,29 +106,50 @@ type
 var
   Form1: TForm1;
   ConfigJson : TMyConfig;
-  ConfigJson2 : TMyConfig2;
   ConfigReg : TMyConfig;
   ConfigTest : TMyConfig;
-  AppConfigJson : TAppConfigJsonProvider<TMyConfig2>;
-  //AppConfigReg : TAppConfigRegistryProvider<TMyConfig>;
+  AppConfigJson : TAppConfigJsonProvider<TMyConfig>;
+  AppConfigReg : TAppConfigRegistryProvider<TMyConfig>;
 
 implementation
 
 {$R *.lfm}
 
+uses
+  Quick.Json.Serializer;
+
 { TForm1 }
 
 procedure TForm1.btnSaveJsonClick(Sender: TObject);
 begin
   SetConfig(ConfigJson);
-  AppConfigJson.Save(ConfigJson2);
+  AppConfigJson.Save(ConfigJson);
+  meInfo.Lines.Add(ConfigJson.ToJson);
   meInfo.Lines.Add('Saved Config in Json at ' + DateTimeToStr(ConfigJson.LastSaved));
 end;
 
+procedure TForm1.btnSaveRegistryClick(Sender: TObject);
+begin
+  SetConfig(ConfigJson);
+  AppConfigReg.Save(ConfigJson);
+  meInfo.Lines.Add(ConfigJson.ToJson);
+  meInfo.Lines.Add('Saved Config in Registry at ' + DateTimeToStr(ConfigJson.LastSaved));
+end;
+
 procedure TForm1.btnLoadJsonClick(Sender: TObject);
 begin
   meInfo.Lines.Add('Load ConfigJson');
-  AppConfigJson.Load(ConfigJson2);
+  ConfigJson := TMyConfig.Create;
+  AppConfigJson.Load(ConfigJson);
+  meInfo.Lines.Add(ConfigJson.ToJSON);
+  if TestConfig(ConfigTest,ConfigJson) then meInfo.Lines.Add('Test passed successfully!');
+end;
+
+procedure TForm1.btnLoadRegistryClick(Sender: TObject);
+begin
+  meInfo.Lines.Add('Load ConfigRegistry');
+  ConfigJson := TMyConfig.Create;
+  AppConfigReg.Load(ConfigJson);
   meInfo.Lines.Add(ConfigJson.ToJSON);
   if TestConfig(ConfigTest,ConfigJson) then meInfo.Lines.Add('Test passed successfully!');
 end;
@@ -114,16 +162,16 @@ begin
     Assert(cConfig1.LastFilename = cConfig2.LastFilename);
     for i := Low(cConfig1.Sizes) to High(cConfig1.Sizes) do
       Assert(cConfig1.Sizes[i] = cConfig2.Sizes[i]);
-    Assert(cConfig1.WindowPos.PosX = cConfig2.WindowPos.PosX);
-    Assert(cConfig1.WindowPos.PosX = cConfig2.WindowPos.PosX);
+    //Assert(cConfig1.WindowPos.PosX = cConfig2.WindowPos.PosX);
+    //Assert(cConfig1.WindowPos.PosX = cConfig2.WindowPos.PosX);
     Assert(cConfig1.Complex.Priority = cConfig2.Complex.Priority);
     Assert(cConfig1.Complex.Redundant  = cConfig2.Complex.Redundant);
     Assert(cConfig1.Title = cConfig2.Title);
-    for i := 0 to cConfig1.WorkList.Count - 1 do
-    begin
-      Assert(cConfig1.WorkList[i].Name = cConfig2.WorkList[i].Name);
-      Assert(cConfig1.WorkList[i].Active = cConfig2.WorkList[i].Active);
-    end;
+    //for i := 0 to cConfig1.WorkList.Count - 1 do
+    //begin
+    //  Assert(cConfig1.WorkList[i].Name = cConfig2.WorkList[i].Name);
+    //  Assert(cConfig1.WorkList[i].Active = cConfig2.WorkList[i].Active);
+    //end;
     for i := 0 to High(cConfig1.History) do
     begin
       Assert(cConfig1.History[i].Priority = cConfig2.History[i].Priority);
@@ -139,7 +187,7 @@ end;
 procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
 begin
   if Assigned(AppConfigJson) then AppConfigJson.Free;
-  //if Assigned(AppConfigReg) then AppConfigReg.Free;
+  if Assigned(AppConfigReg) then AppConfigReg.Free;
   if Assigned(ConfigTest) then ConfigTest.Free;
   if Assigned(ConfigReg) then ConfigReg.Free;
   if Assigned(ConfigJson) then ConfigJson.Free;
@@ -149,17 +197,30 @@ procedure TForm1.FormCreate(Sender: TObject);
 begin
   ConfigTest := TMyConfig.Create;
   SetConfig(ConfigTest);
-  AppConfigJson := TAppConfigJsonProvider<TMyConfig2>.Create(ConfigJson2);
+  AppConfigJson := TAppConfigJsonProvider<TMyConfig>.Create(ConfigJson);
   AppConfigJson.CreateIfNotExists := True;
-  AppConfigJson.Filename := 'Config.json';
-  //AppConfigReg := TAppConfigRegistryProvider<TMyConfig>.Create(ConfigReg);
-  //AppConfigReg.HRoot := HKEY_CURRENT_USER;
-  //AppConfigReg.MainKey := '_AppConfig';
+  AppConfigJson.Filename := '.\Config.json';
+  ConfigJson := TMyConfig.Create;
+  AppConfigReg := TAppConfigRegistryProvider<TMyConfig>.Create(ConfigReg);
+  AppConfigReg.HRoot := HKEY_CURRENT_USER;
+  AppConfigReg.MainKey := '_AppConfig';
 end;
 
 procedure TForm1.SetConfig(cConfig: TMyConfig);
+var
+  processtype : TProcessType;
 begin
-
+  cConfig.Title := 'hola';
+  cConfig.Complex := TProcessType.Create;
+  cConfig.Complex.Id := 1;
+  cConfig.Complex.Redundant := True;
+  cConfig.Complex.Priority := TMyPriority.msMed;
+  //processtype := TProcessType.Create;
+  //processtype.Id := 1;
+  //processtype.Priority := msLow;
+  //processtype.Redundant := True;
+  //cConfig.History := [processtype];
+  cConfig.ModifyDate := Now();
 end;
 
 { TMyConfig }
@@ -167,7 +228,7 @@ end;
 constructor TMyConfig.Create;
 begin
   inherited;
-  WorkList := TObjectList<TWorker>.Create(True);
+  //WorkList := TObjectList<TWorker>.Create(True);
   DefaultValues;
 end;
 
@@ -178,7 +239,7 @@ end;
 
 destructor TMyConfig.Destroy;
 begin
-  if Assigned(WorkList) then WorkList.Free;
+  //if Assigned(WorkList) then WorkList.Free;
   inherited;
 end;
 

BIN=BIN
samples/fpc/QuickConfig/ConfigToFileAndRegistry/lib/i386-win32/QuickConfig.or


+ 24 - 6
samples/fpc/QuickConfig/ConfigToFileAndRegistry/lib/i386-win32/umain.lfm

@@ -1,28 +1,28 @@
 object Form1: TForm1
   Left = 379
-  Height = 433
+  Height = 457
   Top = 229
   Width = 592
   Caption = 'Form1'
-  ClientHeight = 433
+  ClientHeight = 457
   ClientWidth = 592
   OnClose = FormClose
   OnCreate = FormCreate
   LCLVersion = '1.9.0.0'
   object btnSaveJson: TButton
-    Left = 456
+    Left = 448
     Height = 25
     Top = 384
-    Width = 107
+    Width = 120
     Caption = 'Save to Json'
     OnClick = btnSaveJsonClick
     TabOrder = 0
   end
   object btnLoadJson: TButton
-    Left = 336
+    Left = 312
     Height = 25
     Top = 384
-    Width = 107
+    Width = 123
     Caption = 'Load From Json'
     OnClick = btnLoadJsonClick
     TabOrder = 1
@@ -36,4 +36,22 @@ object Form1: TForm1
     ScrollBars = ssAutoBoth
     TabOrder = 2
   end
+  object btnSaveRegistry: TButton
+    Left = 448
+    Height = 25
+    Top = 416
+    Width = 120
+    Caption = 'Save to Registry'
+    OnClick = btnSaveRegistryClick
+    TabOrder = 3
+  end
+  object btnLoadRegistry: TButton
+    Left = 312
+    Height = 25
+    Top = 416
+    Width = 123
+    Caption = 'Load From Registry'
+    OnClick = btnLoadRegistryClick
+    TabOrder = 4
+  end
 end

+ 24 - 6
samples/fpc/QuickConfig/ConfigToFileAndRegistry/umain.lfm

@@ -1,28 +1,28 @@
 object Form1: TForm1
   Left = 379
-  Height = 433
+  Height = 457
   Top = 229
   Width = 592
   Caption = 'Form1'
-  ClientHeight = 433
+  ClientHeight = 457
   ClientWidth = 592
   OnClose = FormClose
   OnCreate = FormCreate
   LCLVersion = '1.9.0.0'
   object btnSaveJson: TButton
-    Left = 456
+    Left = 448
     Height = 25
     Top = 384
-    Width = 107
+    Width = 120
     Caption = 'Save to Json'
     OnClick = btnSaveJsonClick
     TabOrder = 0
   end
   object btnLoadJson: TButton
-    Left = 336
+    Left = 312
     Height = 25
     Top = 384
-    Width = 107
+    Width = 123
     Caption = 'Load From Json'
     OnClick = btnLoadJsonClick
     TabOrder = 1
@@ -36,4 +36,22 @@ object Form1: TForm1
     ScrollBars = ssAutoBoth
     TabOrder = 2
   end
+  object btnSaveRegistry: TButton
+    Left = 448
+    Height = 25
+    Top = 416
+    Width = 120
+    Caption = 'Save to Registry'
+    OnClick = btnSaveRegistryClick
+    TabOrder = 3
+  end
+  object btnLoadRegistry: TButton
+    Left = 312
+    Height = 25
+    Top = 416
+    Width = 123
+    Caption = 'Load From Registry'
+    OnClick = btnLoadRegistryClick
+    TabOrder = 4
+  end
 end

+ 101 - 38
samples/fpc/QuickConfig/ConfigToFileAndRegistry/umain.pas

@@ -7,28 +7,44 @@ interface
 uses
   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
   Quick.Config,
-  //Quick.Config.Provider.Registry,
+  Quick.Config.Provider.Registry,
   Generics.Collections,
+  {$IFDEF FPC}
+  registry,
+  {$ENDIF}
   Quick.Config.Provider.Json;
 
 type
 
   TMyPriority = (msLow, msMed, msHigh);
 
-  TWinPos = record
-    PosX : Integer;
-    PosY : Integer;
+  TWinPos = class
+  private
+    fPosX : Integer;
+    fPosY : Integer;
+  published
+    property PosX : Integer read fPosX write fPosX;
+    property PosY : Integer read fPosY write fPosY;
   end;
 
-  TProcessType = record
-    Id : Integer;
-    Priority : TMyPriority;
-    Redundant : Boolean;
+  TProcessType = class
+  private
+    fId : Integer;
+    fPriority : TMyPriority;
+    fRedundant : Boolean;
+  published
+    property Id : Integer read fId write fId;
+    property Priority : TMyPriority read fPriority write fPriority;
+    property Redundant : Boolean read fRedundant write fRedundant;
   end;
 
   TWorker = class
-    Name : string;
-    Active : Boolean;
+  private
+    fName : string;
+    fActive : Boolean;
+  published
+    property Name : string read fName write fName;
+    property Active : Boolean read fActive write fActive;
   end;
 
   TMyConfig2 = class(TAppConfig)
@@ -43,29 +59,42 @@ type
     fTitle : string;
     fHidden : Boolean;
     fSessionName: string;
+    fSizes : TArray<Integer>;
+    fLastFilename : string;
+    fWindowPos : TWinPos;
+    fHistory : TArray<TProcessType>;
+    fComplex : TProcessType;
+    fModifyDate : TDateTime;
+    fWorkList : TObjectList<TWorker>;
   public
-    Sizes : array of Integer;
-    LastFilename : string;
-    WindowPos : TWinPos;
-    History : array of TProcessType;
-    Complex : TProcessType;
-    ModifyDate : TDateTime;
-    WorkList : TObjectList<TWorker>;
     constructor Create; override;
     destructor Destroy; override;
     procedure DefaultValues;
+    property Hidden : Boolean read fHidden write fHidden;
+  published
     property Title : string read fTitle write fTitle;
     property SessionName : string read fSessionName write fSessionName;
+    property Sizes : TArray<Integer> read fSizes write fSizes;
+    property LastFilename : string read fLastFilename write fLastFilename;
+    //property WindowPos : TWinPos read fWindowPos write fWindowPos;
+    property History : TArray<TProcessType> read fHistory write fHistory;
+    property Complex : TProcessType read fComplex write fComplex;
+    property ModifyDate : TDateTime read fModifyDate write fModifyDate;
+    //property WorkList : TObjectList<TWorker> read fWorkList write fWorkList;
   end;
 
   { TForm1 }
 
   TForm1 = class(TForm)
+    btnLoadRegistry: TButton;
     btnSaveJson: TButton;
     btnLoadJson: TButton;
+    btnSaveRegistry: TButton;
     meInfo: TMemo;
     procedure btnLoadJsonClick(Sender: TObject);
+    procedure btnLoadRegistryClick(Sender: TObject);
     procedure btnSaveJsonClick(Sender: TObject);
+    procedure btnSaveRegistryClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormCreate(Sender: TObject);
   private
@@ -79,29 +108,50 @@ type
 var
   Form1: TForm1;
   ConfigJson : TMyConfig;
-  ConfigJson2 : TMyConfig2;
   ConfigReg : TMyConfig;
   ConfigTest : TMyConfig;
-  AppConfigJson : TAppConfigJsonProvider<TMyConfig2>;
-  //AppConfigReg : TAppConfigRegistryProvider<TMyConfig>;
+  AppConfigJson : TAppConfigJsonProvider<TMyConfig>;
+  AppConfigReg : TAppConfigRegistryProvider<TMyConfig>;
 
 implementation
 
 {$R *.lfm}
 
+uses
+  Quick.Json.Serializer;
+
 { TForm1 }
 
 procedure TForm1.btnSaveJsonClick(Sender: TObject);
 begin
   SetConfig(ConfigJson);
-  AppConfigJson.Save(ConfigJson2);
+  AppConfigJson.Save(ConfigJson);
+  meInfo.Lines.Add(ConfigJson.ToJson);
   meInfo.Lines.Add('Saved Config in Json at ' + DateTimeToStr(ConfigJson.LastSaved));
 end;
 
+procedure TForm1.btnSaveRegistryClick(Sender: TObject);
+begin
+  SetConfig(ConfigJson);
+  AppConfigReg.Save(ConfigJson);
+  meInfo.Lines.Add(ConfigJson.ToJson);
+  meInfo.Lines.Add('Saved Config in Registry at ' + DateTimeToStr(ConfigJson.LastSaved));
+end;
+
 procedure TForm1.btnLoadJsonClick(Sender: TObject);
 begin
   meInfo.Lines.Add('Load ConfigJson');
-  AppConfigJson.Load(ConfigJson2);
+  ConfigJson := TMyConfig.Create;
+  AppConfigJson.Load(ConfigJson);
+  meInfo.Lines.Add(ConfigJson.ToJSON);
+  if TestConfig(ConfigTest,ConfigJson) then meInfo.Lines.Add('Test passed successfully!');
+end;
+
+procedure TForm1.btnLoadRegistryClick(Sender: TObject);
+begin
+  meInfo.Lines.Add('Load ConfigRegistry');
+  ConfigJson := TMyConfig.Create;
+  AppConfigReg.Load(ConfigJson);
   meInfo.Lines.Add(ConfigJson.ToJSON);
   if TestConfig(ConfigTest,ConfigJson) then meInfo.Lines.Add('Test passed successfully!');
 end;
@@ -114,16 +164,16 @@ begin
     Assert(cConfig1.LastFilename = cConfig2.LastFilename);
     for i := Low(cConfig1.Sizes) to High(cConfig1.Sizes) do
       Assert(cConfig1.Sizes[i] = cConfig2.Sizes[i]);
-    Assert(cConfig1.WindowPos.PosX = cConfig2.WindowPos.PosX);
-    Assert(cConfig1.WindowPos.PosX = cConfig2.WindowPos.PosX);
+    //Assert(cConfig1.WindowPos.PosX = cConfig2.WindowPos.PosX);
+    //Assert(cConfig1.WindowPos.PosX = cConfig2.WindowPos.PosX);
     Assert(cConfig1.Complex.Priority = cConfig2.Complex.Priority);
     Assert(cConfig1.Complex.Redundant  = cConfig2.Complex.Redundant);
     Assert(cConfig1.Title = cConfig2.Title);
-    for i := 0 to cConfig1.WorkList.Count - 1 do
-    begin
-      Assert(cConfig1.WorkList[i].Name = cConfig2.WorkList[i].Name);
-      Assert(cConfig1.WorkList[i].Active = cConfig2.WorkList[i].Active);
-    end;
+    //for i := 0 to cConfig1.WorkList.Count - 1 do
+    //begin
+    //  Assert(cConfig1.WorkList[i].Name = cConfig2.WorkList[i].Name);
+    //  Assert(cConfig1.WorkList[i].Active = cConfig2.WorkList[i].Active);
+    //end;
     for i := 0 to High(cConfig1.History) do
     begin
       Assert(cConfig1.History[i].Priority = cConfig2.History[i].Priority);
@@ -139,7 +189,7 @@ end;
 procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
 begin
   if Assigned(AppConfigJson) then AppConfigJson.Free;
-  //if Assigned(AppConfigReg) then AppConfigReg.Free;
+  if Assigned(AppConfigReg) then AppConfigReg.Free;
   if Assigned(ConfigTest) then ConfigTest.Free;
   if Assigned(ConfigReg) then ConfigReg.Free;
   if Assigned(ConfigJson) then ConfigJson.Free;
@@ -149,17 +199,30 @@ procedure TForm1.FormCreate(Sender: TObject);
 begin
   ConfigTest := TMyConfig.Create;
   SetConfig(ConfigTest);
-  AppConfigJson := TAppConfigJsonProvider<TMyConfig2>.Create(ConfigJson2);
+  AppConfigJson := TAppConfigJsonProvider<TMyConfig>.Create(ConfigJson);
   AppConfigJson.CreateIfNotExists := True;
-  AppConfigJson.Filename := 'Config.json';
-  //AppConfigReg := TAppConfigRegistryProvider<TMyConfig>.Create(ConfigReg);
-  //AppConfigReg.HRoot := HKEY_CURRENT_USER;
-  //AppConfigReg.MainKey := '_AppConfig';
+  AppConfigJson.Filename := '.\Config.json';
+  ConfigJson := TMyConfig.Create;
+  AppConfigReg := TAppConfigRegistryProvider<TMyConfig>.Create(ConfigReg);
+  AppConfigReg.HRoot := HKEY_CURRENT_USER;
+  AppConfigReg.MainKey := '_AppConfig';
 end;
 
 procedure TForm1.SetConfig(cConfig: TMyConfig);
+var
+  processtype : TProcessType;
 begin
-
+  cConfig.Title := 'hola';
+  cConfig.Complex := TProcessType.Create;
+  cConfig.Complex.Id := 1;
+  cConfig.Complex.Redundant := True;
+  cConfig.Complex.Priority := TMyPriority.msMed;
+  //processtype := TProcessType.Create;
+  //processtype.Id := 1;
+  //processtype.Priority := msLow;
+  //processtype.Redundant := True;
+  //cConfig.History := [processtype];
+  cConfig.ModifyDate := Now();
 end;
 
 { TMyConfig }
@@ -167,7 +230,7 @@ end;
 constructor TMyConfig.Create;
 begin
   inherited;
-  WorkList := TObjectList<TWorker>.Create(True);
+  //WorkList := TObjectList<TWorker>.Create(True);
   DefaultValues;
 end;
 
@@ -178,7 +241,7 @@ end;
 
 destructor TMyConfig.Destroy;
 begin
-  if Assigned(WorkList) then WorkList.Free;
+  //if Assigned(WorkList) then WorkList.Free;
   inherited;
 end;
 

BIN=BIN
samples/fpc/QuickJsonSerializer/JsonSerializer.ico


+ 84 - 0
samples/fpc/QuickJsonSerializer/JsonSerializer.lpi

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="JsonSerializer"/>
+      <Scaled Value="True"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+      <XPManifest>
+        <DpiAware Value="True"/>
+      </XPManifest>
+      <Icon Value="0"/>
+    </General>
+    <BuildModes Count="1">
+      <Item1 Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+      <Modes Count="0"/>
+    </RunParams>
+    <RequiredPackages Count="1">
+      <Item1>
+        <PackageName Value="LCL"/>
+      </Item1>
+    </RequiredPackages>
+    <Units Count="3">
+      <Unit0>
+        <Filename Value="JsonSerializer.lpr"/>
+        <IsPartOfProject Value="True"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="main.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <ResourceBaseClass Value="Form"/>
+      </Unit1>
+      <Unit2>
+        <Filename Value="..\..\..\quick.json.fpc.utils.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="Quick.Json.fpc.Utils"/>
+      </Unit2>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="JsonSerializer"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <Libraries Value="..\..\.."/>
+      <OtherUnitFiles Value="..\..\.."/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 22 - 0
samples/fpc/QuickJsonSerializer/JsonSerializer.lpr

@@ -0,0 +1,22 @@
+program JsonSerializer;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, main
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource:=True;
+  Application.Scaled:=True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+

BIN=BIN
samples/fpc/QuickJsonSerializer/JsonSerializer.res


BIN=BIN
samples/fpc/QuickJsonSerializer/lib/i386-win32/JsonSerializer.or


BIN=BIN
samples/fpc/QuickJsonSerializer/lib/i386-win32/JsonSerializer.res


+ 40 - 0
samples/fpc/QuickJsonSerializer/lib/i386-win32/main.lfm

@@ -0,0 +1,40 @@
+object Form1: TForm1
+  Left = 343
+  Height = 621
+  Top = 226
+  Width = 1025
+  Caption = 'Form1'
+  ClientHeight = 621
+  ClientWidth = 1025
+  OnClose = FormClose
+  OnCreate = FormCreate
+  LCLVersion = '1.9.0.0'
+  object Memo1: TMemo
+    Left = 8
+    Height = 540
+    Top = 8
+    Width = 1008
+    Lines.Strings = (
+      'Memo1'
+    )
+    TabOrder = 0
+  end
+  object btnFromJson: TButton
+    Left = 920
+    Height = 25
+    Top = 582
+    Width = 94
+    Caption = 'FromJson'
+    OnClick = btnFromJsonClick
+    TabOrder = 1
+  end
+  object btnToJson: TButton
+    Left = 808
+    Height = 25
+    Top = 582
+    Width = 99
+    Caption = 'ToJson'
+    OnClick = btnToJsonClick
+    TabOrder = 2
+  end
+end

+ 40 - 0
samples/fpc/QuickJsonSerializer/main.lfm

@@ -0,0 +1,40 @@
+object Form1: TForm1
+  Left = 343
+  Height = 621
+  Top = 226
+  Width = 1025
+  Caption = 'Form1'
+  ClientHeight = 621
+  ClientWidth = 1025
+  OnClose = FormClose
+  OnCreate = FormCreate
+  LCLVersion = '1.9.0.0'
+  object Memo1: TMemo
+    Left = 8
+    Height = 540
+    Top = 8
+    Width = 1008
+    Lines.Strings = (
+      'Memo1'
+    )
+    TabOrder = 0
+  end
+  object btnFromJson: TButton
+    Left = 920
+    Height = 25
+    Top = 582
+    Width = 94
+    Caption = 'FromJson'
+    OnClick = btnFromJsonClick
+    TabOrder = 1
+  end
+  object btnToJson: TButton
+    Left = 808
+    Height = 25
+    Top = 582
+    Width = 99
+    Caption = 'ToJson'
+    OnClick = btnToJsonClick
+    TabOrder = 2
+  end
+end

+ 239 - 0
samples/fpc/QuickJsonSerializer/main.pas

@@ -0,0 +1,239 @@
+unit main;
+
+{$mode delphi}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Quick.Json.Serializer,
+  Generics.Collections;
+
+type
+  TID = Int64;
+
+  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<TGroup>;
+
+  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
+  private
+    fId : TID;
+    fName : string;
+    fSurname : string;
+    fAge : Integer;
+    fAddress : string;
+    fOptions : TOptions;
+    fLastConnections : TConnectionArray;
+    fMarried : Boolean;
+    fWorkingTime : TWorkingTime;
+    //[TCommentProperty('gnFemale or gnMale')]
+    fGenre : TGenre;
+    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;
+    property Address : string read fAddress write fAddress;
+    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<TUser>;
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    btnFromJson: TButton;
+    btnToJson: TButton;
+    Memo1: TMemo;
+    procedure btnFromJsonClick(Sender: TObject);
+    procedure btnToJsonClick(Sender: TObject);
+    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormCreate(Sender: TObject);
+  private
+
+  public
+
+  end;
+
+var
+  serializer : TJsonSerializer;
+  User : TUser;
+  UserList : TUserList;
+
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.btnToJsonClick(Sender: TObject);
+begin
+  Memo1.Text := serializer.ObjectToJson(User);
+  btnFromJson.Enabled := True;
+end;
+
+procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
+begin
+  User.Free;
+  serializer.Free;
+end;
+
+procedure TForm1.btnFromJsonClick(Sender: TObject);
+var
+  newuser : TUser;
+begin
+  newuser := TUser.Create;
+  try
+    newuser := serializer.JsonToObject(newuser,Memo1.Text) as TUser;
+    Memo1.Lines.Add('NewUser:');
+    Memo1.Lines.Add(serializer.ObjectToJson(newuser));
+  finally
+    newuser.Free;
+  end;
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+var
+  lastcon : TConnectionInfo;
+  group : TGroup;
+begin
+  serializer := TJsonSerializer.Create(TSerializeLevel.slPublishedProperty);
+  user := TUser.Create;
+  user.Id := 77;
+  user.Name := 'Joe';
+  user.Surname := 'Smith';
+  user.Age := 30;
+  user.Married := True;
+  user.Address := 'Sunset st. 2';
+  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';
+  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.
+