|
|
|
@ -243,14 +243,25 @@ namespace Cxxi.Generators.CLI |
|
|
|
public void GenerateClassMethods(Class @class) |
|
|
|
public void GenerateClassMethods(Class @class) |
|
|
|
{ |
|
|
|
{ |
|
|
|
PushIndent(); |
|
|
|
PushIndent(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var staticMethods = new List<Method>(); |
|
|
|
foreach (var method in @class.Methods) |
|
|
|
foreach (var method in @class.Methods) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (CheckIgnoreMethod(@class, method)) |
|
|
|
if (CheckIgnoreMethod(@class, method)) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
GenerateDeclarationCommon(method); |
|
|
|
if (method.IsStatic) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
staticMethods.Add(method); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GenerateMethod(method); |
|
|
|
GenerateMethod(method); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach(var method in staticMethods) |
|
|
|
|
|
|
|
GenerateMethod(method); |
|
|
|
|
|
|
|
|
|
|
|
PopIndent(); |
|
|
|
PopIndent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -309,6 +320,9 @@ namespace Cxxi.Generators.CLI |
|
|
|
|
|
|
|
|
|
|
|
GenerateDeclarationCommon(method); |
|
|
|
GenerateDeclarationCommon(method); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (method.IsStatic) |
|
|
|
|
|
|
|
Write("static "); |
|
|
|
|
|
|
|
|
|
|
|
if (method.Kind == CXXMethodKind.Constructor || method.Kind == CXXMethodKind.Destructor) |
|
|
|
if (method.Kind == CXXMethodKind.Constructor || method.Kind == CXXMethodKind.Destructor) |
|
|
|
Write("{0}(", SafeIdentifier(method.Name)); |
|
|
|
Write("{0}(", SafeIdentifier(method.Name)); |
|
|
|
else |
|
|
|
else |
|
|
|
@ -351,7 +365,8 @@ namespace Cxxi.Generators.CLI |
|
|
|
if (function.Ignore) return; |
|
|
|
if (function.Ignore) return; |
|
|
|
GenerateDeclarationCommon(function); |
|
|
|
GenerateDeclarationCommon(function); |
|
|
|
|
|
|
|
|
|
|
|
Write("static {0} {1}(", function.ReturnType, SafeIdentifier(function.Name)); |
|
|
|
var retType = function.ReturnType.ToString(); |
|
|
|
|
|
|
|
Write("static {0} {1}(", retType, SafeIdentifier(function.Name)); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < function.Parameters.Count; ++i) |
|
|
|
for (int i = 0; i < function.Parameters.Count; ++i) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|