Browse Source

Fix the name property lookup to have a default, looks like some

structs don't have it on the defined

git-svn-id: https://mono-soc-2010.googlecode.com/svn/trunk/cppinterop@120 a470b8cb-0e6f-1642-1b45-71e107334c4b
pull/1/head
shana.ufie@gmail.com 15 years ago
parent
commit
087c65ade8
  1. 9
      generator/Main.cs

9
generator/Main.cs

@ -341,6 +341,9 @@ namespace CPPInterop { @@ -341,6 +341,9 @@ namespace CPPInterop {
{
XmlNode n = root.SelectSingleNode ("/GCC_XML/*[@id='" + id + "']");
string name = "unknown";
if (n.Attributes ["name"] != null)
name = n.Attributes ["name"].Value;
switch (n.Name) {
case "ArrayType": return findType (root, n.Attributes ["type"].Value, modifiers.Modify (CppModifiers.Array));
case "PointerType": return findType (root, n.Attributes ["type"].Value, modifiers.Modify (CppModifiers.Pointer));
@ -351,9 +354,9 @@ namespace CPPInterop { @@ -351,9 +354,9 @@ namespace CPPInterop {
case "Typedef": return findType (root, n.Attributes ["type"].Value, modifiers);
case "FundamentalType": return modifiers.ApplyTo (new CppType (n.Attributes ["name"].Value));
case "Class": return modifiers.ApplyTo (new CppType (CppTypes.Class, n.Attributes ["name"].Value));
case "Struct": return modifiers.ApplyTo (new CppType (CppTypes.Struct, n.Attributes ["name"].Value));
case "FundamentalType": return modifiers.ApplyTo (new CppType (name));
case "Class": return modifiers.ApplyTo (new CppType (CppTypes.Class, name));
case "Struct": return modifiers.ApplyTo (new CppType (CppTypes.Struct, name));
case "Union": return modifiers.ApplyTo (ProcessUnion (root, n));
case "Enumeration": return modifiers.ApplyTo (ProcessEnum (n));

Loading…
Cancel
Save