Quellcode durchsuchen

* added GetPropList function for TClass parameter

git-svn-id: trunk@11811 -
ivost vor 17 Jahren
Ursprung
Commit
fc6ae58b9b
1 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen
  1. 9 3
      rtl/objpas/typinfo.pp

+ 9 - 3
rtl/objpas/typinfo.pp

@@ -208,10 +208,12 @@ Function GetPropInfo(AClass: TClass; const PropName: string; AKinds: TTypeKinds)
 Function GetPropInfo(AClass: TClass; const PropName: string): PPropInfo;
 Function FindPropInfo(Instance: TObject; const PropName: string): PPropInfo;
 Function FindPropInfo(AClass:TClass;const PropName: string): PPropInfo;
+
 Procedure GetPropInfos(TypeInfo : PTypeInfo;PropList : PPropList);
 Function GetPropList(TypeInfo : PTypeInfo;TypeKinds : TTypeKinds; PropList : PPropList;Sorted : boolean = true):longint;
 Function GetPropList(TypeInfo: PTypeInfo; out PropList: PPropList): SizeInt;
-function GetPropList(AObject: TObject; out PropList: PPropList): Integer;
+function GetPropList(AClass: TClass; out PropList: PPropList): Integer;
+function GetPropList(Instance: TObject; out PropList: PPropList): Integer;
 
 
 
@@ -780,10 +782,14 @@ begin
     PropList:=Nil;  
 end;
 
+function GetPropList(AClass: TClass; out PropList: PPropList): Integer;
+begin
+  Result := GetPropList(PTypeInfo(AClass.ClassInfo), PropList);
+end;
 
-function GetPropList(AObject: TObject; out PropList: PPropList): Integer;
+function GetPropList(Instance: TObject; out PropList: PPropList): Integer;
 begin
-  Result := GetPropList(PTypeInfo(AObject.ClassInfo), PropList);
+  Result := GetPropList(Instance.ClassType, PropList);
 end;
 
 { ---------------------------------------------------------------------