4 compare file1.dll file2.dll annotations.xml
6 file1.dll: This is an assembly created by Microsoft.
8 file2.dll: This is a Mono assembly (currently we have none
11 annotations.xml: contains comments about a class:
13 <class name="System.Object">
15 <email>miguel@ximian.com</email>
16 <name>Miguel de Icaza</name>
18 <status test-suite="no" percent="XX">
21 That would generate an XML file with all the classes that are
22 implemented in the second library. If there is nothing for a
23 given class, it should generate an emtpy group:
25 <class name="System.Object">
30 Using a Perl script that can grok XML, generate HTML pages
31 that we can put on the web site:
34 Per maintainer status.
41 using System.Collections;
42 using System.Reflection;
45 /// Summary description for Class1.
50 Hashtable nshash = new Hashtable();
53 public Mapper(string name)
55 a = Assembly.LoadFrom (name);
60 Console.WriteLine (s.PadLeft (s.Length + indent, ' '));
63 void DumpMember (MemberInfo mi)
68 switch (mi.MemberType)
70 case MemberTypes.Field:
73 case MemberTypes.Method:
74 if (((MethodInfo)mi).IsSpecialName) {
78 more = " signature='" + mi.ToString() +"'";
80 case MemberTypes.Event:
83 case MemberTypes.Property:
87 kind = "***UNKOWN***";
91 o ("<" + kind + " name='" + mi.Name + "'" + more + "/>");
94 void DumpType (Type t)
96 string kind, name, attrs = "";
102 } else if (t.IsInterface) {
104 } else if (t.IsValueType) {
106 } else if (t.IsEnum) {
111 attrs += "abstract='true'";
112 } else if (t.IsSealed) {
113 attrs += "sealed='true'";
114 } else if (t.IsCOMObject) {
115 attrs += "comobject='true'";
118 o ("<" + kind + " name='" + name + (attrs == "" ? "'" : "' ") + attrs + ">");
122 /*o ("<maintainer></maintainer>");
123 o ("<description></description>");*/
125 foreach (Type type in t.GetNestedTypes ())
130 foreach (FieldInfo field in t.GetFields ())
135 foreach (MethodInfo method in t.GetMethods ())
142 o ("</" + kind + ">");
145 void LoadTypeList (Type [] types)
147 foreach (Type t in types)
149 ArrayList list = (ArrayList) nshash [t.Namespace];
152 list = new ArrayList ();
153 nshash.Add (t.Namespace, list);
159 void DumpTypeList (Type [] types)
161 LoadTypeList (types);
163 foreach (string ns in nshash.Keys)
165 o ("<namespace " + "name='" + ns + "'>");
169 foreach (Type t in (ArrayList) nshash [ns])
186 name = a.GetName ().Name;
187 types = a.GetExportedTypes ();
188 modules = a.GetModules ();
190 o ("<assembly name='" + name + "'>");
194 /*o ("<maintainer></maintainer>");
195 o ("<description></description>");*/
197 DumpTypeList (types);
204 public static int Main(string[] args)
207 string basedir = "c:\\WINDOWS\\Microsoft.NET\\Framework\\v1.0.2914\\";
209 if (args.Length > 0) {
210 foreach (string s in args){
212 m = new Mapper (basedir + s);
214 } catch (Exception e) {
215 Console.WriteLine("Error: "+e.ToString());
220 m = new Mapper (basedir + "mscorlib.dll");
222 } catch (Exception e) {
223 Console.WriteLine("Error: "+e.ToString());