diff options
Diffstat (limited to 'cpp/src/Slice/OutputUtil.cpp')
-rw-r--r-- | cpp/src/Slice/OutputUtil.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/cpp/src/Slice/OutputUtil.cpp b/cpp/src/Slice/OutputUtil.cpp index 5a34d525bfc..63fe83d2c90 100644 --- a/cpp/src/Slice/OutputUtil.cpp +++ b/cpp/src/Slice/OutputUtil.cpp @@ -31,21 +31,21 @@ Separator sp; Slice::Output::Output() : _pos(0), _indent(0), - _separator(true),
- _blockStart("{"),
- _blockEnd("}"),
- _useTab(true),
- _indentSize(4)
+ _separator(true), + _blockStart("{"), + _blockEnd("}"), + _useTab(true), + _indentSize(4) { } Slice::Output::Output(const char* s) : _pos(0), _indent(0), - _separator(true),
- _blockStart("{"),
- _blockEnd("}"),
- _useTab(true),
+ _separator(true), + _blockStart("{"), + _blockEnd("}"), + _useTab(true), _indentSize(4) { open(s); @@ -107,30 +107,30 @@ Slice::Output::restoreIndent() _indent = _indentSave.top(); _indentSave.pop(); } -
-void
-Slice::Output::setBeginBlock(const char *bb)
-{
- _blockStart = bb;
-}
-
-void
-Slice::Output::setEndBlock(const char *eb)
-{
- _blockEnd = eb;
-}
-
-void
-Slice::Output::setIndent(int indentSize)
-{
- _indentSize = indentSize;
-}
-
-void
-Slice::Output::setUseTab(bool useTab)
-{
- _useTab = useTab;
-}
+ +void +Slice::Output::setBeginBlock(const char *bb) +{ + _blockStart = bb; +} + +void +Slice::Output::setEndBlock(const char *eb) +{ + _blockEnd = eb; +} + +void +Slice::Output::setIndent(int indentSize) +{ + _indentSize = indentSize; +} + +void +Slice::Output::setUseTab(bool useTab) +{ + _useTab = useTab; +} void Slice::Output::nl() @@ -140,25 +140,25 @@ Slice::Output::nl() _separator = true; int indent = _indent; -
- if (_useTab)
- {
- while (indent >= 8)
- {
- indent -= 8;
- _out << '\t';
- _pos += 8;
- }
- }
- else
- {
+ + if (_useTab) + { + while (indent >= 8) + { + indent -= 8; + _out << '\t'; + _pos += 8; + } + } + else + { while (indent >= _indentSize) { indent -= _indentSize; _out << " "; _pos += _indentSize; } - }
+ } while (indent > 0) { |