diff options
author | Matthew Newhook <matthew@zeroc.com> | 2014-10-20 11:40:05 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2014-10-20 11:40:05 -0230 |
commit | b51469b41167fb86ae2059a15cf0475c53fdda7b (patch) | |
tree | fc85d6ca2efd89c67e1e4e7438f437c3e08313f4 /java/src/IceUtilInternal/OutputBase.java | |
parent | Fixed (ICE-5695) - IceSSL: misleading exception (diff) | |
download | ice-b51469b41167fb86ae2059a15cf0475c53fdda7b.tar.bz2 ice-b51469b41167fb86ae2059a15cf0475c53fdda7b.tar.xz ice-b51469b41167fb86ae2059a15cf0475c53fdda7b.zip |
Down with ant. From the gradle to the grave.
Diffstat (limited to 'java/src/IceUtilInternal/OutputBase.java')
-rw-r--r-- | java/src/IceUtilInternal/OutputBase.java | 188 |
1 files changed, 0 insertions, 188 deletions
diff --git a/java/src/IceUtilInternal/OutputBase.java b/java/src/IceUtilInternal/OutputBase.java deleted file mode 100644 index e36d7c898b0..00000000000 --- a/java/src/IceUtilInternal/OutputBase.java +++ /dev/null @@ -1,188 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -package IceUtilInternal; - -public class OutputBase -{ - public - OutputBase() - { - _out = null; - _pos = 0; - _indent = 0; - _indentSize = 4; - _useTab = true; - _separator = true; - } - - public - OutputBase(java.io.PrintWriter out) - { - _out = out; - _pos = 0; - _indent = 0; - _indentSize = 4; - _useTab = true; - _separator = true; - } - - public - OutputBase(String s) - { - _out = null; - _pos = 0; - _indent = 0; - _indentSize = 4; - _useTab = true; - _separator = true; - - open(s); - } - - public void - setIndent(int indentSize) - { - _indentSize = indentSize; - } - - public void - setUseTab(boolean useTab) - { - _useTab = useTab; - } - - public void - open(String s) - { - try - { - java.io.FileWriter fw = new java.io.FileWriter(s); - java.io.BufferedWriter bw = new java.io.BufferedWriter(fw); - _out = new java.io.PrintWriter(bw); - } - catch(java.io.IOException ex) - { - } - } - - public void - print(String s) - { - final char[] arr = s.toCharArray(); - for(int i = 0; i < arr.length; i++) - { - if(arr[i] == '\n') - { - _pos = 0; - } - else - { - ++_pos; - } - } - - _out.print(s); - } - - public void - inc() - { - _indent += _indentSize; - } - - public void - dec() - { - assert(_indent >= _indentSize); - _indent -= _indentSize; - } - - public void - useCurrentPosAsIndent() - { - _indentSave.addFirst(_indent); - _indent = _pos; - } - - public void - zeroIndent() - { - _indentSave.addFirst(_indent); - _indent = 0; - } - - public void - restoreIndent() - { - assert(!_indentSave.isEmpty()); - _indent = _indentSave.removeFirst().intValue(); - } - - public void - nl() - { - _out.println(); - _pos = 0; - _separator = true; - - int indent = _indent; - - if(_useTab) - { - while(indent >= 8) - { - indent -= 8; - _out.print('\t'); - _pos += 8; - } - } - else - { - while(indent >= _indentSize) - { - indent -= _indentSize; - _out.print(" "); - _pos += _indentSize; - } - } - - while(indent > 0) - { - --indent; - _out.print(' '); - ++_pos; - } - - _out.flush(); - } - - public void - sp() - { - if(_separator) - { - _out.println(); - } - } - - public boolean - valid() - { - return (_out != null); - } - - protected java.io.PrintWriter _out; - protected int _pos; - protected int _indent; - protected int _indentSize; - protected java.util.LinkedList<Integer> _indentSave = new java.util.LinkedList<Integer>(); - protected boolean _useTab; - protected boolean _separator; -} |