* Introduce IsClassProperty, Index and Default in TRttiProperty. Patch from Lipinast Lekrisov

This commit is contained in:
Michaël Van Canneyt 2024-12-17 18:10:35 +01:00
parent fd10c88264
commit cc6aabaf8b

View File

@ -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;