Use classtypeobj instead of classDeclaration:name for typemap searches.

Thanks Dave.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5462 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2003-12-02 22:16:00 +00:00
commit e021185ad1
2 changed files with 26 additions and 26 deletions

View file

@ -952,7 +952,7 @@ class CSHARP : public Language {
String *c_baseclass = NULL;
String *baseclass = NULL;
String *c_baseclassname = NULL;
String *classDeclarationName = Getattr(n,"classDeclaration:name");
String *typemap_lookup_type = Getattr(n,"classtypeobj");
/* Deal with inheritance */
List *baselist = Getattr(n,"bases");
@ -966,7 +966,7 @@ class CSHARP : public Language {
base = Next(base);
if (base.item) {
Swig_warning(WARN_CSHARP_MULTIPLE_INHERITANCE, input_file, line_number,
"Warning for %s proxy: Base %s ignored. Multiple inheritance is not supported in C#.\n", classDeclarationName, Getattr(base.item,"name"));
"Warning for %s proxy: Base %s ignored. Multiple inheritance is not supported in C#.\n", typemap_lookup_type, Getattr(base.item,"name"));
}
}
@ -975,20 +975,20 @@ class CSHARP : public Language {
baseclass = NewString("");
// Inheritance from pure C# classes
const String *pure_baseclass = typemapLookup("csbase", classDeclarationName, WARN_NONE);
const String *pure_baseclass = typemapLookup("csbase", typemap_lookup_type, WARN_NONE);
if (Len(pure_baseclass) > 0 && Len(baseclass) > 0) {
Swig_warning(WARN_CSHARP_MULTIPLE_INHERITANCE, input_file, line_number,
"Warning for %s proxy: Base %s ignored. Multiple inheritance is not supported in C#.\n", classDeclarationName, pure_baseclass);
"Warning for %s proxy: Base %s ignored. Multiple inheritance is not supported in C#.\n", typemap_lookup_type, pure_baseclass);
}
// Pure C# interfaces
const String *pure_interfaces = typemapLookup(derived ? "csinterfaces_derived" : "csinterfaces", classDeclarationName, WARN_NONE);
const String *pure_interfaces = typemapLookup(derived ? "csinterfaces_derived" : "csinterfaces", typemap_lookup_type, WARN_NONE);
// Start writing the proxy class
Printv(proxy_class_def,
typemapLookup("csimports", classDeclarationName, WARN_NONE), // Import statements
typemapLookup("csimports", typemap_lookup_type, WARN_NONE), // Import statements
"\n",
typemapLookup("csclassmodifiers", classDeclarationName, WARN_CSHARP_TYPEMAP_CLASSMOD_UNDEF), // Class modifiers
typemapLookup("csclassmodifiers", typemap_lookup_type, WARN_CSHARP_TYPEMAP_CLASSMOD_UNDEF), // Class modifiers
" class $csclassname", // Class name and bases
(derived || *Char(pure_baseclass) || *Char(pure_interfaces)) ?
" : " :
@ -1006,7 +1006,7 @@ class CSHARP : public Language {
" protected bool swigCMemOwn;\n",
"\n",
" ",
typemapLookup("csptrconstructormodifiers", classDeclarationName, WARN_CSHARP_TYPEMAP_PTRCONSTMOD_UNDEF), // pointer constructor modifiers
typemapLookup("csptrconstructormodifiers", typemap_lookup_type, WARN_CSHARP_TYPEMAP_PTRCONSTMOD_UNDEF), // pointer constructor modifiers
" $csclassname(IntPtr cPtr, bool cMemoryOwn) ", // Constructor used for wrapping pointers
derived ?
": base($imclassname.$csclassnameTo$baseclass(cPtr), cMemoryOwn) {\n" :
@ -1030,10 +1030,10 @@ class CSHARP : public Language {
Node *attributes = NewHash();
String *destruct_methodname = NULL;
if (derived) {
tm = typemapLookup("csdestruct_derived", classDeclarationName, WARN_NONE, attributes);
tm = typemapLookup("csdestruct_derived", typemap_lookup_type, WARN_NONE, attributes);
destruct_methodname = Getattr(attributes, "tmap:csdestruct_derived:methodname");
} else {
tm = typemapLookup("csdestruct", classDeclarationName, WARN_NONE, attributes);
tm = typemapLookup("csdestruct", typemap_lookup_type, WARN_NONE, attributes);
destruct_methodname = Getattr(attributes, "tmap:csdestruct:methodname");
}
if (!destruct_methodname) {
@ -1046,7 +1046,7 @@ class CSHARP : public Language {
// Finalize method
if (*Char(destructor_call)) {
Printv(proxy_class_def,
typemapLookup("csfinalize", classDeclarationName, WARN_NONE),
typemapLookup("csfinalize", typemap_lookup_type, WARN_NONE),
NIL);
}
// Dispose method
@ -1063,8 +1063,8 @@ class CSHARP : public Language {
// Emit various other methods
Printv(proxy_class_def,
typemapLookup("csgetcptr", classDeclarationName, WARN_CSHARP_TYPEMAP_GETCPTR_UNDEF), // getCPtr method
typemapLookup("cscode", classDeclarationName, WARN_NONE), // extra C# code
typemapLookup("csgetcptr", typemap_lookup_type, WARN_CSHARP_TYPEMAP_GETCPTR_UNDEF), // getCPtr method
typemapLookup("cscode", typemap_lookup_type, WARN_NONE), // extra C# code
"\n",
NIL);