mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 22:09:32 +02:00
* Introduce IsClassProperty, Index and Default in TRttiProperty. Patch from Lipinast Lekrisov
This commit is contained in:
parent
fd10c88264
commit
cc6aabaf8b
@ -556,6 +556,9 @@ type
|
|||||||
function GetIsWritable: boolean; override;
|
function GetIsWritable: boolean; override;
|
||||||
function GetIsReadable: boolean; override;
|
function GetIsReadable: boolean; override;
|
||||||
function GetDataType: TRttiType; override;
|
function GetDataType: TRttiType; override;
|
||||||
|
function GetDefault: Integer; virtual;
|
||||||
|
function GetIndex: Integer; virtual;
|
||||||
|
function GetIsClassProperty: boolean; virtual;
|
||||||
protected
|
protected
|
||||||
function GetName: string; override;
|
function GetName: string; override;
|
||||||
function GetHandle: Pointer; override;
|
function GetHandle: Pointer; override;
|
||||||
@ -567,6 +570,9 @@ type
|
|||||||
procedure SetValue(Instance: pointer; const AValue: TValue); override;
|
procedure SetValue(Instance: pointer; const AValue: TValue); override;
|
||||||
function ToString: String; override;
|
function ToString: String; override;
|
||||||
property PropertyType: TRttiType read GetPropertyType;
|
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 IsReadable: boolean read GetIsReadable;
|
||||||
property IsWritable: boolean read GetIsWritable;
|
property IsWritable: boolean read GetIsWritable;
|
||||||
end;
|
end;
|
||||||
@ -6751,6 +6757,21 @@ begin
|
|||||||
Result:=GetPropertyType
|
Result:=GetPropertyType
|
||||||
end;
|
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;
|
function TRttiProperty.GetPropertyType: TRttiType;
|
||||||
var
|
var
|
||||||
context: TRttiContext;
|
context: TRttiContext;
|
||||||
|
Loading…
Reference in New Issue
Block a user