Skip to content

Commit

Permalink
SaveStructureString
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciussanchez committed Apr 19, 2024
1 parent ed6aa38 commit ac43c24
Show file tree
Hide file tree
Showing 3 changed files with 210 additions and 1 deletion.
137 changes: 136 additions & 1 deletion samples/delphi/basic/basic.dproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{A3A36D6D-4E03-4080-9131-6EE072988A8A}</ProjectGuid>
<ProjectVersion>19.5</ProjectVersion>
<ProjectVersion>20.1</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>basic.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
<ProjectName Condition="'$(ProjectName)'==''">basic</ProjectName>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
Expand Down Expand Up @@ -223,6 +224,16 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDefV21">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
Expand All @@ -243,6 +254,66 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV31">
<Platform Name="Android">
<RemoteDir>res\values-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIcon">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v26</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v26</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIconBackground">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIconForeground">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIconMonochrome">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIconV33">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v33</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v33</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
Expand All @@ -253,6 +324,16 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_ColorsDark">
<Platform Name="Android">
<RemoteDir>res\values-night-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-night-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
Expand Down Expand Up @@ -423,6 +504,56 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedNotificationIcon">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v24</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v24</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedSplash">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedSplashDark">
<Platform Name="Android">
<RemoteDir>res\drawable-night-anydpi-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-night-anydpi-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedSplashV31">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedSplashV31Dark">
<Platform Name="Android">
<RemoteDir>res\drawable-night-anydpi-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-night-anydpi-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
Expand Down Expand Up @@ -663,6 +794,9 @@
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64x">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
Expand Down Expand Up @@ -956,6 +1090,7 @@
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64x" Name="$(PROJECTNAME)"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>
Expand Down
61 changes: 61 additions & 0 deletions samples/delphi/basic/basic.skincfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[ExpressSkins]
Default=1
ShowNotifications=1
Enabled=1
dxSkinBasic=1
dxSkinBlack=1
dxSkinBlue=1
dxSkinBlueprint=1
dxSkinCaramel=1
dxSkinCoffee=1
dxSkinDarkRoom=1
dxSkinDarkSide=1
dxSkinDevExpressDarkStyle=1
dxSkinDevExpressStyle=1
dxSkinFoggy=1
dxSkinGlassOceans=1
dxSkinHighContrast=1
dxSkiniMaginary=1
dxSkinLilian=1
dxSkinLiquidSky=1
dxSkinLondonLiquidSky=1
dxSkinMcSkin=1
dxSkinMetropolis=1
dxSkinMetropolisDark=1
dxSkinMoneyTwins=1
dxSkinOffice2007Black=1
dxSkinOffice2007Blue=1
dxSkinOffice2007Green=1
dxSkinOffice2007Pink=1
dxSkinOffice2007Silver=1
dxSkinOffice2010Black=1
dxSkinOffice2010Blue=1
dxSkinOffice2010Silver=1
dxSkinOffice2013DarkGray=1
dxSkinOffice2013LightGray=1
dxSkinOffice2013White=1
dxSkinOffice2016Colorful=1
dxSkinOffice2016Dark=1
dxSkinOffice2019Black=1
dxSkinOffice2019Colorful=1
dxSkinOffice2019DarkGray=1
dxSkinOffice2019White=1
dxSkinPumpkin=1
dxSkinSeven=1
dxSkinSevenClassic=1
dxSkinSharp=1
dxSkinSharpPlus=1
dxSkinSilver=1
dxSkinSpringTime=1
dxSkinStardust=1
dxSkinSummer2008=1
dxSkinTheAsphaltWorld=1
dxSkinTheBezier=1
dxSkinValentine=1
dxSkinVisualStudio2013Blue=1
dxSkinVisualStudio2013Dark=1
dxSkinVisualStudio2013Light=1
dxSkinVS2010=1
dxSkinWhiteprint=1
dxSkinWXI=1
dxSkinXmas2008Blue=1
13 changes: 13 additions & 0 deletions src/DataSet.Serialize.pas
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ TDataSetSerializeHelper = class Helper for TDataSet
/// Invisible fields will not be generated.
/// </remarks>
function SaveStructure: TJSONArray;
function SaveStructureString: string;
/// <summary>
/// Loads fields from a DataSet based on a JSONArray.
/// </summary>
Expand Down Expand Up @@ -321,6 +322,18 @@ function TDataSetSerializeHelper.SaveStructure: TJSONArray;
end;
end;

function TDataSetSerializeHelper.SaveStructureString: string;
var
LJSONArray: TJSONArray;
begin
LJSONArray := Self.SaveStructure;
try
Result := {$IF DEFINED(FPC)}LJSONArray.AsJSON{$ELSE}LJSONArray.ToString{$ENDIF};
finally
LJSONArray.Free;
end;
end;

function TDataSetSerializeHelper.ValidateJSON(const AJSONObject: TJSONObject; const ALang: TLanguageType = enUS; const AOwns: Boolean = True): TJSONArray;
var
LJSONSerialize: TJSONSerialize;
Expand Down

0 comments on commit ac43c24

Please sign in to comment.