mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 07:28:26 +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 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;
|
||||
|
Loading…
Reference in New Issue
Block a user