View Issue Details

IDProjectCategoryView StatusLast Update
0038850pas2jsrtlpublic2021-05-04 08:54
ReporterWagner Landgraf Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Summary0038850: Add TypInfo.GetTypeName function
DescriptionDelphi provides a function GetTypeName in TypInfo unit since reading the Name field directly is not straightforward anymore.
Attached is a patch to add such function.
TagsNo tags attached.
Fixed in Revision1178.
Attached Files

Activities

Wagner Landgraf

2021-05-04 08:40

reporter  

typinfo.pas.patch (755 bytes)   
Index: typinfo.pas
===================================================================
--- typinfo.pas	(revision 1177)
+++ typinfo.pas	(working copy)
@@ -336,6 +336,8 @@
 
   EPropertyError  = class(Exception);
 
+function GetTypeName(TypeInfo: TTypeInfo): string;
+
 function GetClassMembers(aTIStruct: TTypeInfoStruct): TTypeMemberDynArray;
 function GetClassMember(aTIStruct: TTypeInfoStruct; const aName: String): TTypeMember;
 function GetInstanceMethod(Instance: TObject; const aName: String): Pointer;
@@ -455,6 +457,11 @@
 
 implementation
 
+function GetTypeName(TypeInfo: TTypeInfo): string;
+begin
+  Result := TypeInfo.Name;
+end;
+
 function GetClassMembers(aTIStruct: TTypeInfoStruct): TTypeMemberDynArray;
 var
   C: TTypeInfoStruct;
typinfo.pas.patch (755 bytes)   

Michael Van Canneyt

2021-05-04 08:54

administrator   ~0130747

Applied, thank you...

Issue History

Date Modified Username Field Change
2021-05-04 08:40 Wagner Landgraf New Issue
2021-05-04 08:40 Wagner Landgraf File Added: typinfo.pas.patch
2021-05-04 08:53 Mattias Gaertner Assigned To => Mattias Gaertner
2021-05-04 08:53 Mattias Gaertner Status new => assigned
2021-05-04 08:54 Michael Van Canneyt Assigned To Mattias Gaertner => Michael Van Canneyt
2021-05-04 08:54 Michael Van Canneyt Status assigned => resolved
2021-05-04 08:54 Michael Van Canneyt Resolution open => fixed
2021-05-04 08:54 Michael Van Canneyt Fixed in Revision => 1178.
2021-05-04 08:54 Michael Van Canneyt Note Added: 0130747