mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 04:48:53 +00:00
30 lines
884 B
C#
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;
|
|
}
|
|
}
|
|
}
|