* TValue.From with buffer and typeinfo. Patch from Lipinast Lekrisov

This commit is contained in:
Michaël Van Canneyt 2024-12-17 17:44:57 +01:00
parent 69140d22eb
commit 98a7fe6204

View File

@ -208,6 +208,7 @@ type
{ Note: a TValue based on an open array is only valid until the routine having the open array parameter is left! }
generic class function FromOpenArray<T>(constref aValue: array of T): TValue; static; inline;
{$endif}
class function From(aTypeInfo: PTypeInfo; ABuffer: Pointer): TValue; static;
class function FromOrdinal(aTypeInfo: PTypeInfo; aValue: Int64): TValue; static; {inline;}
class function FromArray(aArrayTypeInfo: PTypeInfo; const aValues: array of TValue): TValue; static;
class function FromVarRec(const aValue: TVarRec): TValue; static;
@ -3675,6 +3676,12 @@ begin
Result.FData.FElSize := el.DataSize;
end;
class function TValue.From(aTypeInfo: PTypeInfo; ABuffer: Pointer): TValue;
begin
TValue.Make(ABuffer, PTypeInfo(aTypeInfo), Result);
end;
class function TValue.FromOrdinal(aTypeInfo: PTypeInfo; aValue: Int64): TValue;
{$ifdef ENDIAN_BIG}
var