Browse Source

Add BlockGenerator.NeedsNewLine helper property.

pull/1514/head
Joao Matos 5 years ago committed by João Matos
parent
commit
ccab22e04d
  1. 12
      src/Generator/Utils/BlockGenerator.cs
  2. 1
      src/Generator/Utils/TextGenerator.cs

12
src/Generator/Utils/BlockGenerator.cs

@ -209,6 +209,12 @@ namespace CppSharp
Text.NeedNewLine(); Text.NeedNewLine();
} }
public bool NeedsNewLine
{
get => Text.NeedsNewLine;
set => Text.NeedsNewLine = value;
}
public void ResetNewLine() public void ResetNewLine()
{ {
Text.ResetNewLine(); Text.ResetNewLine();
@ -369,6 +375,12 @@ namespace CppSharp
ActiveBlock.NeedNewLine(); ActiveBlock.NeedNewLine();
} }
public bool NeedsNewLine
{
get => ActiveBlock.NeedsNewLine;
set => ActiveBlock.NeedsNewLine = value;
}
public void ResetNewLine() public void ResetNewLine()
{ {
ActiveBlock.ResetNewLine(); ActiveBlock.ResetNewLine();

1
src/Generator/Utils/TextGenerator.cs

@ -5,6 +5,7 @@ namespace CppSharp
{ {
public interface ITextGenerator public interface ITextGenerator
{ {
bool NeedsNewLine { get; set; }
void Write(string msg, params object[] args); void Write(string msg, params object[] args);
void WriteLine(string msg, params object[] args); void WriteLine(string msg, params object[] args);
void WriteLineIndent(string msg, params object[] args); void WriteLineIndent(string msg, params object[] args);

Loading…
Cancel
Save