Author: jbevain
Date: 2005-11-01 03:39:42 -0500 (Tue, 01 Nov 2005)
New Revision: 52440
Added:
trunk/cecil/lib/Mono.Cecil/IMethodSpecification.cs
trunk/cecil/lib/Mono.Cecil/ITypeSpecification.cs
trunk/cecil/lib/Mono.Cecil/MethodSpecification.cs
trunk/cecil/lib/Mono.Cecil/TypeSpecification.cs
Modified:
trunk/cecil/lib/ChangeLog
trunk/cecil/lib/Mono.Cecil.dll.sources
trunk/cecil/lib/Mono.Cecil/ArrayType.cs
trunk/cecil/lib/Mono.Cecil/GenericInstanceMethod.cs
trunk/cecil/lib/Mono.Cecil/GenericInstanceType.cs
trunk/cecil/lib/Mono.Cecil/IArrayType.cs
trunk/cecil/lib/Mono.Cecil/IGenericInstanceMethod.cs
trunk/cecil/lib/Mono.Cecil/IGenericInstanceType.cs
trunk/cecil/lib/Mono.Cecil/IModifierType.cs
trunk/cecil/lib/Mono.Cecil/IPinnedType.cs
trunk/cecil/lib/Mono.Cecil/IPointerType.cs
trunk/cecil/lib/Mono.Cecil/IReferenceType.cs
trunk/cecil/lib/Mono.Cecil/Modifiers.cs
trunk/cecil/lib/Mono.Cecil/PinnedType.cs
trunk/cecil/lib/Mono.Cecil/PointerType.cs
trunk/cecil/lib/Mono.Cecil/ReferenceType.cs
Log:
2005-11-01 Jb Evain <[EMAIL PROTECTED]>
* Mono.Cecil/ArrayType.cs
Mono.Cecil/MethodSpecification.cs
Mono.Cecil/TypeSpecification.cs
Mono.Cecil/IMethodSpecification.cs
Mono.Cecil/GenericInstanceType.cs
Mono.Cecil/IGenericInstanceType.cs
Mono.Cecil/GenericInstanceMethod.cs
Mono.Cecil/IModifierType.cs
Mono.Cecil/IPinnedType.cs
Mono.Cecil/ReferenceType.cs
Mono.Cecil/IGenericInstanceMethod.cs
Mono.Cecil/PinnedType.cs
Mono.Cecil/PointerType.cs
Mono.Cecil/IPointerType.cs
Mono.Cecil/IReferenceType.cs
Mono.Cecil/IArrayType.cs
Mono.Cecil/ITypeSpecification.cs
Mono.Cecil/Modifiers.cs
Mono.Cecil.dll.sources:
Uniformize the specification model.
Modified: trunk/cecil/lib/ChangeLog
===================================================================
--- trunk/cecil/lib/ChangeLog 2005-11-01 05:13:06 UTC (rev 52439)
+++ trunk/cecil/lib/ChangeLog 2005-11-01 08:39:42 UTC (rev 52440)
@@ -1,3 +1,26 @@
+2005-11-01 Jb Evain <[EMAIL PROTECTED]>
+
+ * Mono.Cecil/ArrayType.cs
+ Mono.Cecil/MethodSpecification.cs
+ Mono.Cecil/TypeSpecification.cs
+ Mono.Cecil/IMethodSpecification.cs
+ Mono.Cecil/GenericInstanceType.cs
+ Mono.Cecil/IGenericInstanceType.cs
+ Mono.Cecil/GenericInstanceMethod.cs
+ Mono.Cecil/IModifierType.cs
+ Mono.Cecil/IPinnedType.cs
+ Mono.Cecil/ReferenceType.cs
+ Mono.Cecil/IGenericInstanceMethod.cs
+ Mono.Cecil/PinnedType.cs
+ Mono.Cecil/PointerType.cs
+ Mono.Cecil/IPointerType.cs
+ Mono.Cecil/IReferenceType.cs
+ Mono.Cecil/IArrayType.cs
+ Mono.Cecil/ITypeSpecification.cs
+ Mono.Cecil/Modifiers.cs
+ Mono.Cecil.dll.sources:
+ Uniformize the specification model.
+
2005-10-31 Jb Evain <[EMAIL PROTECTED]>
* AUTHORS,
Modified: trunk/cecil/lib/Mono.Cecil/ArrayType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/ArrayType.cs 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil/ArrayType.cs 2005-11-01 08:39:42 UTC (rev
52440)
@@ -33,16 +33,10 @@
using Mono.Cecil.Signatures;
- public sealed class ArrayType : TypeReference, IArrayType {
+ public sealed class ArrayType : TypeSpecification, IArrayType {
- private TypeReference m_elementsType;
private ArrayDimensionCollection m_dimensions;
- public TypeReference ElementType {
- get { return m_elementsType; }
- set { m_elementsType = value; }
- }
-
public ArrayDimensionCollection Dimensions {
get { return m_dimensions; }
}
@@ -51,20 +45,6 @@
get { return m_dimensions.Count; }
}
- public override string Name {
- get { return m_elementsType.Name; }
- set { m_elementsType.Name = value; }
- }
-
- public override string Namespace {
- get { return m_elementsType.Namespace; }
- set { m_elementsType.Namespace = value; }
- }
-
- public override IMetadataScope Scope {
- get { return m_elementsType.Scope; }
- }
-
public bool IsSizedArray {
get {
if (this.Rank != 1)
@@ -107,10 +87,8 @@
}
}
- public ArrayType (TypeReference elementsType) :
- base (elementsType.Name, elementsType.Namespace)
+ public ArrayType (TypeReference elementsType) : base
(elementsType)
{
- m_elementsType = elementsType;
m_dimensions = new ArrayDimensionCollection (this);
}
}
Modified: trunk/cecil/lib/Mono.Cecil/GenericInstanceMethod.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/GenericInstanceMethod.cs 2005-11-01 05:13:06 UTC
(rev 52439)
+++ trunk/cecil/lib/Mono.Cecil/GenericInstanceMethod.cs 2005-11-01 08:39:42 UTC
(rev 52440)
@@ -28,69 +28,34 @@
namespace Mono.Cecil {
- using System;
using System.Text;
- public sealed class GenericInstanceMethod : MethodReference,
IGenericInstanceMethod {
+ public sealed class GenericInstanceMethod : MethodSpecification,
IGenericInstanceMethod {
- MethodReference m_elementMethod;
GenericArgumentCollection m_arguments;
- public MethodReference ElementMethod {
- get { return m_elementMethod; }
- set { m_elementMethod = value; }
- }
-
public GenericArgumentCollection Arguments {
get { return m_arguments; }
}
- public override MethodCallingConvention CallingConvention {
- get { return m_elementMethod.CallingConvention; }
- set { throw new InvalidOperationException (); }
- }
-
- public override bool HasThis {
- get { return m_elementMethod.HasThis; }
- set { throw new InvalidOperationException (); }
- }
-
- public override bool ExplicitThis {
- get { return m_elementMethod.ExplicitThis; }
- set { throw new InvalidOperationException (); }
- }
-
- public override MethodReturnType ReturnType {
- get { return m_elementMethod.ReturnType; }
- set { throw new InvalidOperationException (); }
- }
-
- public override ParameterDefinitionCollection Parameters {
- get { return m_elementMethod.Parameters; }
- }
-
- public override GenericParameterCollection GenericParameters {
- get { return m_elementMethod.GenericParameters; }
- }
-
public int Arity {
get { return m_arguments.Count; }
}
- public GenericInstanceMethod (MethodReference elemMethod) :
base (string.Empty)
+ public GenericInstanceMethod (MethodReference elemMethod) :
base (elemMethod)
{
- m_elementMethod = elemMethod;
m_arguments = new GenericArgumentCollection (this);
}
public override string ToString ()
{
StringBuilder sb = new StringBuilder ();
- sb.Append
(m_elementMethod.ReturnType.ReturnType.FullName);
+ MethodReference meth = this.ElementMethod;
+ sb.Append (meth.ReturnType.ReturnType.FullName);
sb.Append (" ");
- sb.Append (m_elementMethod.DeclaringType.FullName);
+ sb.Append (meth.DeclaringType.FullName);
sb.Append ("::");
- sb.Append (m_elementMethod.Name);
+ sb.Append (meth.Name);
sb.Append ("<");
for (int i = 0; i < this.Arguments.Count; i++) {
if (i > 0)
@@ -99,9 +64,9 @@
}
sb.Append (">");
sb.Append ("(");
- for (int i = 0; i < m_elementMethod.Parameters.Count;
i++) {
- sb.Append (m_elementMethod.Parameters
[i].ParameterType.FullName);
- if (i < m_elementMethod.Parameters.Count - 1)
+ for (int i = 0; i < meth.Parameters.Count; i++) {
+ sb.Append (meth.Parameters
[i].ParameterType.FullName);
+ if (i < meth.Parameters.Count - 1)
sb.Append (",");
}
sb.Append (")");
Modified: trunk/cecil/lib/Mono.Cecil/GenericInstanceType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/GenericInstanceType.cs 2005-11-01 05:13:06 UTC
(rev 52439)
+++ trunk/cecil/lib/Mono.Cecil/GenericInstanceType.cs 2005-11-01 08:39:42 UTC
(rev 52440)
@@ -29,18 +29,12 @@
namespace Mono.Cecil {
- using System;
using System.Text;
- public sealed class GenericInstanceType : TypeReference,
IGenericInstanceType {
+ public sealed class GenericInstanceType : TypeSpecification,
IGenericInstanceType {
- TypeReference m_elementType;
GenericArgumentCollection m_arguments;
- public TypeReference ElementType {
- get { return m_elementType; }
- }
-
public int Arity {
get { return m_arguments.Count; }
}
@@ -49,21 +43,6 @@
get { return m_arguments; }
}
- public override string Name {
- get { return m_elementType.FullName; }
- set { throw new InvalidOperationException (); }
- }
-
- public override string Namespace {
- get { return string.Empty; }
- set { throw new InvalidOperationException (); }
- }
-
- public override bool IsValueType {
- get { return m_elementType.IsValueType; }
- set { throw new InvalidOperationException (); }
- }
-
public override string FullName {
get {
StringBuilder sb = new StringBuilder ();
@@ -79,10 +58,8 @@
}
}
- public GenericInstanceType (TypeReference elementType) :
- base (string.Empty, string.Empty)
+ public GenericInstanceType (TypeReference elementType) : base
(elementType)
{
- m_elementType = elementType;
m_arguments = new GenericArgumentCollection (this);
}
}
Modified: trunk/cecil/lib/Mono.Cecil/IArrayType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IArrayType.cs 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil/IArrayType.cs 2005-11-01 08:39:42 UTC (rev
52440)
@@ -28,9 +28,8 @@
namespace Mono.Cecil {
- public interface IArrayType : ITypeReference {
+ public interface IArrayType : ITypeSpecification {
ArrayDimensionCollection Dimensions { get; }
- TypeReference ElementType { get; set; }
int Rank { get; }
bool IsSizedArray { get; }
}
Modified: trunk/cecil/lib/Mono.Cecil/IGenericInstanceMethod.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IGenericInstanceMethod.cs 2005-11-01
05:13:06 UTC (rev 52439)
+++ trunk/cecil/lib/Mono.Cecil/IGenericInstanceMethod.cs 2005-11-01
08:39:42 UTC (rev 52440)
@@ -28,8 +28,6 @@
namespace Mono.Cecil {
- public interface IGenericInstanceMethod : IGenericInstance,
IMethodReference {
-
- MethodReference ElementMethod { get; set; }
+ public interface IGenericInstanceMethod : IMethodSpecification,
IGenericInstance {
}
}
Modified: trunk/cecil/lib/Mono.Cecil/IGenericInstanceType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IGenericInstanceType.cs 2005-11-01 05:13:06 UTC
(rev 52439)
+++ trunk/cecil/lib/Mono.Cecil/IGenericInstanceType.cs 2005-11-01 08:39:42 UTC
(rev 52440)
@@ -28,8 +28,6 @@
namespace Mono.Cecil {
- public interface IGenericInstanceType : IGenericInstance,
ITypeReference {
-
- TypeReference ElementType { get; }
+ public interface IGenericInstanceType : IGenericInstance,
ITypeSpecification {
}
}
Added: trunk/cecil/lib/Mono.Cecil/IMethodSpecification.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IMethodSpecification.cs 2005-11-01 05:13:06 UTC
(rev 52439)
+++ trunk/cecil/lib/Mono.Cecil/IMethodSpecification.cs 2005-11-01 08:39:42 UTC
(rev 52440)
@@ -0,0 +1,35 @@
+//
+// IMethodSpecification.cs
+//
+// Author:
+// Jb Evain ([EMAIL PROTECTED])
+//
+// (C) 2005 Jb Evain
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Mono.Cecil {
+
+ public interface IMethodSpecification : IMethodReference {
+
+ MethodReference ElementMethod { get; }
+ }
+}
Property changes on: trunk/cecil/lib/Mono.Cecil/IMethodSpecification.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/cecil/lib/Mono.Cecil/IModifierType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IModifierType.cs 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil/IModifierType.cs 2005-11-01 08:39:42 UTC (rev
52440)
@@ -28,8 +28,8 @@
namespace Mono.Cecil {
- public interface IModifierType : ITypeReference {
- TypeReference ElementType { get; }
+ public interface IModifierType : ITypeSpecification {
+
TypeReference ModifierType { get; }
}
}
Modified: trunk/cecil/lib/Mono.Cecil/IPinnedType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IPinnedType.cs 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil/IPinnedType.cs 2005-11-01 08:39:42 UTC (rev
52440)
@@ -28,8 +28,6 @@
namespace Mono.Cecil {
- public interface IPinnedType : ITypeReference {
-
- TypeReference ElementType { get; }
+ public interface IPinnedType : ITypeSpecification {
}
}
Modified: trunk/cecil/lib/Mono.Cecil/IPointerType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IPointerType.cs 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil/IPointerType.cs 2005-11-01 08:39:42 UTC (rev
52440)
@@ -28,8 +28,6 @@
namespace Mono.Cecil {
- public interface IPointerType : ITypeReference {
-
- TypeReference ElementType { get; }
+ public interface IPointerType : ITypeSpecification {
}
}
Modified: trunk/cecil/lib/Mono.Cecil/IReferenceType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IReferenceType.cs 2005-11-01 05:13:06 UTC
(rev 52439)
+++ trunk/cecil/lib/Mono.Cecil/IReferenceType.cs 2005-11-01 08:39:42 UTC
(rev 52440)
@@ -28,8 +28,6 @@
namespace Mono.Cecil {
- public interface IReferenceType : ITypeReference {
-
- TypeReference ElementType { get; }
+ public interface IReferenceType : ITypeSpecification {
}
}
Added: trunk/cecil/lib/Mono.Cecil/ITypeSpecification.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/ITypeSpecification.cs 2005-11-01 05:13:06 UTC
(rev 52439)
+++ trunk/cecil/lib/Mono.Cecil/ITypeSpecification.cs 2005-11-01 08:39:42 UTC
(rev 52440)
@@ -0,0 +1,35 @@
+//
+// ITypeSpecification.cs
+//
+// Author:
+// Jb Evain ([EMAIL PROTECTED])
+//
+// (C) 2005 Jb Evain
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Mono.Cecil {
+
+ public interface ITypeSpecification : ITypeReference {
+
+ TypeReference ElementType { get; }
+ }
+}
Property changes on: trunk/cecil/lib/Mono.Cecil/ITypeSpecification.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/cecil/lib/Mono.Cecil/MethodSpecification.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/MethodSpecification.cs 2005-11-01 05:13:06 UTC
(rev 52439)
+++ trunk/cecil/lib/Mono.Cecil/MethodSpecification.cs 2005-11-01 08:39:42 UTC
(rev 52440)
@@ -0,0 +1,75 @@
+//
+// MethodSpecification.cs
+//
+// Author:
+// Jb Evain ([EMAIL PROTECTED])
+//
+// (C) 2005 Jb Evain
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Mono.Cecil {
+
+ using System;
+
+ public abstract class MethodSpecification : MethodReference,
IMethodSpecification {
+
+ MethodReference m_elementMethod;
+
+ public MethodReference ElementMethod {
+ get { return m_elementMethod; }
+ set { m_elementMethod = value; }
+ }
+
+ public override MethodCallingConvention CallingConvention {
+ get { return m_elementMethod.CallingConvention; }
+ set { throw new InvalidOperationException (); }
+ }
+
+ public override bool HasThis {
+ get { return m_elementMethod.HasThis; }
+ set { throw new InvalidOperationException (); }
+ }
+
+ public override bool ExplicitThis {
+ get { return m_elementMethod.ExplicitThis; }
+ set { throw new InvalidOperationException (); }
+ }
+
+ public override MethodReturnType ReturnType {
+ get { return m_elementMethod.ReturnType; }
+ set { throw new InvalidOperationException (); }
+ }
+
+ public override ParameterDefinitionCollection Parameters {
+ get { return m_elementMethod.Parameters; }
+ }
+
+ public override GenericParameterCollection GenericParameters {
+ get { return m_elementMethod.GenericParameters; }
+ }
+
+ internal MethodSpecification (MethodReference elemMethod) :
base (string.Empty)
+ {
+ m_elementMethod = elemMethod;
+ }
+ }
+}
Property changes on: trunk/cecil/lib/Mono.Cecil/MethodSpecification.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/cecil/lib/Mono.Cecil/Modifiers.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/Modifiers.cs 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil/Modifiers.cs 2005-11-01 08:39:42 UTC (rev
52440)
@@ -28,44 +28,17 @@
namespace Mono.Cecil {
- using Mono.Cecil;
+ public abstract class ModType : TypeSpecification, IModifierType {
- public abstract class ModType : TypeReference, IModifierType {
-
- TypeReference m_elementType;
TypeReference m_modifierType;
- public override string Name {
- get { return m_elementType.Name; }
- set { m_elementType.Name = value; }
- }
-
- public override string Namespace {
- get { return m_elementType.Namespace; }
- set { m_elementType.Namespace = value; }
- }
-
- public override IMetadataScope Scope {
- get { return m_elementType.Scope; }
- }
-
- public TypeReference ElementType {
- get { return m_elementType; }
- set { m_elementType = value; }
- }
-
public TypeReference ModifierType {
get { return m_modifierType; }
set { m_modifierType = value; }
}
- public override string FullName {
- get { return m_elementType.FullName; }
- }
-
- public ModType (TypeReference elemType, TypeReference modType)
: base (string.Empty, string.Empty)
+ public ModType (TypeReference elemType, TypeReference modType)
: base (elemType)
{
- m_elementType = elemType;
m_modifierType = modType;
}
}
Modified: trunk/cecil/lib/Mono.Cecil/PinnedType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/PinnedType.cs 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil/PinnedType.cs 2005-11-01 08:39:42 UTC (rev
52440)
@@ -28,36 +28,10 @@
namespace Mono.Cecil {
- public sealed class PinnedType : TypeReference, IPinnedType {
+ public sealed class PinnedType : TypeSpecification, IPinnedType {
- TypeReference m_pinnedType;
-
- public override string Name {
- get { return m_pinnedType.Name; }
- set { m_pinnedType.Name = value; }
- }
-
- public override string Namespace {
- get { return m_pinnedType.Namespace; }
- set { m_pinnedType.Namespace = value; }
- }
-
- public override IMetadataScope Scope {
- get { return m_pinnedType.Scope; }
- }
-
- public TypeReference ElementType {
- get { return m_pinnedType; }
- set { m_pinnedType = value; }
- }
-
- public override string FullName {
- get { return m_pinnedType.FullName; }
- }
-
- public PinnedType (TypeReference pType) : base (string.Empty,
string.Empty)
+ public PinnedType (TypeReference pType) : base (pType)
{
- m_pinnedType = pType;
}
}
}
Modified: trunk/cecil/lib/Mono.Cecil/PointerType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/PointerType.cs 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil/PointerType.cs 2005-11-01 08:39:42 UTC (rev
52440)
@@ -28,36 +28,14 @@
namespace Mono.Cecil {
- public sealed class PointerType : TypeReference, IPointerType {
+ public sealed class PointerType : TypeSpecification, IPointerType {
- private TypeReference m_pointedType;
-
- public override string Name {
- get { return m_pointedType.Name; }
- set { m_pointedType.Name = value; }
- }
-
- public override string Namespace {
- get { return m_pointedType.Namespace; }
- set { m_pointedType.Namespace = value; }
- }
-
- public override IMetadataScope Scope {
- get { return m_pointedType.Scope; }
- }
-
- public TypeReference ElementType {
- get { return m_pointedType; }
- set { m_pointedType = value; }
- }
-
public override string FullName {
- get { return string.Concat (m_pointedType.FullName,
"*"); }
+ get { return string.Concat (this.ElementType.FullName,
"*"); }
}
- public PointerType (TypeReference pType) : base (string.Empty,
string.Empty)
+ public PointerType (TypeReference pType) : base (pType)
{
- m_pointedType = pType;
}
}
}
Modified: trunk/cecil/lib/Mono.Cecil/ReferenceType.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/ReferenceType.cs 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil/ReferenceType.cs 2005-11-01 08:39:42 UTC (rev
52440)
@@ -28,36 +28,14 @@
namespace Mono.Cecil {
- public sealed class ReferenceType : TypeReference, IReferenceType {
+ public sealed class ReferenceType : TypeSpecification, IReferenceType {
- private TypeReference m_type;
-
- public override string Name {
- get { return m_type.Name; }
- set { m_type.Name = value; }
- }
-
- public override string Namespace {
- get { return m_type.Namespace; }
- set { m_type.Namespace = value; }
- }
-
- public override IMetadataScope Scope {
- get { return m_type.Scope; }
- }
-
- public TypeReference ElementType {
- get { return m_type; }
- set { m_type = value; }
- }
-
public override string FullName {
- get { return string.Concat (m_type.FullName, "&"); }
+ get { return string.Concat (this.ElementType.FullName,
"&"); }
}
- public ReferenceType (TypeReference type) : base (string.Empty,
string.Empty)
+ public ReferenceType (TypeReference type) : base (type)
{
- m_type = type;
}
}
}
Added: trunk/cecil/lib/Mono.Cecil/TypeSpecification.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/TypeSpecification.cs 2005-11-01 05:13:06 UTC
(rev 52439)
+++ trunk/cecil/lib/Mono.Cecil/TypeSpecification.cs 2005-11-01 08:39:42 UTC
(rev 52440)
@@ -0,0 +1,70 @@
+//
+// TypeSpecification.cs
+//
+// Author:
+// Jb Evain ([EMAIL PROTECTED])
+//
+// (C) 2005 Jb Evain
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Mono.Cecil {
+
+ using System;
+
+ public abstract class TypeSpecification : TypeReference,
ITypeSpecification {
+
+ private TypeReference m_elementType;
+
+ public override string Name {
+ get { return m_elementType.Name; }
+ set { throw new NotSupportedException (); }
+ }
+
+ public override string Namespace {
+ get { return m_elementType.Namespace; }
+ set { throw new NotSupportedException (); }
+ }
+
+ public override bool IsValueType {
+ get { return m_elementType.IsValueType; }
+ set { throw new InvalidOperationException (); }
+ }
+
+ public override IMetadataScope Scope {
+ get { return m_elementType.Scope; }
+ }
+
+ public TypeReference ElementType {
+ get { return m_elementType; }
+ set { m_elementType = value; }
+ }
+
+ public override string FullName {
+ get { return m_elementType.FullName; }
+ }
+
+ internal TypeSpecification (TypeReference elementType) : base
(string.Empty, string.Empty)
+ {
+ m_elementType = elementType;
+ }
+ }
+}
Property changes on: trunk/cecil/lib/Mono.Cecil/TypeSpecification.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/cecil/lib/Mono.Cecil.dll.sources
===================================================================
--- trunk/cecil/lib/Mono.Cecil.dll.sources 2005-11-01 05:13:06 UTC (rev
52439)
+++ trunk/cecil/lib/Mono.Cecil.dll.sources 2005-11-01 08:39:42 UTC (rev
52440)
@@ -79,6 +79,7 @@
./Mono.Cecil/IMethodDefinitionCollection.cs
./Mono.Cecil/IMethodReturnType.cs
./Mono.Cecil/IMethodSignature.cs
+./Mono.Cecil/IMethodSpecification.cs
./Mono.Cecil/IModifierOptional.cs
./Mono.Cecil/IModifierRequired.cs
./Mono.Cecil/IModifierType.cs
@@ -110,6 +111,7 @@
./Mono.Cecil/ITypeDefinitionCollection.cs
./Mono.Cecil/ITypeReference.cs
./Mono.Cecil/ITypeReferenceCollection.cs
+./Mono.Cecil/ITypeSpecification.cs
./Mono.Cecil/LinkedResource.cs
./Mono.Cecil/ManifestResourceAttributes.cs
./Mono.Cecil/MarshalDesc.cs
@@ -123,6 +125,7 @@
./Mono.Cecil/MethodReference.cs
./Mono.Cecil/MethodReturnType.cs
./Mono.Cecil/MethodSemanticsAttributes.cs
+./Mono.Cecil/MethodSpecification.cs
./Mono.Cecil/Modifiers.cs
./Mono.Cecil/ModuleDefinition.cs
./Mono.Cecil/ModuleDefinitionCollection.cs
@@ -162,6 +165,7 @@
./Mono.Cecil/TypeDefinitionCollection.cs
./Mono.Cecil/TypeReference.cs
./Mono.Cecil/TypeReferenceCollection.cs
+./Mono.Cecil/TypeSpecification.cs
./Mono.Cecil/VariantType.cs
./Mono.Cecil.Binary/BaseImageVisitor.cs
./Mono.Cecil.Binary/CLIHeader.cs
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches