diff --git a/.gitignore b/.gitignore index 19864c6..19dc229 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,4 @@ __recovery/ # Castalia statistics file (since XE7 Castalia is distributed with Delphi) *.stat +/Generator/Test/Win32 diff --git a/Generator/ProtoBufGenerator.dproj b/Generator/ProtoBufGenerator.dproj index 3d8fbcc..7315e78 100644 --- a/Generator/ProtoBufGenerator.dproj +++ b/Generator/ProtoBufGenerator.dproj @@ -1,7 +1,7 @@  {D34DF9E7-E280-40E5-8974-55D191521066} - 18.1 + 18.2 VCL ProtoBufGenerator.dpr True @@ -34,6 +34,12 @@ true true + + true + Cfg_1 + true + true + true Base @@ -45,6 +51,12 @@ true true + + true + Cfg_2 + true + true + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=kami-soft;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=https://github.com/kami-soft/ProtoBufGenerator true @@ -61,13 +73,23 @@ false + 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= + $(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;svnui;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;svn;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FixInsight_10;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;madExcept_;VirtualTreesR;FireDACMSAccDriver;FireDACInfxDriver;fmxFireDAC;vclimg;madBasic_;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;DataSnapNativeClient;ibxbindings;fmxobj;FireDACDSDriver;soapmidas;rtl;vclwinx;DbxClientDriver;madDisAsm_;DBXSybaseASADriver;CustomIPTransport;vcldsnap;CodeSiteExpressPkg;bindcomp;appanalytics;fgx;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;inetdbxpress;fmxase;$(DCC_UsePackage) 1033 - true $(BDS)\bin\default_app.manifest Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + $(BDS)\bin\default_app.manifest + Debug + 1033 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;VirtualTreesR;FireDACMSAccDriver;FireDACInfxDriver;fmxFireDAC;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;DataSnapNativeClient;ibxbindings;fmxobj;FireDACDSDriver;soapmidas;rtl;vclwinx;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;inetdbxpress;fmxase;$(DCC_UsePackage) @@ -79,12 +101,18 @@ true + Debug true 1033 true true false + + 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= + true + false RELEASE;$(DCC_Define) @@ -95,6 +123,10 @@ true true + + true + true + MainSource @@ -136,19 +168,34 @@ Microsoft Office XP Sample Automation Server Wrapper Components - + ProtoBufGenerator.exe true - + + + 0 + .dll;.bpl + 1 + .dylib + + + Contents\MacOS + 1 + .dylib 1 + .dylib + + + 1 + .dylib @@ -200,19 +247,22 @@ + + 1 + + + 1 + 0 - + 1 Contents\MacOS 1 - - 1 - library\lib\armeabi-v7a 1 @@ -231,6 +281,14 @@ .framework + + + 1 + + + 1 + + 1 @@ -263,12 +321,7 @@ 1 - - - library\lib\x86 - 1 - - + 1 @@ -349,13 +402,23 @@ 1 + + + Assets + 1 + + + Assets + 1 + + - ../ + ..\ 1 - ../ + ..\ 1 @@ -379,7 +442,17 @@ - ../ + ..\ + 1 + + + + + Assets + 1 + + + Assets 1 @@ -502,33 +575,19 @@ 1 - - - 0 - .dll;.bpl - + 1 - .dylib - - - Contents\MacOS - 1 - .dylib 1 - .dylib - - - 1 - .dylib + diff --git a/Generator/ProtoBufGenerator.res b/Generator/ProtoBufGenerator.res index 304fe44..e27e9da 100644 Binary files a/Generator/ProtoBufGenerator.res and b/Generator/ProtoBufGenerator.res differ diff --git a/Generator/ProtoBufGeneratorConsole.dproj b/Generator/ProtoBufGeneratorConsole.dproj index 7e87c6e..7d1b35a 100644 --- a/Generator/ProtoBufGeneratorConsole.dproj +++ b/Generator/ProtoBufGeneratorConsole.dproj @@ -1,7 +1,7 @@  {81A7AF46-9C76-49D6-9775-F01D681DC620} - 18.1 + 18.2 None ProtoBufGeneratorConsole.dpr True @@ -13,31 +13,6 @@ true - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - true Base @@ -75,38 +50,12 @@ false false - - $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png - android-support-v4.dex.jar;apk-expansion.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.dex.jar - $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png - $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png - $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png - $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.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;DataSnapNativeClient;ibxbindings;FireDACDSDriver;soapmidas;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;DataSnapProviderClient;dsnapxml;dbrtl;IndyProtocols;$(DCC_UsePackage) - $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png - $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png - $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png - $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.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;DataSnapNativeClient;ibxbindings;FireDACDSDriver;soapmidas;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;DataSnapProviderClient;dsnapxml;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;DataSnapNativeClient;ibxbindings;FireDACDSDriver;soapmidas;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;DataSnapProviderClient;dsnapxml;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;DataSnapNativeClient;ibxbindings;FireDACDSDriver;soapmidas;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;DataSnapProviderClient;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) - - - true - 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;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;DataSnapNativeClient;ibxbindings;fmxobj;FireDACDSDriver;soapmidas;rtl;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;inetdbxpress;fmxase;$(DCC_UsePackage) - 1033 true Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;svnui;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;svn;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FixInsight_10;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;madExcept_;VirtualTreesR;FireDACMSAccDriver;FireDACInfxDriver;fmxFireDAC;vclimg;madBasic_;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;DataSnapNativeClient;ibxbindings;fmxobj;FireDACDSDriver;soapmidas;rtl;vclwinx;DbxClientDriver;madDisAsm_;DBXSybaseASADriver;CustomIPTransport;vcldsnap;CodeSiteExpressPkg;bindcomp;appanalytics;fgx;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;inetdbxpress;fmxase;$(DCC_UsePackage) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(ModuleName);FileDescription=$(ModuleName);ProductName=$(ModuleName) true @@ -121,6 +70,11 @@ true + ..\Ready + (None) + ..\DCU + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName) + 1033 /f "D:\DelphiComponents\ProtoBuf\Ready" /o "c:\Temp" false @@ -159,8 +113,12 @@ ProtoBufGeneratorConsole.dpr + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + - + true @@ -176,18 +134,38 @@ true + + + true + + ProtoBufGeneratorConsole.exe true - + + + 0 + .dll;.bpl + 1 + .dylib + + + Contents\MacOS + 1 + .dylib 1 + .dylib + + + 1 + .dylib @@ -239,19 +217,22 @@ + + 1 + + + 1 + 0 - + 1 Contents\MacOS 1 - - 1 - library\lib\armeabi-v7a 1 @@ -270,6 +251,14 @@ .framework + + + 1 + + + 1 + + 1 @@ -302,12 +291,7 @@ 1 - - - library\lib\x86 - 1 - - + 1 @@ -388,13 +372,23 @@ 1 + + + Assets + 1 + + + Assets + 1 + + - ../ + ..\ 1 - ../ + ..\ 1 @@ -418,7 +412,17 @@ - ../ + ..\ + 1 + + + + + Assets + 1 + + + Assets 1 @@ -541,43 +545,24 @@ 1 - - - 0 - .dll;.bpl - + 1 - .dylib - - - Contents\MacOS - 1 - .dylib 1 - .dylib - - - 1 - .dylib + - False - False - False - False - False True False diff --git a/Generator/Test/ProtoBufGeneratorTests.dpr b/Generator/Test/ProtoBufGeneratorTests.dpr index 800e39f..4784e3a 100644 --- a/Generator/Test/ProtoBufGeneratorTests.dpr +++ b/Generator/Test/ProtoBufGeneratorTests.dpr @@ -17,6 +17,7 @@ program ProtoBufGeneratorTests; uses DUnitTestRunner, TestuProtoBufParserClasses in 'TestuProtoBufParserClasses.pas', + TestuProtoBufGenerator in 'TestuProtoBufGenerator.pas', uProtoBufParserClasses in '..\uProtoBufParserClasses.pas', uProtoBufParserAbstractClasses in '..\uProtoBufParserAbstractClasses.pas', uProtoBufGenerator in '..\uProtoBufGenerator.pas', @@ -25,7 +26,6 @@ uses pbOutput in '..\..\pbOutput.pas', pbPublic in '..\..\pbPublic.pas', StrBuffer in '..\..\StrBuffer.pas', - TestuProtoBufGenerator in 'TestuProtoBufGenerator.pas', TestProtoBuf in 'TestProtoBuf.pas'; {R *.RES} diff --git a/Generator/Test/ProtoBufGeneratorTests.dproj b/Generator/Test/ProtoBufGeneratorTests.dproj index 7ffd3d9..dba590e 100644 --- a/Generator/Test/ProtoBufGeneratorTests.dproj +++ b/Generator/Test/ProtoBufGeneratorTests.dproj @@ -13,11 +13,6 @@ true - - true - Base - true - true Base @@ -59,9 +54,6 @@ false false - - 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;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;DataSnapNativeClient;ibxbindings;fmxobj;FireDACDSDriver;soapmidas;rtl;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;inetdbxpress;fmxase;$(DCC_UsePackage) - 1033 Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) @@ -96,6 +88,7 @@ MainSource + @@ -104,7 +97,6 @@ - Cfg_2 @@ -147,23 +139,38 @@ true + + + true + + ProtoBufGeneratorTests.exe true - - - true + + + 0 + .dll;.bpl - - 1 + .dylib + + + Contents\MacOS + 1 + .dylib 1 + .dylib + + + 1 + .dylib @@ -543,27 +550,12 @@ 1 - - - 0 - .dll;.bpl - + 1 - .dylib - - - Contents\MacOS - 1 - .dylib 1 - .dylib - - - 1 - .dylib @@ -576,7 +568,6 @@ - False True False diff --git a/Generator/Test/TestGeneratedProtoBufPas.pas b/Generator/Test/TestGeneratedProtoBufPas.pas index fdc158f..4405ed2 100644 --- a/Generator/Test/TestGeneratedProtoBufPas.pas +++ b/Generator/Test/TestGeneratedProtoBufPas.pas @@ -1,4 +1,4 @@ -unit TestGeneratedProtoBufPas; +unit TestGeneratedProtoBufPas; { Delphi DUnit Test Case @@ -76,7 +76,7 @@ procedure TestTTestMsg1.TestSaveLoadFromBuf; begin FTestMsg1.DefField1 := 1; FTestMsg1.DefField2 := 3; - FTestMsg1.DefField3 := 'as'; + FTestMsg1.DefField3 := 'asôâàóöé'; FTestMsg1.DefField4 := -2.5; FTestMsg1.DefField5 := True; FTestMsg1.DefField6 := TEnumG0.g2; @@ -85,7 +85,7 @@ procedure TestTTestMsg1.TestSaveLoadFromBuf; FTestMsg1.DefField9 := 5.5; FTestMsg1.FieldArr1List.Add(-5); FTestMsg1.FieldArr2List.Add(234); - FTestMsg1.FieldArr3List.Add('asdf'); + FTestMsg1.FieldArr3List.Add('asdfçöóêãøò'); tmp := TTestMsg1.Create; try diff --git a/Generator/Test/TestProtoBuf.pas b/Generator/Test/TestProtoBuf.pas index 9900a0e..ef19f92 100644 --- a/Generator/Test/TestProtoBuf.pas +++ b/Generator/Test/TestProtoBuf.pas @@ -1,4 +1,4 @@ -unit TestProtoBuf; +unit TestProtoBuf; { Delphi DUnit Test Case @@ -71,8 +71,8 @@ procedure TestProtoBufMethods.TestDecodeZigZag; CheckEquals(Int64($FFFFFFFFC0000000), decodeZigZag64($000000007FFFFFFF)); CheckEquals(Int64($000000007FFFFFFF), decodeZigZag64($00000000FFFFFFFE)); CheckEquals(Int64($FFFFFFFF80000000), decodeZigZag64($00000000FFFFFFFF)); - CheckEquals(Int64($7FFFFFFFFFFFFFFF), decodeZigZag64($FFFFFFFFFFFFFFFE)); - CheckEquals(Int64($8000000000000000), decodeZigZag64($FFFFFFFFFFFFFFFF)); + CheckEquals(Int64($7FFFFFFFFFFFFFFF), decodeZigZag64(Int64($FFFFFFFFFFFFFFFE))); + CheckEquals(Int64($8000000000000000), decodeZigZag64(Int64($FFFFFFFFFFFFFFFF))); end; procedure TestProtoBufMethods.TestEncodeDecodeZigZag; @@ -196,7 +196,7 @@ TLittleEndianCase = record procedure TestProtoBufMethods.TestReadString; const - TEST_string = ' '; + TEST_string:string = 'Òåñòîâàÿ ñòðîêà'; TEST_integer = 12345678; TEST_single = 12345.123; TEST_double = 1234567890.123; @@ -316,7 +316,7 @@ TVarintCase = record for i := 0 to 7 do begin t := VarintCases[i]; - // + // 耦玟囹?蝈耱钼 狍翦? SetLength(buf, t.Size); for j := 1 to t.Size do buf[j] := AnsiChar(t.bytes[j]); diff --git a/Generator/uProtoBufGenerator.pas b/Generator/uProtoBufGenerator.pas index ada7b0f..4a43f62 100644 --- a/Generator/uProtoBufGenerator.pas +++ b/Generator/uProtoBufGenerator.pas @@ -344,7 +344,7 @@ procedure TProtoBufGenerator.GenerateImplementationSection(Proto: TProtoFile; SL end; SL.Add(' if Result then'); SL.Add(' exit;'); - SL.Add(' case fieldNumber of'); + SL.Add(' case FieldNumber of'); for i := 0 to ProtoMsg.Count - 1 do begin Prop := ProtoMsg[i]; @@ -412,7 +412,7 @@ procedure TProtoBufGenerator.GenerateImplementationSection(Proto: TProtoFile; SL SL.Add(Format(' F%s.Add(T%s(ProtoBuf.readEnum));', [DelphiProp.PropertyName, Prop.PropType])); end else - SL.Add(Format(' F%s.AddFromBuf(ProtoBuf, fieldNumber);', [DelphiProp.PropertyName])); + SL.Add(Format(' F%s.AddFromBuf(ProtoBuf, FieldNumber);', [DelphiProp.PropertyName])); end; SL.Add(' Result := True;'); SL.Add(' end;'); @@ -594,7 +594,7 @@ SL.Add(Format(' T%s = class(T%s)', [ProtoMsg.Name, s])); SL.Add(' destructor Destroy; override;'); SL.Add(''); end; - SL.Add(''); + for i := 0 to ProtoMsg.Count - 1 do begin Prop := ProtoMsg[i]; diff --git a/Generator/ufmMain.dfm b/Generator/ufmMain.dfm index 8ba9738..91649de 100644 --- a/Generator/ufmMain.dfm +++ b/Generator/ufmMain.dfm @@ -11,19 +11,29 @@ object fmMain: TfmMain Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy DesignSize = ( 458 154) PixelsPerInch = 96 TextHeight = 13 - object edProtoFileName: TEdit + object edtProtoFiles: TEdit Left = 8 Top = 16 Width = 409 Height = 21 + TabStop = False Anchors = [akLeft, akTop, akRight] + Font.Charset = DEFAULT_CHARSET + Font.Color = clGray + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + ReadOnly = True TabOrder = 0 - TextHint = 'Choose proto file' + Text = 'Use "..." Choose .proto files Or Drag files into window~' end object btnOpenProtoFile: TButton Left = 423 @@ -45,13 +55,14 @@ object fmMain: TfmMain TabOrder = 2 OnClick = btnGenerateClick end - object edOutputFolder: TEdit + object edtOutputFolder: TEdit Left = 8 Top = 53 Width = 409 Height = 21 Anchors = [akLeft, akTop, akRight] TabOrder = 3 + Text = '.\PbOut' TextHint = 'Choose output folder' end object btnChooseOutputFolder: TButton diff --git a/Generator/ufmMain.pas b/Generator/ufmMain.pas index 3a84edf..79396d3 100644 --- a/Generator/ufmMain.pas +++ b/Generator/ufmMain.pas @@ -3,34 +3,42 @@ interface uses - Winapi.Windows, - Winapi.Messages, - System.SysUtils, - System.Variants, - System.Classes, - Vcl.Graphics, - Vcl.Controls, - Vcl.Forms, - Vcl.Dialogs, - Vcl.StdCtrls, - Vcl.ExtCtrls; + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TfmMain = class(TForm) - edProtoFileName: TEdit; + edtProtoFiles: TEdit; btnOpenProtoFile: TButton; odProtoFile: TFileOpenDialog; btnGenerate: TButton; - edOutputFolder: TEdit; + edtOutputFolder: TEdit; btnChooseOutputFolder: TButton; procedure btnOpenProtoFileClick(Sender: TObject); procedure btnChooseOutputFolderClick(Sender: TObject); procedure btnGenerateClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); private - { Private declarations } - procedure Generate(SourceFiles: TStrings; const OutputDir: string); + FFiles : TArray; + FFileCount: Integer; + + procedure ClearFiles; + procedure WMDropFiles(var Msg: TWMDropFiles); message WM_DROPFILES; + end; + + { Files Drop Class } + TFileCatcher = class(TObject) + private + FDropHandle: THANDLE; + function GetFile(Idx: Integer): string; + function GetFileCount: Integer; + function GetPoint: TPoint; public - { Public declarations } + constructor Create(DropHandle: THANDLE); + destructor Destroy; override; + property FileCount: Integer read GetFileCount; + property Files[Idx: Integer]: string read GetFile; + property DropPoint: TPoint read GetPoint; end; var @@ -39,8 +47,10 @@ TfmMain = class(TForm) implementation uses - Vcl.FileCtrl, - uProtoBufGenerator; + Vcl.FileCtrl, Winapi.ShellAPI, uProtoBufGenerator; + +const + PROTO = '.proto'; {$R *.dfm} @@ -48,45 +58,135 @@ procedure TfmMain.btnChooseOutputFolderClick(Sender: TObject); var Dir: string; begin - Dir := edOutputFolder.Text; - if SelectDirectory('Select output directory', '', Dir, [sdNewFolder, sdShowShares, sdNewUI, sdValidateDir], nil) then - edOutputFolder.Text := Dir; + Dir := edtOutputFolder.Text; + if SelectDirectory('choose output dir', '', Dir, [sdNewFolder, sdShowShares, sdNewUI, sdValidateDir], nil) then + edtOutputFolder.Text := Dir; end; procedure TfmMain.btnGenerateClick(Sender: TObject); var - FileNames: TStrings; + OutPutDir: string; + I : Integer; + Gen: TProtoBufGenerator; begin - FileNames := TStringList.Create; + OutPutDir := edtOutputFolder.Text; + if OutPutDir <> '' then + ForceDirectories(OutPutDir); + + Gen := TProtoBufGenerator.Create; try - FileNames.Delimiter:=odProtoFile.Files.Delimiter; - FileNames.DelimitedText:=edProtoFileName.Text; - Generate(FileNames, edOutputFolder.Text); - ShowMessage('Complete! Take a look into output directory'); + for I := 0 to Pred(FFileCount) do + Gen.Generate(FFiles[I], edtOutputFolder.Text, TEncoding.UTF8); finally - FileNames.Free; + Gen.Free; end; end; procedure TfmMain.btnOpenProtoFileClick(Sender: TObject); +var + I: Integer; begin if odProtoFile.Execute then - edProtoFileName.Text := odProtoFile.Files.DelimitedText; + begin + ClearFiles; + FFileCount := odProtoFile.Files.Count; + SetLength(FFiles, FFileCount); + for I := 0 to Pred(FFileCount) do + begin + FFiles[I] := odProtoFile.Files[I]; + edtProtoFiles.Text := edtProtoFiles.Text + ExtractFileName(FFiles[I]) + ','; + end; + end; +end; + +procedure TfmMain.ClearFiles; +begin + SetLength(FFiles, 0); + FFileCount := 0; + edtProtoFiles.Text := ''; + edtProtoFiles.Font.Color := clGray; + btnGenerate.Enabled := True; +end; + +{ Drop Files Action } +procedure TfmMain.FormCreate(Sender: TObject); +begin + odProtoFile.DefaultFolder := '.\'; + odProtoFile.DefaultExtension := PROTO; + + DragAcceptFiles(Self.Handle, True); +end; + +procedure TfmMain.FormDestroy(Sender: TObject); +begin + DragAcceptFiles(Self.Handle, False); end; -procedure TfmMain.Generate(SourceFiles: TStrings; const OutputDir: string); +procedure TfmMain.WMDropFiles(var Msg: TWMDropFiles); var - Gen: TProtoBufGenerator; - i: Integer; + I, Len : Integer; + Catcher: TFileCatcher; begin - System.SysUtils.ForceDirectories(OutputDir); - Gen := TProtoBufGenerator.Create; + inherited; + ClearFiles; + + Catcher := TFileCatcher.Create(Msg.Drop); try - for i := 0 to SourceFiles.Count - 1 do - Gen.Generate(SourceFiles[i], edOutputFolder.Text, TEncoding.UTF8); + FFileCount := Catcher.FileCount; + SetLength(FFiles, FFileCount); + for I := 0 to Pred(FFileCount) do + begin + FFiles[I] := Catcher.Files[I]; + if SameText(ExtractFileExt(FFiles[I]), PROTO) then + begin + edtProtoFiles.Text := edtProtoFiles.Text + ExtractFileName(FFiles[I]) + ','; + end + else + begin + edtProtoFiles.Font.Color := clRed; + edtProtoFiles.Text := Format('Files Type need %s !!!', [PROTO]); + btnGenerate.Enabled := False; + Exit; + end; + end; + edtProtoFiles.Font.Color := clBlack; finally - Gen.Free; + Catcher.Free; end; + Msg.Result := 0; +end; + +{ TFileCatcher } + +constructor TFileCatcher.Create(DropHandle: HDROP); +begin + inherited Create; + FDropHandle := DropHandle; +end; + +destructor TFileCatcher.Destroy; +begin + DragFinish(FDropHandle); + inherited; +end; + +function TFileCatcher.GetFile(Idx: Integer): string; +var + FileNameLen: Integer; +begin + FileNameLen := DragQueryFile(FDropHandle, Idx, nil, 0); + SetLength(Result, FileNameLen); + DragQueryFile(FDropHandle, Idx, PChar(Result), FileNameLen + 1); +end; + +function TFileCatcher.GetFileCount: Integer; +begin + Result := DragQueryFile(FDropHandle, $FFFFFFFF, nil, 0); +end; + +function TFileCatcher.GetPoint: TPoint; +begin + DragQueryPoint(FDropHandle, Result); end; end. diff --git a/README.md b/README.md index 2f1a4c1..9797c59 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,15 @@ # ProtoBufGenerator - Delphi ProtoBuf files generator +### Update 08.09.2017(jinnblue) rebase from kami-soft/master ++ Add Drap files to generator.exe feature ++ Add extensions check + ### Update 14.01.2017 -Add console generator version ++ Add console generator version ### Update 08.01.2017 -Add example ++ Add example Work with binary ProtoBuf messages based on https://sourceforge.net/projects/protobuf-delphi/files/ by marat1961 (sources have some modifications) @@ -31,15 +34,14 @@ Limitations: - `groups` (deprecated feature) not supported ## How to use -+ add root folder of this project to library path (Tools - Options - Delphi options - Library) -+ open ProtoBufGeneratorGroup.groupproj from root folder of this project -+ compile and run ProtoBufGenerator.exe -+ open .proto file(s) by press "Open" button -+ select directory for new generated .pas file(s) and press "Generate" button -+ add generated file to your project. +1. add root folder of this project to library path (Tools - Options - Delphi options - Library) +2. open ProtoBufGeneratorGroup.groupproj from root folder of this project +3. compile and run ProtoBufGenerator.exe +4. open .proto file(s) by press "Open" button +5. select directory for new generated .pas file(s) and press "Generate" button +6. add generated file to your project. Do not use `LoadFromBuf`/`SaveToBuf` methods in generated classes! Use `LoadFromStream` and `SaveToStream` methods, which inherited from base class. See `Example2`, how to use generated classes. ## ToDo: -- add `extensions` (simple ignore directive, or - wrap to comment) -- add tests with "original" ProtoBuf generated binary messages. \ No newline at end of file +- add tests with "original" ProtoBuf generated binary messages. diff --git a/example1_without_Generator/Example1.pas b/example1_without_Generator/Example1.pas index 1746d67..6b5a4de 100644 --- a/example1_without_Generator/Example1.pas +++ b/example1_without_Generator/Example1.pas @@ -12,7 +12,8 @@ interface -uses Classes, SysUtils, Contnrs, pbPublic, pbInput, pbOutput; +uses + Classes, SysUtils, Contnrs, pbPublic, pbInput, pbOutput; (* @@ -40,45 +41,47 @@ interface type - TPhoneType = (ptMOBILE, ptHOME, ptWORK); - - TPhoneNumber = class - private - FTyp: TPhoneType; - FNumber: AnsiString; - const - ft_Number = 1; - ft_Typ = 2; - public - constructor Create; - property Number: AnsiString read FNumber write FNumber; - property Typ: TPhoneType read FTyp write FTyp; - end; + TPhoneType = (ptMOBILE, ptHOME, ptWORK); - TPerson = class - private - FName: AnsiString; - FEmail: AnsiString; - FId: integer; - FPhones: TObjectList; - function GetPhones(Index: integer): TPhoneNumber; - function GetPhonesCount: integer; - const - ft_Name = 1; - ft_Id = 2; - ft_Email = 3; - ft_Phone = 4; - public - constructor Create; - destructor Destroy; override; - procedure AddPhone(const Number: AnsiString; Typ: TPhoneType = ptHOME); - procedure DeletePhone(Index: integer); - property Name: AnsiString read FName write FName; - property Id: integer read FId write FId; - property Email: AnsiString read FEmail write FEmail; - property PhonesCount: integer read GetPhonesCount; - property Phones[Index: integer]: TPhoneNumber read GetPhones; - end; + TPhoneNumber = class + private + FTyp : TPhoneType; + FNumber: AnsiString; + + const + ft_Number = 1; + ft_Typ = 2; + public + constructor Create; + property Number: AnsiString read FNumber write FNumber; + property Typ: TPhoneType read FTyp write FTyp; + end; + + TPerson = class + private + FName : AnsiString; + FEmail : AnsiString; + FId : integer; + FPhones: TObjectList; + function GetPhones(Index: integer): TPhoneNumber; + function GetPhonesCount: integer; + + const + ft_Name = 1; + ft_Id = 2; + ft_Email = 3; + ft_Phone = 4; + public + constructor Create; + destructor Destroy; override; + procedure AddPhone(const Number: AnsiString; Typ: TPhoneType = ptHOME); + procedure DeletePhone(Index: integer); + property name: AnsiString read FName write FName; + property Id: integer read FId write FId; + property Email: AnsiString read FEmail write FEmail; + property PhonesCount: integer read GetPhonesCount; + property Phones[index: integer]: TPhoneNumber read GetPhones; + end; TPersonBuilder = class private @@ -98,7 +101,7 @@ TPersonReader = class constructor Create; destructor Destroy; override; function GetBuf: TProtoBufInput; - procedure Load(person: TPerson); + procedure Load(Person: TPerson); end; implementation @@ -130,9 +133,9 @@ function TPerson.GetPhonesCount: integer; Result := FPhones.Count; end; -function TPerson.GetPhones(Index: Integer): TPhoneNumber; +function TPerson.GetPhones(Index: integer): TPhoneNumber; begin - Result := FPhones.Items[Index] as TPhoneNumber; + Result := FPhones.Items[index] as TPhoneNumber; end; procedure TPerson.AddPhone(const Number: AnsiString; Typ: TPhoneType = ptHOME); @@ -147,7 +150,7 @@ procedure TPerson.AddPhone(const Number: AnsiString; Typ: TPhoneType = ptHOME); procedure TPerson.DeletePhone(Index: integer); begin - FPhones.Delete(Index); + FPhones.Delete(index); end; { TPersonBuilder } @@ -171,9 +174,9 @@ function TPersonBuilder.GetBuf: TProtoBufOutput; procedure TPersonBuilder.Write(Person: TPerson); var - Phone: TPhoneNumber; + Phone : TPhoneNumber; PhonesBuffer: TProtoBufOutput; - i: Integer; + i : integer; begin FBuffer.writeString(TPerson.ft_Name, Person.Name); FBuffer.writeInt32(TPerson.ft_Id, Person.FId); @@ -222,30 +225,31 @@ function TPersonReader.GetBuf: TProtoBufInput; Result := FBuffer; end; -procedure TPersonReader.Load(person: TPerson); +procedure TPersonReader.Load(Person: TPerson); var tag, fieldNumber, wireType: integer; - Phone: TPhoneNumber; + Phone : TPhoneNumber; begin tag := FBuffer.readTag; - while tag <> 0 do begin + while tag <> 0 do + begin wireType := getTagWireType(tag); fieldNumber := getTagFieldNumber(tag); case fieldNumber of TPerson.ft_Name: begin Assert(wireType = WIRETYPE_LENGTH_DELIMITED); - person.Name := FBuffer.readString; + Person.Name := FBuffer.readString; end; TPerson.ft_Id: begin Assert(wireType = WIRETYPE_VARINT); - person.Id := FBuffer.readInt32; + Person.Id := FBuffer.readInt32; end; TPerson.ft_Email: begin Assert(wireType = WIRETYPE_LENGTH_DELIMITED); - person.Email := FBuffer.readString; + Person.Email := FBuffer.readString; end; TPerson.ft_Phone: begin @@ -254,8 +258,8 @@ procedure TPersonReader.Load(person: TPerson); Person.FPhones.Add(Phone); LoadPhone(Phone); end; - else - FBuffer.skipField(tag); + else + FBuffer.skipField(tag); end; tag := FBuffer.readTag; end; @@ -264,14 +268,15 @@ procedure TPersonReader.Load(person: TPerson); procedure TPersonReader.LoadPhone(Phone: TPhoneNumber); var tag, fieldNumber, wireType: integer; - size: Integer; - endPosition: Integer; + size : integer; + endPosition : integer; begin size := FBuffer.readInt32; endPosition := FBuffer.getPos + size; repeat tag := FBuffer.readTag; - if tag = 0 then exit; + if tag = 0 then + exit; wireType := getTagWireType(tag); fieldNumber := getTagFieldNumber(tag); case fieldNumber of @@ -285,11 +290,10 @@ procedure TPersonReader.LoadPhone(Phone: TPhoneNumber); Assert(wireType = WIRETYPE_VARINT); Phone.Typ := TPhoneType(FBuffer.readInt32); end; - else - FBuffer.skipField(tag); + else + FBuffer.skipField(tag); end; until FBuffer.getPos >= endPosition; end; end. - diff --git a/example1_without_Generator/Project1.dpr b/example1_without_Generator/Project1.dpr index 3dde0db..a4db0d7 100644 --- a/example1_without_Generator/Project1.dpr +++ b/example1_without_Generator/Project1.dpr @@ -5,7 +5,6 @@ program Project1; uses SysUtils, TypInfo, Example1 in 'Example1.pas', - UnitTest in '..\UnitTest.pas', pbInput in '..\pbInput.pas', pbOutput in '..\pbOutput.pas', pbPublic in '..\pbPublic.pas', @@ -78,7 +77,6 @@ end; begin Writeln('Run Protocol Buffer Tests'); - TestAll; TestPerson; end. diff --git a/example1_without_Generator/Project1.dproj b/example1_without_Generator/Project1.dproj index a34de9f..a0d4945 100644 --- a/example1_without_Generator/Project1.dproj +++ b/example1_without_Generator/Project1.dproj @@ -1,7 +1,7 @@  {F5064338-5047-4F36-AF30-AB3E1CD5D3B9} - 14.3 + 18.2 VCL Project1.dpr True @@ -40,6 +40,7 @@ true + Project1 System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) $(BDS)\bin\delphi_PROJECTICON.ico .\$(Platform)\$(Config) @@ -51,14 +52,19 @@ false + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + true fs17;frx17;bindcompfmx;DBXSqliteDriver;vcldbx;fmx;rtl;dbrtl;DbxClientDriver;IndySystem;TeeDB;bindcomp;inetdb;vclib;inetdbbde;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DBXOdbcDriver;DataSnapServer;Tee;DataSnapProviderClient;xmlrtl;svnui;ibxpress;DbxCommonDriver;DBXSybaseASEDriver;vclimg;IndyProtocols;dbxcds;DBXMySQLDriver;MetropolisUILiveTile;vclactnband;bindengine;vcldb;soaprtl;bindcompdbx;vcldsnap;bindcompvcl;FMXTee;TeeUI;vclie;vcltouch;DBXDb2Driver;websnap;DBXOracleDriver;CustomIPTransport;vclribbon;VclSmp;dsnap;IndyIPServer;DBXInformixDriver;Intraweb;fmxase;vcl;IndyCore;DataSnapConnectors;IndyIPCommon;CloudService;DBXMSSQLDriver;dsnapcon;DBXFirebirdDriver;FmxTeeUI;inet;fsDB17;fmxobj;frxDB17;CodeSiteExpressPkg;vclx;frxe17;inetdbxpress;webdsnap;svn;DBXSybaseASADriver;fmxdae;bdertl;dbexpress;adortl;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) $(BDS)\bin\default_app.manifest Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 1033 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(ModuleName);FileDescription=$(ModuleName);ProductName=$(ModuleName) true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png bindcompfmx;DBXSqliteDriver;fmx;rtl;dbrtl;DbxClientDriver;IndySystem;TeeDB;bindcomp;inetdb;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DBXOdbcDriver;DataSnapServer;Tee;DataSnapProviderClient;xmlrtl;ibxpress;DbxCommonDriver;DBXSybaseASEDriver;vclimg;IndyProtocols;dbxcds;DBXMySQLDriver;vclactnband;bindengine;vcldb;soaprtl;bindcompdbx;vcldsnap;bindcompvcl;TeeUI;vclie;vcltouch;DBXDb2Driver;websnap;DBXOracleDriver;CustomIPTransport;VclSmp;dsnap;IndyIPServer;DBXInformixDriver;fmxase;vcl;IndyCore;DataSnapConnectors;IndyIPCommon;DBXMSSQLDriver;dsnapcon;DBXFirebirdDriver;inet;fmxobj;vclx;inetdbxpress;webdsnap;DBXSybaseASADriver;fmxdae;dbexpress;adortl;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) @@ -70,20 +76,20 @@ true + Debug false false RELEASE;$(DCC_Define) 0 - false + 0 MainSource - @@ -144,7 +150,423 @@ Project1.dpr - + + + + 0 + .dll;.bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + Contents\Resources + 1 + + + + + classes + 1 + + + + + Contents\MacOS + 0 + + + 1 + + + Contents\MacOS + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + library\lib\mips + 1 + + + + + 1 + + + 1 + + + 0 + + + 1 + + + Contents\MacOS + 1 + + + library\lib\armeabi-v7a + 1 + + + 1 + + + + + 0 + + + Contents\MacOS + 1 + .framework + + + + + 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 + + + + + library\lib\armeabi + 1 + + + + + 0 + + + 1 + + + Contents\MacOS + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-large + 1 + + + + + 1 + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + res\drawable-hdpi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + Contents + 1 + + + + + ..\ + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\values + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + res\drawable + 1 + + + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + 0 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 0 + .bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-xlarge + 1 + + + + + res\drawable-ldpi + 1 + + + + + 1 + + + 1 + + + + + + + + + + + True False @@ -157,4 +579,5 @@ + diff --git a/example1_without_Generator/Test/Project1Tests.dproj b/example1_without_Generator/Test/Project1Tests.dproj index 4d473e1..934ff7e 100644 --- a/example1_without_Generator/Test/Project1Tests.dproj +++ b/example1_without_Generator/Test/Project1Tests.dproj @@ -1,7 +1,7 @@  {CB7BD6AB-72F4-47AA-99DB-B48A0B7D746C} - 14.3 + 18.2 None True Debug @@ -13,8 +13,23 @@ true - - true + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true Base true @@ -45,6 +60,9 @@ true + $(BDS)\bin\delphi_PROJECTICNS.icns + Project1Tests + $(BDS)\bin\delphi_PROJECTICON.ico _CONSOLE_TESTRUNNER;$(DCC_Define) $(BDS)\Source\DUnit\src;$(DCC_UnitSearchPath) System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) @@ -56,14 +74,74 @@ false false - - bindcompfmx;DBXSqliteDriver;fmx;rtl;dbrtl;DbxClientDriver;IndySystem;bindcomp;inetdb;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DataSnapProviderClient;xmlrtl;DbxCommonDriver;IndyProtocols;dbxcds;DBXMySQLDriver;bindengine;soaprtl;bindcompdbx;DBXOracleDriver;CustomIPTransport;dsnap;IndyIPServer;DBXInformixDriver;fmxase;IndyCore;IndyIPCommon;DBXFirebirdDriver;inet;fmxobj;inetdbxpress;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) + + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + true + true + true + true + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + true + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + true + + + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.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_ApplicationIcon_76x76.png + + + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.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_ApplicationIcon_76x76.png + + + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.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_ApplicationIcon_76x76.png Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 1033 fs17;frx17;bindcompfmx;DBXSqliteDriver;vcldbx;fmx;rtl;dbrtl;DbxClientDriver;IndySystem;TeeDB;bindcomp;inetdb;vclib;inetdbbde;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DBXOdbcDriver;DataSnapServer;Tee;DataSnapProviderClient;xmlrtl;svnui;ibxpress;DbxCommonDriver;DBXSybaseASEDriver;vclimg;IndyProtocols;dbxcds;DBXMySQLDriver;MetropolisUILiveTile;vclactnband;bindengine;vcldb;soaprtl;bindcompdbx;vcldsnap;bindcompvcl;FMXTee;TeeUI;vclie;vcltouch;DBXDb2Driver;websnap;DBXOracleDriver;CustomIPTransport;vclribbon;VclSmp;dsnap;IndyIPServer;DBXInformixDriver;Intraweb;fmxase;vcl;IndyCore;DataSnapConnectors;IndyIPCommon;CloudService;DBXMSSQLDriver;dsnapcon;DBXFirebirdDriver;FmxTeeUI;inet;fsDB17;fmxobj;frxDB17;CodeSiteExpressPkg;vclx;frxe17;inetdbxpress;webdsnap;svn;DBXSybaseASADriver;fmxdae;bdertl;dbexpress;adortl;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(ModuleName);FileDescription=$(ModuleName);ProductName=$(ModuleName) bindcompfmx;DBXSqliteDriver;fmx;rtl;dbrtl;DbxClientDriver;IndySystem;bindcomp;inetdb;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DBXOdbcDriver;DataSnapServer;DataSnapProviderClient;xmlrtl;DbxCommonDriver;DBXSybaseASEDriver;vclimg;IndyProtocols;dbxcds;DBXMySQLDriver;vclactnband;bindengine;vcldb;soaprtl;bindcompdbx;vcldsnap;bindcompvcl;vclie;vcltouch;DBXDb2Driver;websnap;DBXOracleDriver;CustomIPTransport;VclSmp;dsnap;IndyIPServer;DBXInformixDriver;fmxase;vcl;IndyCore;IndyIPCommon;DBXMSSQLDriver;dsnapcon;DBXFirebirdDriver;inet;fmxobj;vclx;inetdbxpress;webdsnap;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) @@ -83,7 +161,7 @@ false RELEASE;$(DCC_Define) 0 - false + 0 @@ -151,8 +229,390 @@ Project1Tests.dpr - + + + + true + + + + + true + + + + + true + + + + + true + + + + + 0 + .dll;.bpl + + + 1 + .dylib + + + + + Contents\Resources + 1 + + + + + classes + 1 + + + + + Contents\MacOS + 0 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + library\lib\mips + 1 + + + + + 1 + + + 1 + + + 0 + + + 1 + + + 1 + + + library\lib\armeabi-v7a + 1 + + + 1 + + + + + 0 + + + 1 + .framework + + + + + 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 + + + + + + library\lib\armeabi + 1 + + + + + 0 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-large + 1 + + + + + 1 + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + res\drawable-hdpi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + + + Assets + 1 + + + Assets + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\values + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + res\drawable + 1 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 0 + .bpl + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-xlarge + 1 + + + + + res\drawable-ldpi + 1 + + + + + + + + + + + + + False + False + False + False False True False @@ -161,10 +621,12 @@ DUnit / Delphi Win32 GUI D:\work\protobuf delphi\protobuf-delphi\example1\Project1.dproj + 12 + diff --git a/example2_with_Generator/ProjectExample2.dproj b/example2_with_Generator/ProjectExample2.dproj index aba4bda..4d78227 100644 --- a/example2_with_Generator/ProjectExample2.dproj +++ b/example2_with_Generator/ProjectExample2.dproj @@ -1,7 +1,7 @@  {C4E7CF2C-F7EA-44F7-A60A-3B87C1E6EA33} - 18.1 + 18.2 VCL ProjectExample2.dpr True @@ -61,14 +61,18 @@ false + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png $(BDS)\bin\default_app.manifest 1033 true DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;svnui;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;svn;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FixInsight_10;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;madExcept_;VirtualTreesR;FireDACMSAccDriver;FireDACInfxDriver;fmxFireDAC;vclimg;madBasic_;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;DataSnapNativeClient;ibxbindings;fmxobj;FireDACDSDriver;soapmidas;rtl;vclwinx;DbxClientDriver;madDisAsm_;DBXSybaseASADriver;CustomIPTransport;vcldsnap;CodeSiteExpressPkg;bindcomp;appanalytics;fgx;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;inetdbxpress;fmxase;$(DCC_UsePackage) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(ModuleName);FileDescription=$(ModuleName);ProductName=$(ModuleName) Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;VirtualTreesR;FireDACMSAccDriver;FireDACInfxDriver;fmxFireDAC;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;DataSnapNativeClient;ibxbindings;fmxobj;FireDACDSDriver;soapmidas;rtl;vclwinx;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;inetdbxpress;fmxase;$(DCC_UsePackage) @@ -80,6 +84,8 @@ true + CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(ModuleName);FileDescription=$(ModuleName);ProductName=$(ModuleName) + Debug true true true @@ -129,34 +135,19 @@ Microsoft Office XP Sample Automation Server Wrapper Components - + ProjectExample2.exe true - - - 0 - .dll;.bpl - + 1 - .dylib - - - Contents\MacOS - 1 - .dylib 1 - .dylib - - - 1 - .dylib @@ -208,19 +199,22 @@ + + 1 + + + 1 + 0 - + 1 Contents\MacOS 1 - - 1 - library\lib\armeabi-v7a 1 @@ -239,6 +233,14 @@ .framework + + + 1 + + + 1 + + 1 @@ -271,12 +273,7 @@ 1 - - - library\lib\x86 - 1 - - + 1 @@ -357,13 +354,23 @@ 1 + + + Assets + 1 + + + Assets + 1 + + - ../ + ..\ 1 - ../ + ..\ 1 @@ -387,7 +394,17 @@ - ../ + ..\ + 1 + + + + + Assets + 1 + + + Assets 1 @@ -510,18 +527,34 @@ 1 - + + + 0 + .dll;.bpl + 1 + .dylib + + + Contents\MacOS + 1 + .dylib 1 + .dylib + + + 1 + .dylib + diff --git a/example2_with_Generator/test1.pas b/example2_with_Generator/test1.pas index 1568e77..66b3910 100644 --- a/example2_with_Generator/test1.pas +++ b/example2_with_Generator/test1.pas @@ -40,7 +40,6 @@ TTestMsg0 = class(TAbstractProtoBufClass) constructor Create; override; destructor Destroy; override; - property Field1:integer read FField1 write FField1; property Field2:Int64 read FField2 write FField2; end; @@ -52,7 +51,6 @@ TTestNested1 = class(TAbstractProtoBufClass) function LoadSingleFieldFromBuf(ProtoBuf: TProtoBufInput; FieldNumber: integer; WireType: integer): Boolean; override; procedure SaveFieldsToBuf(ProtoBuf: TProtoBufOutput); override; public - property Field1:integer read FField1 write FField1; end; @@ -86,7 +84,6 @@ TTestMsg1 = class(TAbstractProtoBufClass) constructor Create; override; destructor Destroy; override; - property DefField1:integer read FDefField1 write FDefField1 default 2; property DefField2:Int64 read FDefField2 write FDefField2 default -1; property DefField3:string read FDefField3 write FDefField3; // default 'yes'; @@ -124,7 +121,6 @@ TTestMsg1Extension1 = class(TTestMsg1) function LoadSingleFieldFromBuf(ProtoBuf: TProtoBufInput; FieldNumber: integer; WireType: integer): Boolean; override; procedure SaveFieldsToBuf(ProtoBuf: TProtoBufOutput); override; public - property field_name_test_1:integer read Ffield_name_test_1 write Ffield_name_test_1; property field_Name_test_2:integer read Ffield_Name_test_2 write Ffield_Name_test_2; end; @@ -152,7 +148,7 @@ function TTestMsg0.LoadSingleFieldFromBuf(ProtoBuf: TProtoBufInput; FieldNumber: Result := inherited LoadSingleFieldFromBuf(ProtoBuf, FieldNumber, WireType); if Result then exit; - case fieldNumber of + case FieldNumber of 1: begin FField1 := ProtoBuf.readInt32; @@ -181,7 +177,7 @@ function TTestNested1.LoadSingleFieldFromBuf(ProtoBuf: TProtoBufInput; FieldNumb Result := inherited LoadSingleFieldFromBuf(ProtoBuf, FieldNumber, WireType); if Result then exit; - case fieldNumber of + case FieldNumber of 1: begin FField1 := ProtoBuf.readInt32; @@ -238,7 +234,7 @@ function TTestMsg1.LoadSingleFieldFromBuf(ProtoBuf: TProtoBufInput; FieldNumber: Result := inherited LoadSingleFieldFromBuf(ProtoBuf, FieldNumber, WireType); if Result then exit; - case fieldNumber of + case FieldNumber of 1: begin FDefField1 := ProtoBuf.readInt32; @@ -352,7 +348,7 @@ function TTestMsg1.LoadSingleFieldFromBuf(ProtoBuf: TProtoBufInput; FieldNumber: end; 44: begin - FFieldMArr2List.AddFromBuf(ProtoBuf, fieldNumber); + FFieldMArr2List.AddFromBuf(ProtoBuf, makeTag(FieldNumber, WireType)); Result := True; end; 50: @@ -425,7 +421,7 @@ function TTestMsg1Extension1.LoadSingleFieldFromBuf(ProtoBuf: TProtoBufInput; Fi Result := inherited LoadSingleFieldFromBuf(ProtoBuf, FieldNumber, WireType); if Result then exit; - case fieldNumber of + case FieldNumber of 187: begin Ffield_name_test_1 := ProtoBuf.readInt32; diff --git a/example2_with_Generator/ufmMain.dfm b/example2_with_Generator/ufmMain.dfm index 40da586..21c3b25 100644 --- a/example2_with_Generator/ufmMain.dfm +++ b/example2_with_Generator/ufmMain.dfm @@ -1,7 +1,7 @@ object Form15: TForm15 Left = 0 Top = 0 - Caption = 'Form15' + Caption = 'Example2' ClientHeight = 250 ClientWidth = 430 Color = clBtnFace @@ -18,18 +18,19 @@ object Form15: TForm15 Left = 16 Top = 8 Width = 395 - Height = 130 + Height = 143 Caption = - 'First, compile and run ProtoBufGenerator.exe'#13#10'Choose TestImport1' + - '.proto file and output folder - "example2_with_Generator"'#13#10'Press' + - ' Generate button.'#13#10'Choose Test1.proto file'#13#10'Press Generate butto' + - 'n'#13#10'Now you get 2 new files in this project directory - TestImpor' + - 't1.pas and Test1.pas.'#13#10#13#10'Or - you can use for test pre-loaded fi' + - 'les.'#13#10#13#10'See in OnClick event handlers how to use generated files' + '1. Compile and run ProtoBufGenerator.exe'#13#10#13#10'2. Choose/Drag TestI' + + 'mport1.proto & Test1.proto file to ProtoBufGenerator.exe'#13#10' Se' + + 't output folder - "example2_with_Generator"'#13#10#13#10'3. Press Generate' + + ' button.'#13#10#13#10'Now you get 2 new files in this project directory - ' + + 'TestImport1.pas and Test1.pas.'#13#10'Or - you can use for test pre-lo' + + 'aded files.'#13#10#13#10'See in OnClick event handlers how to use generate' + + 'd files' end object btnSaveToPtotoBuf: TButton Left = 72 - Top = 160 + Top = 169 Width = 121 Height = 25 Caption = 'SaveToPtotoBuf' @@ -37,8 +38,8 @@ object Form15: TForm15 OnClick = btnSaveToPtotoBufClick end object btnLoadFromProtoBuf: TButton - Left = 216 - Top = 160 + Left = 224 + Top = 169 Width = 121 Height = 25 Caption = 'LoadFromProtoBuf'