Browse Source

Fixed the parser generator to also ignore any functions with std parameters.

pull/224/head
triton 12 years ago
parent
commit
f53e8794dd
  1. 27
      src/CppParser/Bindings/ParserGen.cs

27
src/CppParser/Bindings/ParserGen.cs

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using CppSharp.AST;
using CppSharp.Generators;
using CppSharp.Passes;
@ -147,14 +148,32 @@ namespace CppSharp @@ -147,14 +148,32 @@ namespace CppSharp
if (field.Ignore)
return false;
var typePrinter = new CppTypePrinter(Driver.TypeDatabase);
var typeName = field.QualifiedType.Visit(typePrinter);
if (!IsStdType(field.QualifiedType)) return false;
field.ExplicityIgnored = true;
return true;
}
if (!typeName.Contains("std::"))
public override bool VisitFunctionDecl(Function function)
{
if (function.Ignore)
return false;
field.ExplicityIgnored = true;
if (function.Parameters.Any(param => IsStdType(param.QualifiedType)))
{
function.ExplicityIgnored = true;
return false;
}
return true;
}
private bool IsStdType(QualifiedType type)
{
var typePrinter = new CppTypePrinter(Driver.TypeDatabase);
var typeName = type.Visit(typePrinter);
return typeName.Contains("std::");
}
}
}

Loading…
Cancel
Save