From cc6aabaf8b68bb0454c4c960d81ccf85d0e5bc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 17 Dec 2024 18:10:35 +0100 Subject: [PATCH] * Introduce IsClassProperty, Index and Default in TRttiProperty. Patch from Lipinast Lekrisov --- packages/rtl-objpas/src/inc/rtti.pp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/rtl-objpas/src/inc/rtti.pp b/packages/rtl-objpas/src/inc/rtti.pp index 64427c53ff..08daf93d5c 100644 --- a/packages/rtl-objpas/src/inc/rtti.pp +++ b/packages/rtl-objpas/src/inc/rtti.pp @@ -556,6 +556,9 @@ type function GetIsWritable: boolean; override; function GetIsReadable: boolean; override; function GetDataType: TRttiType; override; + function GetDefault: Integer; virtual; + function GetIndex: Integer; virtual; + function GetIsClassProperty: boolean; virtual; protected function GetName: string; override; function GetHandle: Pointer; override; @@ -567,6 +570,9 @@ type procedure SetValue(Instance: pointer; const AValue: TValue); override; function ToString: String; override; property PropertyType: TRttiType read GetPropertyType; + property Default: Integer read GetDefault; + property Index: Integer read GetIndex; + property IsClassProperty: boolean read GetIsClassProperty; property IsReadable: boolean read GetIsReadable; property IsWritable: boolean read GetIsWritable; end; @@ -6751,6 +6757,21 @@ begin Result:=GetPropertyType end; +function TRttiProperty.GetDefault: Integer; +begin + Result := FPropInfo^.Default; +end; + +function TRttiProperty.GetIndex: Integer; +begin + Result := FPropInfo^.Index; +end; + +function TRttiProperty.GetIsClassProperty: boolean; +begin + result := FPropInfo^.IsStatic; +end; + function TRttiProperty.GetPropertyType: TRttiType; var context: TRttiContext;