From c4d545bd5da581d1e872996ffc7c05bc225af2ae Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 6 Sep 2003 15:39:31 +0000 Subject: [PATCH] new method abstractClassTest - by Scott Michel git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5085 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/lang.cxx | 10 +++++++++- SWIG/Source/Modules/swigmod.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/SWIG/Source/Modules/lang.cxx b/SWIG/Source/Modules/lang.cxx index 3f74b1a77..b4edb9fa4 100644 --- a/SWIG/Source/Modules/lang.cxx +++ b/SWIG/Source/Modules/lang.cxx @@ -1619,7 +1619,7 @@ int Language::classDeclaration(Node *n) { InClass = 1; CurrentClass = n; - Abstract = (Getattr(n,"abstract") ? 1 : 0); + Abstract = abstractClassTest(n); /* Call classHandler() here */ if (!ImportMode) { @@ -2166,6 +2166,14 @@ String * Language::getClassType() const { return ClassType; } +/* ----------------------------------------------------------------------------- + * Language::abstractClassTest() + * ----------------------------------------------------------------------------- */ + +int Language::abstractClassTest(Node *n) { + return (Getattr(n,"abstract") ? 1 : 0); +} + void Language::setSubclassInstanceCheck(String *nc) { none_comparison = nc; } diff --git a/SWIG/Source/Modules/swigmod.h b/SWIG/Source/Modules/swigmod.h index 7e9d98d61..aa7e505b9 100644 --- a/SWIG/Source/Modules/swigmod.h +++ b/SWIG/Source/Modules/swigmod.h @@ -202,6 +202,7 @@ public: virtual int addSymbol(String *s, Node *n); /* Add symbol */ virtual Node *symbolLookup(String *s); /* Symbol lookup */ virtual Node *classLookup(SwigType *s); /* Class lookup */ + virtual int abstractClassTest(Node *n); /* Is class really abstract? */ /* Allow director related code generation */ void allow_directors(int val = 1);