// Jonathan Pryor (jonpryor@vt.edu)
//
// (C) 2003 Novell, Inc.
-// (C) 2004 Jonathan Pryor
+// (C) 2004-2005 Jonathan Pryor
//
//
if (t.Namespace.StartsWith ("System"))
return "int /* warning: unknown mapping for type: " + t.Name + " */";
string ts = "struct " +
- MakeMap.GetNativeName (t.FullName).Replace ("+", "_").Replace ("&", "*");
+ MakeMap.GetNativeName (t.FullName).Replace ("+", "_").Replace ("&", "*")
+ .Replace ("[]", "*");
return ts;
}
}
typeof(ObsoleteAttribute), false);
string obsolete = "";
if (oa != null) {
- obsolete = "[Obsolete (\"" + oa.Message + "\")]\n\t\t";
+ obsolete = string.Format ("[Obsolete (\"{0}\", {1})]\n\t\t",
+ oa.Message, oa.IsError ? "true" : "false");
}
- scs.WriteLine ("\t\t[DllImport (LIB, " +
+ scs.WriteLine ("\t\t{3}[DllImport (LIB, " +
"EntryPoint=\"{0}_From{1}\")]\n" +
"\t\tprivate static extern int From{1} ({1} value, out {2} rval);\n",
- ns, t.Name, mtype);
+ ns, t.Name, mtype, obsolete);
scs.WriteLine ("\t\t{3}public static bool TryFrom{1} ({1} value, out {2} rval)\n" +
"\t\t{{\n" +
"\t\t\treturn From{1} (value, out rval) == 0;\n" +
"\t\t\t\tThrowArgumentException (value);", t.Name);
scs.WriteLine ("\t\t\treturn rval;");
scs.WriteLine ("\t\t}\n");
- scs.WriteLine ("\t\t[DllImport (LIB, " +
+ scs.WriteLine ("\t\t{3}[DllImport (LIB, " +
"EntryPoint=\"{0}_To{1}\")]\n" +
"\t\tprivate static extern int To{1} ({2} value, out {1} rval);\n",
- ns, t.Name, mtype);
+ ns, t.Name, mtype, obsolete);
scs.WriteLine ("\t\t{2}public static bool TryTo{1} ({0} value, out {1} rval)\n" +
"\t\t{{\n" +
"\t\t\treturn To{1} (value, out rval) == 0;\n" +