Files
BlenderSharp/CodeGenerator/StrExt.cs
Samuele Lorefice 9a949dbeab Added Type stubbing
2025-01-22 17:56:49 +01:00

26 lines
1.1 KiB
C#

namespace CodeGenerator {
public static class StrExt {
public static string ParseFName(this string str) {
str = str.Replace("*", "ptr_");
return str;
}
public static string ParseFType(this string str) {
return str switch {
"char" => typeof(char).AssemblyQualifiedName,
"short" => typeof(short).AssemblyQualifiedName,
"int" => typeof(int).AssemblyQualifiedName,
"float" => typeof(float).AssemblyQualifiedName,
"double" => typeof(double).AssemblyQualifiedName,
"string" => typeof(string).AssemblyQualifiedName,
"void" => typeof(object).AssemblyQualifiedName,
"ushort" => typeof(ushort).AssemblyQualifiedName,
"uchar" => typeof(byte).AssemblyQualifiedName,
"int64_t" => typeof(long).AssemblyQualifiedName,
"int8_t" => typeof(sbyte).AssemblyQualifiedName,
"uint64_t" => typeof(ulong).AssemblyQualifiedName,
_ => str
};
}
}
}