From 29e19e483df913018ad7836495fce76a5df95d99 Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 6 Feb 2013 16:13:50 +0000 Subject: [PATCH] Make indentation variable protected. --- src/Generator/Utils/TextGenerator.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Generator/Utils/TextGenerator.cs b/src/Generator/Utils/TextGenerator.cs index a11c5542..a3abba17 100644 --- a/src/Generator/Utils/TextGenerator.cs +++ b/src/Generator/Utils/TextGenerator.cs @@ -10,21 +10,22 @@ namespace Cxxi private const uint MaxIndent = 80; private readonly StringBuilder sb; - private readonly Stack currentIndent; private bool isStartOfLine; private bool needsNewLine; + protected readonly Stack CurrentIndent; + public TextGenerator() { sb = new StringBuilder(); - currentIndent = new Stack(); isStartOfLine = false; + CurrentIndent = new Stack(); } public void Write(string msg, params object[] args) { if (isStartOfLine) - sb.Append(new string(' ', (int)currentIndent.Sum(u => u))); + sb.Append(new string(' ', (int)CurrentIndent.Sum(u => u))); if (args.Length > 0) msg = string.Format(msg, args); @@ -69,12 +70,12 @@ namespace Cxxi public void PushIndent(uint indent = DefaultIndent) { - currentIndent.Push(indent); + CurrentIndent.Push(indent); } public void PopIndent() { - currentIndent.Pop(); + CurrentIndent.Pop(); } public void WriteStartBraceIndent()