Some warning reduction:
[mono.git] / mcs / class / corlib / System.Reflection.Emit / AssemblyBuilder.cs
1 using System;
2 using System.Reflection;
3 using System.Resources;
4 using System.IO;
5 using System.Security.Policy;
6 using System.Runtime.Serialization;
7 using System.Globalization;
8 using System.Runtime.CompilerServices;
9
10 namespace System.Reflection.Emit {
11
12         public sealed class AssemblyBuilder : Assembly {
13                 private IntPtr _impl;
14                 private MethodInfo entry_point;
15
16                 public override string CodeBase {
17                         get {
18                                 return null;
19                         }
20                 }
21                 
22                 public override MethodInfo EntryPoint {
23                         get {
24                                 return entry_point;
25                         }
26                 }
27
28                 public override string Location {
29                         get {
30                                 return null;
31                         }
32                 }
33
34                 public void AddResourceFile (string name, string fileName)
35                 {
36                 }
37
38                 public void AddResourceFile (string name, string fileName, ResourceAttributes attribute)
39                 {
40                 }
41
42                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
43                 private static extern ModuleBuilder defineModule (AssemblyBuilder ab,
44                                                                   string name,
45                                                                   string filename);
46                 
47                 public override ModuleBuilder DefineDynamicModule (string name)
48                 {
49                         return null;
50                 }
51
52                 public override ModuleBuilder DefineDynamicModule (string name, bool emitSymbolInfo)
53                 {
54                         return null;
55                 }
56
57                 public ModuleBuilder DefineDynamicModule(string name, string fileName)
58                 {
59                         return defineModule (this, name, fileName);
60                 }
61
62                 public ModuleBuilder DefineDynamicModule (string name, string fileName,
63                                                           bool emitSymbolInfo)
64                 {
65                         return null;
66                 }
67
68                 public IResourceWriter DefineResource (string name, string description, string fileName)
69                 {
70                         return null;
71                 }
72
73                 public IResourceWriter DefineResource (string name, string description,
74                                                        string fileName, ResourceAttributes attribute)
75                 {
76                         return null;
77                 }
78
79                 public void DefineUnmanagedResource (byte[] resource)
80                 {
81                 }
82
83                 public void DefineUnmanagedResource (string resourceFileName)
84                 {
85                 }
86
87                 public void DefineVersionInfoResource ()
88                 {
89                 }
90
91                 public void DefineVersionInfoResource (string product, string productVersion,
92                                                        string company, string copyright, string trademark)
93                 {
94                 }
95
96                 public ModuleBuilder GetDynamicModule (string name)
97                 {
98                         return null;
99                 }
100
101                 public override Type[] GetExportedTypes ()
102                 {
103                         return null;
104                 }
105
106                 public override FileStream GetFile (string name)
107                 {
108                         return null;
109                 }
110
111                 /*public virtual FileStream[] GetFiles() {
112                         return null;
113                 }
114                 public override FileStream[] GetFiles(bool getResourceModules) {
115                         return null;
116                 }*/
117
118                 /*public virtual ManifestResourceInfo GetManifestResourceInfo(string resourceName)
119                   {
120                         return null;
121                 }
122                 public virtual string[] GetManifestResourceNames() {
123                         return null;
124                 }
125                 public virtual Stream GetManifestResourceStream(string name) {
126                         return null;
127                 }
128                 public virtual Stream GetManifestResourceStream(Type type, string name) {
129                         return null;
130                 }*/
131
132                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
133                 private static extern int getDataChunk (AssemblyBuilder ab, int type, byte[] buf);
134
135                 public void Save (string assemblyFileName)
136                 {
137                         byte[] buf = new byte[8192];
138                         FileStream file;
139                         int count;
140
141                         file = new FileStream (assemblyFileName, FileMode.OpenOrCreate, FileAccess.Write);
142
143                         count = getDataChunk (this, 0, buf);
144                         if (count != 0) {
145                                 file.Write (buf, 0, count);
146                                 count = getDataChunk (this, 1, buf); /* may be a too small buffer */
147                                 file.Write (buf, 0, count);
148                         }
149
150                         file.Close ();
151                 }
152
153                 public void SetEntryPoint (MethodInfo entryMethod)
154                 {
155                         entry_point = entryMethod;
156                 }
157
158         }
159 }