private static string GetCsTypeName(CppPointerType pointerType) { if (pointerType.ElementType is CppQualifiedType qualifiedType) { if (qualifiedType.ElementType is CppPrimitiveType primitiveType) { return(GetCsTypeName(primitiveType, true)); } else if (qualifiedType.ElementType is CppClass @classType) { return(GetCsTypeName(@classType, true)); } else if (qualifiedType.ElementType is CppPointerType subPointerType) { return(GetCsTypeName(subPointerType, true) + "*"); } else if (qualifiedType.ElementType is CppTypedef typedef) { return(GetCsTypeName(typedef, true)); } else if (qualifiedType.ElementType is CppEnum @enum) { return(GetCsTypeName(@enum, true)); } return(GetCsTypeName(qualifiedType.ElementType, true)); } return(GetCsTypeName(pointerType.ElementType, true)); }
public CppTypeVisitorResult Visit(CppPointerType t, Qualifiers q) { // has inner type this.TypeBuilder.Append($"Pointer"); this.DbgBuilder.Append(t.DbgDescription + " "); this.QualifierBuilder.Append(q.ToString("g") + " "); t.InnerType.Accept(this); return(null); }