Skip to content

Commit 5a7daaa

Browse files
committed
Fixed a bug of Delphi 10.2.3
1 parent 94b0d9e commit 5a7daaa

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Source/HproseIO.pas

+16-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* *
1515
* hprose io unit for delphi. *
1616
* *
17-
* LastModified: Dec 1, 2016 *
17+
* LastModified: Apr 30, 2018 *
1818
* Author: Ma Bingyao <[email protected]> *
1919
* *
2020
\**********************************************************/
@@ -309,6 +309,7 @@ THproseWriter = class
309309
procedure WriteMapWithRef(const AMap: IMap);
310310
{$IFDEF SUPPORTS_GENERICS}
311311
procedure Serialize<T>(const Value: T); overload;
312+
procedure WriteArray(const DynArray: TVariants); overload;
312313
procedure WriteArray<T>(const DynArray: array of T); overload;
313314
procedure WriteDynArray<T>(const DynArray: TArray<T>);
314315
procedure WriteDynArrayWithRef<T>(const DynArray: TArray<T>); overload;
@@ -4291,6 +4292,20 @@ procedure THproseWriter.Serialize<T>(const Value: T);
42914292
Serialize(Value, TypeInfo(T));
42924293
end;
42934294

4295+
procedure THproseWriter.WriteArray(const DynArray: TVariants);
4296+
var
4297+
Count, I: Integer;
4298+
begin
4299+
FRefer.SetRef(Null);
4300+
Count := Length(DynArray);
4301+
FStream.WriteBuffer(HproseTagList, 1);
4302+
if Count > 0 then WriteRawBytes(BytesOf(IntToStr(Count)));
4303+
FStream.WriteBuffer(HproseTagOpenbrace, 1);
4304+
for I := 0 to Count - 1 do Serialize(DynArray[I]);
4305+
FStream.WriteBuffer(HproseTagClosebrace, 1);
4306+
end;
4307+
4308+
42944309
procedure THproseWriter.WriteArray<T>(const DynArray: array of T);
42954310
var
42964311
Count, I: Integer;

0 commit comments

Comments
 (0)