Skip to content

Commit

Permalink
Added Delphi 10.3 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Dec 11, 2018
1 parent a7367c2 commit 940dcb1
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 102 deletions.
26 changes: 13 additions & 13 deletions Delphinus.Info.json
Original file line number Diff line number Diff line change
@@ -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"
}
72 changes: 36 additions & 36 deletions Delphinus.Install.json
Original file line number Diff line number Diff line change
@@ -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
}]
}
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<p align="center"><img src="http://hprose.com/banner.@2x.png" alt="Hprose" title="Hprose" width="650" height="200" /></p>

# 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)
<p align="center"><img src="http://hprose.com/banner.@2x.png" alt="Hprose" title="Hprose" width="650" height="200" /></p>

# 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)
9 changes: 9 additions & 0 deletions Source/Hprose.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
31 changes: 15 additions & 16 deletions Source/HproseIO.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* *
* hprose io unit for delphi. *
* *
* LastModified: Apr 30, 2018 *
* LastModified: Dec 11, 2018 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
Expand Down Expand Up @@ -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<T>(const Value: T); overload;
procedure WriteArray(const DynArray: TVariants); overload;
procedure WriteArray<T>(const DynArray: array of T); overload;
procedure WriteDynArray<T>(const DynArray: TArray<T>);
procedure WriteDynArrayWithRef<T>(const DynArray: TArray<T>); overload;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -4292,20 +4305,6 @@ procedure THproseWriter.Serialize<T>(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<T>(const DynArray: array of T);
var
Count, I: Integer;
Expand Down

0 comments on commit 940dcb1

Please sign in to comment.