View Issue Details

IDProjectCategoryView StatusLast Update
0030985FPCRTLpublic2016-11-26 18:36
ReportersilvioprogAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0030985: [PATCH] Delphi compatibility: Add the QualifiedClassName method to TObject type
DescriptionHello,

Patch in attachment.

Thank you!
TagsNo tags attached.
Fixed in Revision34966
FPCOldBugId
FPCTarget
Attached Files
  • 0001-rtl-added-the-QualifiedClassName-method-to-the-TObje.patch (1,464 bytes)
    From 699da56a1aad9fcfba27198c1a69afa988ef84bc Mon Sep 17 00:00:00 2001
    From: silvioprog <silvioprog@gmail.com>
    Date: Wed, 23 Nov 2016 01:05:05 -0300
    Subject: [PATCH] rtl: added the QualifiedClassName method to the TObject type
    
    ---
     rtl/inc/objpas.inc  | 11 +++++++++++
     rtl/inc/objpash.inc |  1 +
     2 files changed, 12 insertions(+)
    
    diff --git a/rtl/inc/objpas.inc b/rtl/inc/objpas.inc
    index 07eeaab..d7c4b8b 100644
    --- a/rtl/inc/objpas.inc
    +++ b/rtl/inc/objpas.inc
    @@ -973,6 +973,17 @@
                 result:='';
             end;
     
    +      class function TObject.QualifiedClassName: ansistring;
    +        var
    +          uname: ansistring;
    +        begin
    +          uname := UnitName; //TODO: change 'UnitName' to 'UnitScope' as soon as RTL implement it
    +          if uname='' then
    +            result:=ClassName
    +          else
    +            result:=Concat(uname, '.', ClassName);
    +        end;
    +
           function TObject.Equals(Obj: TObject) : boolean;
             begin
               result:=Obj=Self;
    diff --git a/rtl/inc/objpash.inc b/rtl/inc/objpash.inc
    index dad397f..e732744 100644
    --- a/rtl/inc/objpash.inc
    +++ b/rtl/inc/objpash.inc
    @@ -249,6 +249,7 @@
     
               { new since Delphi 2009 }
               class function UnitName : ansistring;
    +          class function QualifiedClassName: ansistring;
               function Equals(Obj: TObject) : boolean;virtual;
               function GetHashCode: PtrInt;virtual;
               function ToString: ansistring;virtual;
    -- 
    2.7.4
    
    

Activities

silvioprog

2016-11-23 05:09

reporter  

0001-rtl-added-the-QualifiedClassName-method-to-the-TObje.patch (1,464 bytes)
From 699da56a1aad9fcfba27198c1a69afa988ef84bc Mon Sep 17 00:00:00 2001
From: silvioprog <silvioprog@gmail.com>
Date: Wed, 23 Nov 2016 01:05:05 -0300
Subject: [PATCH] rtl: added the QualifiedClassName method to the TObject type

---
 rtl/inc/objpas.inc  | 11 +++++++++++
 rtl/inc/objpash.inc |  1 +
 2 files changed, 12 insertions(+)

diff --git a/rtl/inc/objpas.inc b/rtl/inc/objpas.inc
index 07eeaab..d7c4b8b 100644
--- a/rtl/inc/objpas.inc
+++ b/rtl/inc/objpas.inc
@@ -973,6 +973,17 @@
             result:='';
         end;
 
+      class function TObject.QualifiedClassName: ansistring;
+        var
+          uname: ansistring;
+        begin
+          uname := UnitName; //TODO: change 'UnitName' to 'UnitScope' as soon as RTL implement it
+          if uname='' then
+            result:=ClassName
+          else
+            result:=Concat(uname, '.', ClassName);
+        end;
+
       function TObject.Equals(Obj: TObject) : boolean;
         begin
           result:=Obj=Self;
diff --git a/rtl/inc/objpash.inc b/rtl/inc/objpash.inc
index dad397f..e732744 100644
--- a/rtl/inc/objpash.inc
+++ b/rtl/inc/objpash.inc
@@ -249,6 +249,7 @@
 
           { new since Delphi 2009 }
           class function UnitName : ansistring;
+          class function QualifiedClassName: ansistring;
           function Equals(Obj: TObject) : boolean;virtual;
           function GetHashCode: PtrInt;virtual;
           function ToString: ansistring;virtual;
-- 
2.7.4

Michael Van Canneyt

2016-11-26 14:54

administrator   ~0096248

Checked and applied, thank you!

silvioprog

2016-11-26 18:36

reporter   ~0096264

Thank you too dude! :-)

Issue History

Date Modified Username Field Change
2016-11-23 05:09 silvioprog New Issue
2016-11-23 05:09 silvioprog File Added: 0001-rtl-added-the-QualifiedClassName-method-to-the-TObje.patch
2016-11-23 07:58 Michael Van Canneyt Assigned To => Michael Van Canneyt
2016-11-23 07:58 Michael Van Canneyt Status new => assigned
2016-11-26 14:54 Michael Van Canneyt Fixed in Revision => 34966
2016-11-26 14:54 Michael Van Canneyt Note Added: 0096248
2016-11-26 14:54 Michael Van Canneyt Status assigned => resolved
2016-11-26 14:54 Michael Van Canneyt Fixed in Version => 3.1.1
2016-11-26 14:54 Michael Van Canneyt Resolution open => fixed
2016-11-26 14:54 Michael Van Canneyt Target Version => 3.2.0
2016-11-26 18:36 silvioprog Note Added: 0096264
2016-11-26 18:36 silvioprog Status resolved => closed