Browse Source

Added delegate CheckGenerate that is called before on generate so the block text generation can be empty when needed.

pull/220/merge
marcos henrich 12 years ago committed by triton
parent
commit
b28ac8b304
  1. 5
      src/Generator/Generators/Template.cs

5
src/Generator/Generators/Template.cs

@ -38,6 +38,8 @@ namespace CppSharp.Generators @@ -38,6 +38,8 @@ namespace CppSharp.Generators
private bool hasIndentChanged;
private bool isSubBlock;
public Func<bool> CheckGenerate;
public Block() : this(BlockKind.Unknown)
{
@ -81,6 +83,9 @@ namespace CppSharp.Generators @@ -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();

Loading…
Cancel
Save