diff --git a/src/Generator/Generators/Template.cs b/src/Generator/Generators/Template.cs index 000f151d..f015b3c7 100644 --- a/src/Generator/Generators/Template.cs +++ b/src/Generator/Generators/Template.cs @@ -38,6 +38,8 @@ namespace CppSharp.Generators private bool hasIndentChanged; private bool isSubBlock; + public Func CheckGenerate; + public Block() : this(BlockKind.Unknown) { @@ -81,6 +83,9 @@ namespace CppSharp.Generators public virtual string Generate(DriverOptions options) { + if (CheckGenerate != null && !CheckGenerate()) + return ""; + if (Blocks.Count == 0) return Text.ToString();