[Overview][Constants][Types][Classes][Procedures and functions] |
Return a list of a certain type of published properties.
Source position: line 0
function GetPropList( |
TypeInfo: PTypeInfo; |
TypeKinds: TTypeKinds; |
PropList: PPropList; |
Sorted: Boolean = true |
):LongInt; |
TypeInfo: PTypeInfo; |
out PropList: PPropList |
):SizeInt; |
AObject: TObject; |
out PropList: PPropList |
):Integer; |
GetPropListstores pointers to property information of the class with class info TypeInfofor properties of kind TypeKindsin the list pointed to by Proplist. PropListmust 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 PropListpoints 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.