Browse Source

Fix the build.

pull/13/merge
triton 13 years ago
parent
commit
0a7656e257
  1. 2
      src/Generator/AST/Utils.cs
  2. 6
      src/Generator/Generators/CLI/CLIHeadersTemplate.cs
  3. 8
      src/Generator/Generators/CLI/CLISourcesTemplate.cs
  4. 14
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  5. 5
      src/Generator/Passes/CheckAmbiguousOverloads.cs

2
src/Generator/AST/Utils.cs

@ -1,7 +1,7 @@
 
namespace CppSharp.AST namespace CppSharp.AST
{ {
public static class Utils public static class ASTUtils
{ {
public static bool CheckIgnoreFunction(Class @class, Function function) public static bool CheckIgnoreFunction(Class @class, Function function)
{ {

6
src/Generator/Generators/CLI/CLIHeadersTemplate.cs

@ -364,7 +364,7 @@ namespace CppSharp.Generators.CLI
PushIndent(); PushIndent();
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (Utils.CheckIgnoreField(@class, field)) continue; if (ASTUtils.CheckIgnoreField(@class, field)) continue;
GenerateDeclarationCommon(field); GenerateDeclarationCommon(field);
if (@class.IsUnion) if (@class.IsUnion)
@ -421,7 +421,7 @@ namespace CppSharp.Generators.CLI
var staticMethods = new List<Method>(); var staticMethods = new List<Method>();
foreach (var method in @class.Methods) foreach (var method in @class.Methods)
{ {
if (Utils.CheckIgnoreMethod(@class, method)) if (ASTUtils.CheckIgnoreMethod(@class, method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -499,7 +499,7 @@ namespace CppSharp.Generators.CLI
PushIndent(); PushIndent();
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (Utils.CheckIgnoreField(@class, field)) if (ASTUtils.CheckIgnoreField(@class, field))
continue; continue;
GenerateDeclarationCommon(field); GenerateDeclarationCommon(field);

8
src/Generator/Generators/CLI/CLISourcesTemplate.cs

@ -143,7 +143,7 @@ namespace CppSharp.Generators.CLI
foreach (var method in @class.Methods) foreach (var method in @class.Methods)
{ {
if (Utils.CheckIgnoreMethod(@class, method)) if (ASTUtils.CheckIgnoreMethod(@class, method))
continue; continue;
GenerateDeclarationCommon(method); GenerateDeclarationCommon(method);
@ -156,7 +156,7 @@ namespace CppSharp.Generators.CLI
{ {
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (Utils.CheckIgnoreField(@class, field)) if (ASTUtils.CheckIgnoreField(@class, field))
continue; continue;
GenerateFieldProperty(field); GenerateFieldProperty(field);
@ -482,7 +482,7 @@ namespace CppSharp.Generators.CLI
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (Utils.CheckIgnoreField(@class, field)) continue; if (ASTUtils.CheckIgnoreField(@class, field)) continue;
var nativeField = string.Format("{0}{1}", var nativeField = string.Format("{0}{1}",
nativeVar, field.OriginalName); nativeVar, field.OriginalName);
@ -612,7 +612,7 @@ namespace CppSharp.Generators.CLI
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (Utils.CheckIgnoreField(@class, field)) continue; if (ASTUtils.CheckIgnoreField(@class, field)) continue;
var varName = string.Format("_native.{0}", field.OriginalName); var varName = string.Format("_native.{0}", field.OriginalName);

14
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -346,7 +346,7 @@ namespace CppSharp.Generators.CSharp
foreach (var method in @class.Methods) foreach (var method in @class.Methods)
{ {
if (Utils.CheckIgnoreMethod(@class, method)) if (ASTUtils.CheckIgnoreMethod(@class, method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -404,7 +404,7 @@ namespace CppSharp.Generators.CSharp
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (Utils.CheckIgnoreField(@class, field)) continue; if (ASTUtils.CheckIgnoreField(@class, field)) continue;
var nativeField = string.Format("{0}->{1}", var nativeField = string.Format("{0}->{1}",
Helpers.GeneratedIdentifier("ptr"), field.OriginalName); Helpers.GeneratedIdentifier("ptr"), field.OriginalName);
@ -554,7 +554,7 @@ namespace CppSharp.Generators.CSharp
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (Utils.CheckIgnoreField(@class, field)) continue; if (ASTUtils.CheckIgnoreField(@class, field)) continue;
NewLineIfNeeded(); NewLineIfNeeded();
@ -751,7 +751,7 @@ namespace CppSharp.Generators.CSharp
var staticMethods = new List<Method>(); var staticMethods = new List<Method>();
foreach (var method in @class.Methods) foreach (var method in @class.Methods)
{ {
if (Utils.CheckIgnoreMethod(@class, method)) if (ASTUtils.CheckIgnoreMethod(@class, method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -842,7 +842,7 @@ namespace CppSharp.Generators.CSharp
var args = TypePrinter.VisitParameters(@event.Parameters, hasNames: true); var args = TypePrinter.VisitParameters(@event.Parameters, hasNames: true);
TypePrinter.PopContext(); TypePrinter.PopContext();
delegateInstance = Helpers.GeneratedIdentifier(@event.Name); delegateInstance = Helpers.GeneratedIdentifier(@event.OriginalName);
delegateName = delegateInstance + "Delegate"; delegateName = delegateInstance + "Delegate";
delegateRaise = delegateInstance + "RaiseInstance"; delegateRaise = delegateInstance + "RaiseInstance";
@ -949,7 +949,7 @@ namespace CppSharp.Generators.CSharp
foreach (var ctor in @class.Constructors) foreach (var ctor in @class.Constructors)
{ {
if (Utils.CheckIgnoreMethod(@class, ctor)) if (ASTUtils.CheckIgnoreMethod(@class, ctor))
continue; continue;
NewLineIfNeeded(); NewLineIfNeeded();
@ -1759,7 +1759,7 @@ namespace CppSharp.Generators.CSharp
retType = "System.IntPtr"; retType = "System.IntPtr";
} }
for(var i = 0; i < function.Parameters.Count; ++i) for (var i = 0; i < function.Parameters.Count; ++i)
{ {
var param = function.Parameters[i]; var param = function.Parameters[i];

5
src/Generator/Passes/CheckAmbiguousOverloads.cs

@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using CppSharp.AST;
using CppSharp.Generators; using CppSharp.Generators;
namespace CppSharp.Passes namespace CppSharp.Passes
@ -30,10 +31,10 @@ namespace CppSharp.Passes
if (overload1.Function == overload2.Function) if (overload1.Function == overload2.Function)
return false; return false;
if (AST.Utils.CheckIgnoreFunction(@class, overload1.Function)) if (ASTUtils.CheckIgnoreFunction(@class, overload1.Function))
return false; return false;
if (AST.Utils.CheckIgnoreFunction(@class, overload2.Function)) if (ASTUtils.CheckIgnoreFunction(@class, overload2.Function))
return false; return false;
// TODO: Default parameters? // TODO: Default parameters?

Loading…
Cancel
Save