Cosmos/source/Indy.IL2CPU.Assembler/DataMember.cs
2007-09-22 09:44:20 +00:00

30 lines
884 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mono.Cecil;
namespace Indy.IL2CPU.Assembler {
public class DataMember {
public static string GetStaticFieldName(FieldDefinition aField) {
string xTempResult = "static_field__" + aField.DeclaringType.FullName + "_" + aField.Name;
foreach(char c in new char[] {'.', ',', '+', '$', '<', '>', '{', '}', '-'}) {
xTempResult = xTempResult.Replace(c, '_');
}
return xTempResult;
}
public DataMember(string aName, string aDataType, string aDefaultValue) {
Name = aName;
DataType = aDataType;
DefaultValue = aDefaultValue;
}
public readonly string Name;
public readonly string DataType;
public readonly string DefaultValue;
public override string ToString() {
return Name + " " + DataType + " " + DefaultValue;
}
}
}