Mirror of the JODE repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
jode/jode/jode/decompiler/TabbedPrintWriter.java

42 lines
783 B

package jode;
import java.io.*;
public class TabbedPrintWriter {
boolean atbol;
String tabstr;
StringBuffer indent;
PrintWriter pw;
int verbosity=0;
public TabbedPrintWriter (OutputStream os, String tabstr) {
pw = new PrintWriter(os);
this.tabstr=tabstr;
indent = new StringBuffer();
atbol = true;
}
public void tab() {
indent.append(tabstr);
}
public void untab() {
indent.setLength(indent.length()-tabstr.length());
}
public void println(String str) throws java.io.IOException {
if (atbol) {
pw.print(indent);
}
pw.println(str);
pw.flush();
atbol = true;
}
public void print(String str) throws java.io.IOException {
if (atbol) {
pw.print(indent);
}
pw.print(str);
atbol = false;
}
}