mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 19:10:14 +02:00
rtl: add a helper method to get TProcedureSignature parameter by index
git-svn-id: trunk@24480 -
This commit is contained in:
parent
756ca5f318
commit
8b98a38b56
@ -21,6 +21,7 @@ unit typinfo;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH AdvancedRecords}
|
||||||
{$inline on}
|
{$inline on}
|
||||||
{$h+}
|
{$h+}
|
||||||
|
|
||||||
@ -155,7 +156,8 @@ unit typinfo;
|
|||||||
CC: TCallConv;
|
CC: TCallConv;
|
||||||
ResultType: PTypeInfo;
|
ResultType: PTypeInfo;
|
||||||
ParamCount: Byte;
|
ParamCount: Byte;
|
||||||
{Params: array[1..ParamCount] of TProcedureParam;}
|
{Params: array[0..ParamCount - 1] of TProcedureParam;}
|
||||||
|
function GetParam(ParamIndex: Integer): PProcedureParam;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$PACKRECORDS C}
|
{$PACKRECORDS C}
|
||||||
@ -2045,4 +2047,18 @@ begin
|
|||||||
Result:=IsStoredProp(instance,FindPropInfo(Instance,PropName));
|
Result:=IsStoredProp(instance,FindPropInfo(Instance,PropName));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TProcedureSignature }
|
||||||
|
|
||||||
|
function TProcedureSignature.GetParam(ParamIndex: Integer): PProcedureParam;
|
||||||
|
begin
|
||||||
|
if (ParamIndex<0)or(ParamIndex>=ParamCount) then
|
||||||
|
Exit(nil);
|
||||||
|
Result := PProcedureParam(PByte(@Flags) + SizeOf(Self));
|
||||||
|
while ParamIndex > 0 do
|
||||||
|
begin
|
||||||
|
Result := PProcedureParam(PByte(@Result^.Name) + (Length(Result^.Name) + 1) * SizeOf(AnsiChar));
|
||||||
|
dec(ParamIndex);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user