Browse Source

Resolved ambiguity of System.Type and CppSharp.AST.Type

pull/13/head
marcos henrich 12 years ago
parent
commit
e168e84d6a
  1. 3
      src/Generator/Generators/CLI/CLITypePrinter.cs
  2. 2
      src/Generator/Generators/CSharp/CSharpGenerator.cs
  3. 3
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  4. 3
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs

3
src/Generator/Generators/CLI/CLITypePrinter.cs

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using CppSharp.AST; using CppSharp.AST;
using CppSharp.Types; using CppSharp.Types;
using Type = CppSharp.AST.Type;
namespace CppSharp.Generators.CLI namespace CppSharp.Generators.CLI
{ {
@ -340,7 +341,7 @@ namespace CppSharp.Generators.CLI
throw new NotImplementedException(); throw new NotImplementedException();
} }
public string ToString(AST.Type type) public string ToString(Type type)
{ {
return type.Visit(this); return type.Visit(this);
} }

2
src/Generator/Generators/CSharp/CSharpGenerator.cs

@ -13,7 +13,7 @@ namespace CppSharp.Generators.CSharp
public CSharpGenerator(Driver driver) : base(driver) public CSharpGenerator(Driver driver) : base(driver)
{ {
typePrinter = new CSharpTypePrinter(driver.TypeDatabase, driver.Library); typePrinter = new CSharpTypePrinter(driver.TypeDatabase, driver.Library);
AST.Type.TypePrinterDelegate += type => type.Visit(typePrinter).Type; CppSharp.AST.Type.TypePrinterDelegate += type => type.Visit(typePrinter).Type;
} }
public override List<Template> Generate(TranslationUnit unit) public override List<Template> Generate(TranslationUnit unit)

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

@ -4,6 +4,7 @@ using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using CppSharp.AST; using CppSharp.AST;
using Type = CppSharp.AST.Type;
namespace CppSharp.Generators.CSharp namespace CppSharp.Generators.CSharp
{ {
@ -845,7 +846,7 @@ namespace CppSharp.Generators.CSharp
} }
} }
private void GenerateVariable(Class @class, AST.Type type, Variable variable) private void GenerateVariable(Class @class, Type type, Variable variable)
{ {
PushBlock(CSharpBlockKind.Variable); PushBlock(CSharpBlockKind.Variable);
WriteLine("public static {0} {1}", type, variable.Name); WriteLine("public static {0} {1}", type, variable.Name);

3
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using CppSharp.AST; using CppSharp.AST;
using CppSharp.Types; using CppSharp.Types;
using Type = CppSharp.AST.Type;
namespace CppSharp.Generators.CSharp namespace CppSharp.Generators.CSharp
{ {
@ -463,7 +464,7 @@ namespace CppSharp.Generators.CSharp
VisitParameters(function.Parameters, hasNames: true)); VisitParameters(function.Parameters, hasNames: true));
} }
public string ToString(AST.Type type) public string ToString(Type type)
{ {
return type.Visit(this).Type; return type.Visit(this).Type;
} }

Loading…
Cancel
Save