public string GetTypeName() { if (IsBasicType || IsFunctionType) { return(RawTypeName + String.Join("", ArrayDimensions.Select(d => "[" + d + "]")) + new string('*', PtrIndirectionLevel)); } else if (IsVoidType) { return("void"); } else { throw new Exception("Unknown cleps type category"); } }
// Returns the TypeName and the generic/inner type information if existing public string ToCompleteTypeName(char innerTypeSeparator = '.') { var result = TypeName; if (GenericTypeArguments != null) { result += FormatGenericArgs(GenericTypeArguments); } if (NestedType != null) { result += innerTypeSeparator + NestedType.ToCompleteTypeName(); } if (ArrayDimensions != null && ArrayDimensions.Count > 0) { result += ArrayDimensions.Select(dim => "[" + new string (',', dim - 1) + "]").Aggregate(string.Concat); } return(result); }
public override string ToString() { return(string.Format("({8}) {0}::{1}{2}{3}{7} {4}{5}{6} {9} {10}", Namespace, TypeName, FormatGenericArgsFull(GenericTypeArguments), NestedType != null ? "+" + NestedType.ToString() : string.Empty, MemberName ?? string.Empty, FormatGenericArgsFull(GenericMemberArguments), MemberArguments != null ? "(" + string.Join(",", MemberArguments.Select(m => m.ToString())) + ")" : string.Empty, ArrayDimensions != null && ArrayDimensions.Count > 0 ? ArrayDimensions.Select(dim => "[" + new string (',', dim - 1) + "]").Aggregate(string.Concat) : string.Empty, DescKind.ToString()[0], Etc != 0 ? '(' + Etc.ToString() + ')' : string.Empty, ExplicitImplMember != null ? "$" + ExplicitImplMember.ToString() : string.Empty)); }