Added count field type argument to the list attribute
This commit is contained in:
@@ -26,5 +26,22 @@ namespace CodeGenerator {
|
||||
_ => str
|
||||
};
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int ParseFSize(this string str) {
|
||||
return str switch {
|
||||
"char" => sizeof(char),
|
||||
"short" => sizeof(short),
|
||||
"int" => sizeof(int),
|
||||
"float" => sizeof(float),
|
||||
"double" => sizeof(double),
|
||||
"ushort" => sizeof(ushort),
|
||||
"uchar" => sizeof(byte),
|
||||
"int64_t" => sizeof(long),
|
||||
"int8_t" => sizeof(sbyte),
|
||||
"uint64_t" => sizeof(ulong),
|
||||
_ => throw new("Unknown type")
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user