|
|
@ -418,7 +418,7 @@ namespace CppSharp.Generators.CSharp |
|
|
|
PushBlock(CSharpBlockKind.Method); |
|
|
|
PushBlock(CSharpBlockKind.Method); |
|
|
|
GenerateDeclarationCommon(method); |
|
|
|
GenerateDeclarationCommon(method); |
|
|
|
|
|
|
|
|
|
|
|
var functionName = GetFunctionIdentifier(method); |
|
|
|
var functionName = GetMethodIdentifier(method); |
|
|
|
|
|
|
|
|
|
|
|
Write("{0} {1}(", method.OriginalReturnType, functionName); |
|
|
|
Write("{0} {1}(", method.OriginalReturnType, functionName); |
|
|
|
|
|
|
|
|
|
|
@ -1778,7 +1778,7 @@ namespace CppSharp.Generators.CSharp |
|
|
|
if (Driver.Options.GenerateAbstractImpls && method.IsPure) |
|
|
|
if (Driver.Options.GenerateAbstractImpls && method.IsPure) |
|
|
|
Write("abstract "); |
|
|
|
Write("abstract "); |
|
|
|
|
|
|
|
|
|
|
|
var functionName = GetFunctionIdentifier(method); |
|
|
|
var functionName = GetMethodIdentifier(method); |
|
|
|
|
|
|
|
|
|
|
|
if (method.IsConstructor || method.IsDestructor) |
|
|
|
if (method.IsConstructor || method.IsDestructor) |
|
|
|
Write("{0}(", functionName); |
|
|
|
Write("{0}(", functionName); |
|
|
@ -2330,17 +2330,20 @@ namespace CppSharp.Generators.CSharp |
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static string GetFunctionIdentifier(Function function) |
|
|
|
public static string GetMethodIdentifier(Method method) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var identifier = SafeIdentifier(function.Name); |
|
|
|
if (method.IsConstructor || method.IsDestructor) |
|
|
|
|
|
|
|
return method.Namespace.Name; |
|
|
|
|
|
|
|
|
|
|
|
var method = function as Method; |
|
|
|
return GetFunctionIdentifier(method); |
|
|
|
if (method == null || !method.IsOperator) |
|
|
|
} |
|
|
|
return identifier; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
identifier = Operators.GetOperatorIdentifier(method.OperatorKind); |
|
|
|
public static string GetFunctionIdentifier(Function function) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (function.IsOperator) |
|
|
|
|
|
|
|
return Operators.GetOperatorIdentifier(function.OperatorKind); |
|
|
|
|
|
|
|
|
|
|
|
return identifier; |
|
|
|
return SafeIdentifier(function.Name); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static string GetFunctionNativeIdentifier(Function function) |
|
|
|
public static string GetFunctionNativeIdentifier(Function function) |
|
|
|