static string PSTypeCppName(Type type) { if (type.IsEnum) { return(CppUtil.EnumModuleName(type.Name)); } else if (MetaTypes.PSTypeSet.Contains(type)) { return(TypeCppName(type)); } return(CppUtil.CppStyleName(type.Name)); }
public static string GetTypeFileName(Type type) { if (type.IsEnum) { return(CppUtil.CppStyleName(type.Name)); } else if (MetaTypes.PSTypeSet.Contains(type)) { return(TypePBName(type.Name)); } else if (type.IsGenericType && type.IsGenericTypeDefinition == false) { if (MetaTypes.PSGenericTypeTypeSet.Contains(type.GetGenericTypeDefinition())) { return(GetTypeFileName(type.GetGenericArguments().First())); } throw new System.Exception("无法识别的类型"); } else { return(CppUtil.CppStyleName(type.Name)); } }