Merge pull request #3067 from lambdageek/dev/monoerror-stringy
[mono.git] / mcs / class / PEAPI / PEAPI.cs
index b389b3cb8bfe543a4ab9e9dbe316025d3487e888..ec3cb4107176a74c0065e82b37a7e856322056bf 100644 (file)
@@ -590,8 +590,6 @@ namespace PEAPI {
                private static readonly string mscorlibName = "mscorlib";
                private Module thisMod;
                private ClassDef moduleClass;
-               private ArrayList classRefList = new ArrayList();
-               private ArrayList classDefList = new ArrayList();
                private ArrayList resources = new ArrayList ();
                private Assembly thisAssembly;
                private static bool isMSCorlib;
@@ -755,6 +753,11 @@ namespace PEAPI {
                        return modRef;
                }
 
+               public ClassRef AddExternClass(string ns, string name, TypeAttr attrs, MetaDataElement declRef)
+               {
+                       return new ExternClassRef (attrs, ns, name, declRef, metaData);
+               }
+               
                /// <summary>
                /// Add a "global" method to this module
                /// </summary>
@@ -920,6 +923,11 @@ namespace PEAPI {
                        return file;
                }
 
+               public PrimitiveTypeRef AddPrimitiveType (PrimitiveType type)
+               {
+                       return new PrimitiveTypeRef (type, metaData);
+               }
+
                /// <summary>
                /// Add a manifest resource to this PEFile NOT YET IMPLEMENTED
                /// </summary>
@@ -937,6 +945,12 @@ namespace PEAPI {
                        element.HasCustomAttr = true;
                }
 
+               public void AddCustomAttribute (Method meth, Constant constant, MetaDataElement element)
+               {
+                       metaData.AddCustomAttribute (new CustomAttribute (element, meth, constant));
+                       element.HasCustomAttr = true;
+               }
+
                public void AddDeclSecurity (SecurityAction sec_action, byte [] data, MetaDataElement element)
                {
                        metaData.AddDeclSecurity (new DeclSecurity (element, (ushort) sec_action, data));