copied mono-api-diff.cs from mono-2-2 branch so new patch can be applied and history...
[mono.git] / mcs / class / corlib / System.Reflection.Emit / LocalBuilder.cs
1
2 //
3 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining
6 // a copy of this software and associated documentation files (the
7 // "Software"), to deal in the Software without restriction, including
8 // without limitation the rights to use, copy, modify, merge, publish,
9 // distribute, sublicense, and/or sell copies of the Software, and to
10 // permit persons to whom the Software is furnished to do so, subject to
11 // the following conditions:
12 // 
13 // The above copyright notice and this permission notice shall be
14 // included in all copies or substantial portions of the Software.
15 // 
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24
25 //
26 // System.Reflection.Emit/LocalBuilder.cs
27 //
28 // Authors:
29 //   Paolo Molaro (lupus@ximian.com)
30 //   Martin Baulig (martin@gnome.org)
31 //   Miguel de Icaza (miguel@ximian.com)
32 //
33 // (C) 2001, 2002 Ximian, Inc.  http://www.ximian.com
34 //
35
36 using System;
37 using System.Reflection;
38 using System.Reflection.Emit;
39 using System.Globalization;
40 using System.Runtime.CompilerServices;
41 using System.Runtime.InteropServices;
42 using System.Diagnostics.SymbolStore;
43
44 namespace System.Reflection.Emit {
45         [ComVisible (true)]
46         [ComDefaultInterface (typeof (_LocalBuilder))]
47         [ClassInterface (ClassInterfaceType.None)]
48         public sealed class LocalBuilder : LocalVariableInfo, _LocalBuilder {
49
50                 // Some fields are already defined in LocalVariableInfo
51                 #region Sync with reflection.h
52                 private string name;
53                 #endregion
54                 
55                 internal ILGenerator ilgen;
56                 int startOffset;
57                 int endOffset;
58
59                 internal LocalBuilder (Type t, ILGenerator ilgen)
60                 {
61                         this.type = t;
62                         this.ilgen = ilgen;
63                 }
64
65                 public void SetLocalSymInfo (string name, int startOffset, int endOffset)
66                 {
67                         this.name = name;
68                         this.startOffset = startOffset;
69                         this.endOffset = endOffset;
70                 }
71
72                 public void SetLocalSymInfo (string name)
73                 {
74                         SetLocalSymInfo (name, 0, 0);
75                 }
76
77                 public override Type LocalType
78                 {
79                         get {
80                                 return type;
81                         }
82                 }
83
84                 public override bool IsPinned
85                 {
86                         get {
87                                 return is_pinned;
88                         }
89                 }
90
91                 public override int LocalIndex
92                 {
93                         get {
94                                 return position;
95                         }
96                 }
97
98                 internal static int Mono_GetLocalIndex (LocalBuilder builder)
99                 {
100                         return builder.position;
101                 }
102
103                 internal string Name {
104                         get { return name; }
105                 }
106                 
107                 internal int StartOffset {
108                         get { return startOffset; }
109                 }
110                 
111                 internal int EndOffset {
112                         get { return endOffset; }
113                 }
114
115                 void _LocalBuilder.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
116                 {
117                         throw new NotImplementedException ();
118                 }
119
120                 void _LocalBuilder.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
121                 {
122                         throw new NotImplementedException ();
123                 }
124
125                 void _LocalBuilder.GetTypeInfoCount (out uint pcTInfo)
126                 {
127                         throw new NotImplementedException ();
128                 }
129
130                 void _LocalBuilder.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
131                 {
132                         throw new NotImplementedException ();
133                 }
134         }
135 }