From 8e34a026b91dd6c5ca3854fee14896f056b27fa7 Mon Sep 17 00:00:00 2001 From: marcos henrich Date: Mon, 22 Jul 2013 02:21:07 +0100 Subject: [PATCH] Changed property Declaration.Name to virtual. Now ClassTemplate shares Name with its TemplatedClass. --- src/AST/Declaration.cs | 4 ++-- src/AST/Template.cs | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/AST/Declaration.cs b/src/AST/Declaration.cs index f794b39e..c715d347 100644 --- a/src/AST/Declaration.cs +++ b/src/AST/Declaration.cs @@ -44,7 +44,7 @@ namespace CppSharp.AST private string name; // Name of the declaration. - public string Name + public virtual string Name { get { return name; } set @@ -67,7 +67,7 @@ namespace CppSharp.AST } // Name of the declaration. - public string OriginalName; + public virtual string OriginalName { get; set;} public string QualifiedOriginalName { diff --git a/src/AST/Template.cs b/src/AST/Template.cs index dbce1df7..637400a0 100644 --- a/src/AST/Template.cs +++ b/src/AST/Template.cs @@ -41,6 +41,40 @@ namespace CppSharp.AST { return visitor.VisitClassTemplateDecl(this); } + + public override string Name + { + get + { + if(TemplatedDecl != null) + return TemplatedClass.Name; + return base.Name; + } + set + { + if(TemplatedDecl != null) + TemplatedClass.Name = value; + else + base.Name = value; + } + } + + public override string OriginalName + { + get + { + if(TemplatedDecl != null) + return TemplatedClass.OriginalName; + return base.OriginalName; + } + set + { + if(TemplatedDecl != null) + TemplatedClass.OriginalName = value; + else + base.OriginalName = value; + } + } } public class ClassTemplateSpecialization : Class