Add MethodInfo/ParameterInfo GetSignatureString()
This commit is contained in:
@@ -30,5 +30,8 @@ namespace Il2CppInspector.Reflection
|
|||||||
|
|
||||||
// TODO: Generic arguments (and on ConstructorInfo)
|
// TODO: Generic arguments (and on ConstructorInfo)
|
||||||
public override string ToString() => ReturnType.Name + " " + Name + "(" + string.Join(", ", DeclaredParameters.Select(x => x.ParameterType.Name)) + ")";
|
public override string ToString() => ReturnType.Name + " " + Name + "(" + string.Join(", ", DeclaredParameters.Select(x => x.ParameterType.Name)) + ")";
|
||||||
|
|
||||||
|
public string GetSignatureString() => ReturnParameter.GetSignatureString() + " " + Name + GetTypeParametersString()
|
||||||
|
+ "(" + string.Join(",", DeclaredParameters.Select(x => x.GetSignatureString())) + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,12 +92,14 @@ namespace Il2CppInspector.Reflection
|
|||||||
+ (IsByRef? "ref " : "")
|
+ (IsByRef? "ref " : "")
|
||||||
+ (IsOut? "out " : "");
|
+ (IsOut? "out " : "");
|
||||||
|
|
||||||
|
private string getCSharpSignatureString() => $"{GetModifierString()}{ParameterType.CSharpName}";
|
||||||
|
public string GetSignatureString() => $"{GetModifierString()}{ParameterType.FullName}";
|
||||||
|
|
||||||
public string GetParameterString() => IsRetval? null :
|
public string GetParameterString() => IsRetval? null :
|
||||||
$"{CustomAttributes.ToString(inline: true).Replace("[ParamArray]", "params")}"
|
$"{CustomAttributes.ToString(inline: true).Replace("[ParamArray]", "params")}"
|
||||||
+ $"{GetModifierString()}{ParameterType.CSharpName} {Name}"
|
+ $"{getCSharpSignatureString()} {Name}"
|
||||||
+ (HasDefaultValue ? " = " + DefaultValue.ToCSharpValue() : "");
|
+ (HasDefaultValue ? " = " + DefaultValue.ToCSharpValue() : "");
|
||||||
|
|
||||||
public string GetReturnParameterString() => !IsRetval? null :
|
public string GetReturnParameterString() => !IsRetval? null : getCSharpSignatureString();
|
||||||
$"{GetModifierString()}{ParameterType.CSharpName}";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user