diff --git a/Delphinus.Info.json b/Delphinus.Info.json index eab8f85..023493a 100644 --- a/Delphinus.Info.json +++ b/Delphinus.Info.json @@ -1,14 +1,14 @@ -{ - "id": "{0AE3CEFD-7687-4190-92F7-7940BED824C0}", - "name": "Hprose", - "picture": "Logo.png", - "license_type": "MIT", - "license_file": "LICENSE.md", - "platforms": "Win32;Win64;OSX32;Android;IOSDevice32;IOSDevice64;Linux64", - "package_compiler_min": 14, - "package_compiler_max": 32, - "compiler_min": 14, - "compiler_max": 32, - "first_version": "2.0.1", - "version": "2.0.1" +{ + "id": "{0AE3CEFD-7687-4190-92F7-7940BED824C0}", + "name": "Hprose", + "picture": "Logo.png", + "license_type": "MIT", + "license_file": "LICENSE.md", + "platforms": "Win32;Win64;OSX32;Android;IOSDevice32;IOSDevice64;Linux64", + "package_compiler_min": 14, + "package_compiler_max": 32, + "compiler_min": 14, + "compiler_max": 32, + "first_version": "2.0.1", + "version": "2.0.2" } \ No newline at end of file diff --git a/Delphinus.Install.json b/Delphinus.Install.json index a7cb048..ddcdb38 100644 --- a/Delphinus.Install.json +++ b/Delphinus.Install.json @@ -1,37 +1,37 @@ -{ - "search_pathes": [{ - "pathes": "Source", - "platforms": "Win32;Win64;OSX32;Android;IOSDevice32;IOSDevice64;Linux64" - }], - "browsing_pathes": [{ - "pathes": "Source", - "platforms": "Win32;Win64;OSX32;Android;IOSDevice32;IOSDevice64;Linux64" - }], - "source_folders": [{ - "folder": "." - }, - { - "folder": "CppBuilder", - "recursive": true - }, - { - "folder": "Icons", - "recursive": true - }, - { - "folder": "Lazarus", - "recursive": true - }, - { - "folder": "Packages", - "recursive": true - }, - { - "folder": "Source", - "recursive": true - }, - { - "folder": "Test", - "recursive": true - }] +{ + "search_pathes": [{ + "pathes": "Source", + "platforms": "Win32;Win64;OSX32;Android;IOSDevice32;IOSDevice64;Linux64" + }], + "browsing_pathes": [{ + "pathes": "Source", + "platforms": "Win32;Win64;OSX32;Android;IOSDevice32;IOSDevice64;Linux64" + }], + "source_folders": [{ + "folder": "." + }, + { + "folder": "CppBuilder", + "recursive": true + }, + { + "folder": "Icons", + "recursive": true + }, + { + "folder": "Lazarus", + "recursive": true + }, + { + "folder": "Packages", + "recursive": true + }, + { + "folder": "Source", + "recursive": true + }, + { + "folder": "Test", + "recursive": true + }] } \ No newline at end of file diff --git a/README.md b/README.md index 7a3e72e..0c7a911 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,37 @@ -

Hprose

- -# Hprose for Delphi/Lazarus - -[![Join the chat at https://gitter.im/hprose/hprose-delphi](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hprose/hprose-delphi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Supported Delphi versions: delphi6-delphi10.1](https://img.shields.io/badge/delphi-6~10.2-blue.svg) ![Supported FreePascal versions: freepascal2-freepascal3](https://img.shields.io/badge/freepascal-2~3-blue.svg)](https://github.com/hprose/hprose-delphi) [![GitHub release](https://img.shields.io/github/release/hprose/hprose-delphi.svg)](https://github.com/hprose/hprose-delphi/releases) - -*Hprose* is a High Performance Remote Object Service Engine. - -It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system. - -*Hprose* supports many programming languages, for example: - -* AAuto Quicker -* ActionScript -* ASP -* C++ -* Dart -* Delphi/Lazarus -* dotNET(C#, Visual Basic...) -* Golang -* Java -* JavaScript -* Node.js -* Objective-C -* Perl -* PHP -* Python -* Ruby -* ... - -Through *Hprose*, You can conveniently and efficiently intercommunicate between those programming languages. - -This project is the implementation of Hprose for Delphi/Lazarus. - -## Miscellaneous -You can install [Delphinus package manager](https://github.com/Memnarch/Delphinus/wiki/Installing-Delphinus) and install Hprose as a package there. (Delphinus-Support) +

Hprose

+ +# Hprose for Delphi/Lazarus + +[![Join the chat at https://gitter.im/hprose/hprose-delphi](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hprose/hprose-delphi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Supported Delphi versions: delphi6-delphi10.3](https://img.shields.io/badge/delphi-6~10.3-blue.svg) ![Supported FreePascal versions: freepascal2-freepascal3](https://img.shields.io/badge/freepascal-2~3-blue.svg)](https://github.com/hprose/hprose-delphi) [![GitHub release](https://img.shields.io/github/release/hprose/hprose-delphi.svg)](https://github.com/hprose/hprose-delphi/releases) + +*Hprose* is a High Performance Remote Object Service Engine. + +It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system. + +*Hprose* supports many programming languages, for example: + +* AAuto Quicker +* ActionScript +* ASP +* C++ +* Dart +* Delphi/Lazarus +* dotNET(C#, Visual Basic...) +* Golang +* Java +* JavaScript +* Node.js +* Objective-C +* Perl +* PHP +* Python +* Ruby +* ... + +Through *Hprose*, You can conveniently and efficiently intercommunicate between those programming languages. + +This project is the implementation of Hprose for Delphi/Lazarus. + +## Miscellaneous +You can install [Delphinus package manager](https://github.com/Memnarch/Delphinus/wiki/Installing-Delphinus) and install Hprose as a package there. (Delphinus-Support) diff --git a/Source/Hprose.inc b/Source/Hprose.inc index cf49275..99550a4 100644 --- a/Source/Hprose.inc +++ b/Source/Hprose.inc @@ -95,6 +95,15 @@ {$DEFINE DELPHI10_2_UP} {$ENDIF} +{$IFDEF VER330} + {$DEFINE DELPHI10_3} + {$DEFINE DELPHI10_3_UP} +{$ENDIF} + +{$IFDEF DELPHI10_3_UP} + {$DEFINE DELPHI10_2_UP} +{$ENDIF} + {$IFDEF DELPHI10_2_UP} {$DEFINE DELPHI10_1_UP} {$ENDIF} diff --git a/Source/HproseIO.pas b/Source/HproseIO.pas index d1bc6e0..ed12a03 100644 --- a/Source/HproseIO.pas +++ b/Source/HproseIO.pas @@ -14,7 +14,7 @@ * * * hprose io unit for delphi. * * * - * LastModified: Apr 30, 2018 * + * LastModified: Dec 11, 2018 * * Author: Ma Bingyao * * * \**********************************************************/ @@ -303,13 +303,13 @@ THproseWriter = class procedure WriteArray(const Value: Variant); overload; procedure WriteArrayWithRef(const Value: Variant); overload; procedure WriteArray(const Value: array of const); overload; + procedure WriteArray(const Value: TVariants); overload; procedure WriteList(const AList: IList); overload; procedure WriteListWithRef(const AList: IList); overload; procedure WriteMap(const AMap: IMap); overload; procedure WriteMapWithRef(const AMap: IMap); {$IFDEF SUPPORTS_GENERICS} procedure Serialize(const Value: T); overload; - procedure WriteArray(const DynArray: TVariants); overload; procedure WriteArray(const DynArray: array of T); overload; procedure WriteDynArray(const DynArray: TArray); procedure WriteDynArrayWithRef(const DynArray: TArray); overload; @@ -2946,6 +2946,19 @@ procedure THproseWriter.WriteRawBytes(const Bytes: TBytes); FStream.WriteBuffer(Bytes[0], Length(Bytes)); end; +procedure THproseWriter.WriteArray(const Value: TVariants); +var + Count, I: Integer; +begin + FRefer.SetRef(Null); + Count := Length(Value); + FStream.WriteBuffer(HproseTagList, 1); + if Count > 0 then WriteRawBytes(BytesOf(IntToStr(Count))); + FStream.WriteBuffer(HproseTagOpenbrace, 1); + for I := 0 to Count - 1 do Serialize(Value[I]); + FStream.WriteBuffer(HproseTagClosebrace, 1); +end; + procedure THproseWriter.WriteArray(const Value: array of const); var I, N: Integer; @@ -4292,20 +4305,6 @@ procedure THproseWriter.Serialize(const Value: T); Serialize(Value, TypeInfo(T)); end; -procedure THproseWriter.WriteArray(const DynArray: TVariants); -var - Count, I: Integer; -begin - FRefer.SetRef(Null); - Count := Length(DynArray); - FStream.WriteBuffer(HproseTagList, 1); - if Count > 0 then WriteRawBytes(BytesOf(IntToStr(Count))); - FStream.WriteBuffer(HproseTagOpenbrace, 1); - for I := 0 to Count - 1 do Serialize(DynArray[I]); - FStream.WriteBuffer(HproseTagClosebrace, 1); -end; - - procedure THproseWriter.WriteArray(const DynArray: array of T); var Count, I: Integer;