GetPropInfos
Return a list of published properties.
Declaration
Source position: typinfo.pp line 865
procedure GetPropInfos(TypeInfo: PTypeInfo; PropList: PPropList);
Description
GetPropInfos stores pointers to the property information of all published properties of a class with class info TypeInfo in the list pointed to by Proplist. The PropList pointer must point to a memory location that contains enough space to hold all properties of the class and its parent classes.
Errors
No checks are done to see whether PropList points to a memory area that is big enough to hold all pointers.
See also
Name | Description |
---|---|
GetPropInfo | Return property type information, by property name. |
GetPropList | Return a list of a certain type of published properties. |
Example
Program example12;
{ This program demonstrates the GetPropInfos 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('Property Count : ',PT^.PropCount);
GetMem (PP,PT^.PropCount*SizeOf(Pointer));
GetPropInfos(PI,PP);
For I:=0 to PT^.PropCount-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.