Return a list of a certain type of published properties.
Source position: typinfo.pp line 1158
function GetPropList( |
TypeInfo: PTypeInfo; |
TypeKinds: TTypeKinds; |
PropList: PPropList; |
Sorted: Boolean = True |
):LongInt; |
TypeInfo: PTypeInfo; |
out PropList: PPropList |
):SizeInt; |
AClass: TClass; |
out PropList: PPropList |
):Integer; |
Instance: TObject; |
out PropList: PPropList |
):Integer; |
GetPropList stores pointers to property information of the class with class info TypeInfo for properties of kind TypeKinds in the list pointed to by Proplist. PropList must contain enough space to hold all properties.
The function returns the number of pointers that matched the criteria and were stored in PropList.
No checks are done to see whether PropList points to a memory area that is big enough to hold all pointers.
|
Return a list of published properties. |
|
|
Return property type information, by property name. |
Program example13; { This program demonstrates the GetPropList function } uses rttiobj,typinfo; Var O : TMyTestObject; PT : PTypeData; PI : PTypeInfo; I,J : Longint; PP : PPropList; prI : PPropInfo; begin O:=TMyTestObject.Create; PI:=O.ClassInfo; PT:=GetTypeData(PI); Writeln('Total property Count : ',PT^.PropCount); GetMem (PP,PT^.PropCount*SizeOf(Pointer)); J:=GetPropList(PI,OrdinalTypes,PP); Writeln('Ordinal property Count : ',J); For I:=0 to J-1 do begin With PP^[i]^ do begin Write('Property ',i+1:3,': ',name:30); writeln(' Type: ',TypeNames[typinfo.PropType(O,Name)]); end; end; FreeMem(PP); O.Free; end.