From ccab22e04dcd377843887784fff8abd3bfe01ab8 Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Tue, 17 Nov 2020 21:49:15 +0000 Subject: [PATCH] Add BlockGenerator.NeedsNewLine helper property. --- src/Generator/Utils/BlockGenerator.cs | 12 ++++++++++++ src/Generator/Utils/TextGenerator.cs | 1 + 2 files changed, 13 insertions(+) diff --git a/src/Generator/Utils/BlockGenerator.cs b/src/Generator/Utils/BlockGenerator.cs index 4759ea38..6087ae40 100644 --- a/src/Generator/Utils/BlockGenerator.cs +++ b/src/Generator/Utils/BlockGenerator.cs @@ -209,6 +209,12 @@ namespace CppSharp Text.NeedNewLine(); } + public bool NeedsNewLine + { + get => Text.NeedsNewLine; + set => Text.NeedsNewLine = value; + } + public void ResetNewLine() { Text.ResetNewLine(); @@ -369,6 +375,12 @@ namespace CppSharp ActiveBlock.NeedNewLine(); } + public bool NeedsNewLine + { + get => ActiveBlock.NeedsNewLine; + set => ActiveBlock.NeedsNewLine = value; + } + public void ResetNewLine() { ActiveBlock.ResetNewLine(); diff --git a/src/Generator/Utils/TextGenerator.cs b/src/Generator/Utils/TextGenerator.cs index b703ee8f..7edbf9f0 100644 --- a/src/Generator/Utils/TextGenerator.cs +++ b/src/Generator/Utils/TextGenerator.cs @@ -5,6 +5,7 @@ namespace CppSharp { public interface ITextGenerator { + bool NeedsNewLine { get; set; } void Write(string msg, params object[] args); void WriteLine(string msg, params object[] args); void WriteLineIndent(string msg, params object[] args);