mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:29:28 +02:00
* TValue.From with buffer and typeinfo. Patch from Lipinast Lekrisov
This commit is contained in:
parent
69140d22eb
commit
98a7fe6204
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user