* Introduce AsOrdinal. Patch by Lipinast Lekrisov

This commit is contained in:
Michaël Van Canneyt 2024-12-17 17:50:31 +01:00
parent 5a6b4ed8e4
commit 6c1c3e35ee

View File

@ -71,6 +71,7 @@ type
TRttiIndexedProperty = class;
TRttiField = Class;
TRttiProperty = class;
TRttiOrdinalType = class;
TRttiInstanceType = class;
TRttiRecordType = class;
@ -361,6 +362,7 @@ type
FProperties : TRttiPropertyArray;
FIndexedProperties : TRttiIndexedPropertyArray;
function GetAsInstance: TRttiInstanceType;
function GetAsOrdinal: TRttiOrdinalType;
function GetAsRecord: TRttiRecordType;
protected
FTypeData: PTypeData;
@ -401,6 +403,7 @@ type
property BaseType: TRttiType read GetBaseType;
property Handle: PTypeInfo read FTypeInfo;
property AsInstance: TRttiInstanceType read GetAsInstance;
property AsOrdinal: TRttiOrdinalType read GetAsOrdinal;
property AsRecord: TRttiRecordType read GetAsRecord;
property TypeKind: TTypeKind read GetTypeKind;
property TypeSize: integer read GetTypeSize;
@ -7183,6 +7186,11 @@ begin
result := TRttiInstanceType(self);
end;
function TRttiType.GetAsOrdinal: TRttiOrdinalType;
begin
Result := TRttiOrdinalType(Self);
end;
function TRttiType.GetAsRecord: TRttiRecordType;
begin
result := TRttiRecordType(self);