mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
22 lines
No EOL
669 B
C#
22 lines
No EOL
669 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Mono.Cecil;
|
|
|
|
namespace Indy.IL2CPU.IL {
|
|
public class Utilities {
|
|
public static string GetUniqueConstName(FieldDefinition aField) {
|
|
StringBuilder xSB = new StringBuilder();
|
|
xSB.Append("const ");
|
|
xSB.Append(aField.FieldType.FullName);
|
|
xSB.Append(" ");
|
|
xSB.Append(aField.Name);
|
|
return FixupIdentifierForAsm(xSB.ToString());
|
|
}
|
|
|
|
public static string FixupIdentifierForAsm(string aIdentifier) {
|
|
return aIdentifier.Replace('.', '_').Replace('+', '_').Replace('*', '_').Replace('[', '_').Replace(']', '_').Replace('&', '_');
|
|
}
|
|
}
|
|
} |