Browse Source

Fixed the IgnoreHeadersWithName helper to be more robust by checking for patterns against the file path and include paths.

pull/1/head
triton 12 years ago
parent
commit
aed949e4dd
  1. 18
      src/Generator/Library.cs

18
src/Generator/Library.cs

@ -3,7 +3,6 @@ using System.Collections.Generic; @@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using CppSharp.Generators;
namespace CppSharp
{
@ -310,14 +309,19 @@ namespace CppSharp @@ -310,14 +309,19 @@ namespace CppSharp
public static void IgnoreHeadersWithName(this Library library, string pattern)
{
var modules = library.TranslationUnits.FindAll(
m => Regex.Match(m.FilePath, pattern).Success);
var units = library.TranslationUnits.FindAll(m =>
{
var hasMatch = Regex.Match(m.FilePath, pattern).Success;
if (m.IncludePath != null)
hasMatch |= Regex.Match(m.IncludePath, pattern).Success;
return hasMatch;
});
foreach (var module in modules)
foreach (var unit in units)
{
module.IsGenerated = false;
module.IsProcessed = true;
module.ExplicityIgnored = true;
unit.IsGenerated = false;
unit.IsProcessed = true;
unit.ExplicityIgnored = true;
}
}

Loading…
Cancel
Save