Browse Source

Add support for deep cloning TextGenerator instances.

pull/12/merge
triton 12 years ago
parent
commit
6dd7d19165
  1. 13
      src/Generator/Utils/TextGenerator.cs

13
src/Generator/Utils/TextGenerator.cs

@ -21,6 +21,19 @@ namespace CppSharp @@ -21,6 +21,19 @@ namespace CppSharp
CurrentIndent = new Stack<uint>();
}
public TextGenerator(TextGenerator generator)
{
StringBuilder = new StringBuilder(generator);
IsStartOfLine = generator.IsStartOfLine;
NeedsNewLine = generator.NeedsNewLine;
CurrentIndent = new Stack<uint>(generator.CurrentIndent);
}
public TextGenerator Clone()
{
return new TextGenerator(this);
}
public void Write(string msg, params object[] args)
{
if (string.IsNullOrEmpty(msg))

Loading…
Cancel
Save