1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-02 05:45:58 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-10-26 15:24:10 -07:00
parent 0ebca71a1d
commit 168e1f4460

View file

@ -12,20 +12,16 @@
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
/**
*
* This class is responsible for the string concatination and the management of
* This class is responsible for the string concatenation and the management of
* the indentations.
*
* @since 5.0
* @author Emanuel Graf IFS
*
*/
public class Scribe {
private int indentationLevel = 0;
private int indentationSize = 4; //HSR tcorbat: could be a tab character too - this is not a very elegant solution
private StringBuffer buffer = new StringBuffer();
private StringBuilder buffer = new StringBuilder();
private boolean isAtLineBeginning = true;
private String newLine = System.getProperty("line.separator"); //$NON-NLS-1$
private String givenIndentation = null;
@ -99,8 +95,7 @@ public class Scribe {
if (!noSemicolon) {
indentIfNewLine();
buffer.append(';');
}
else {
} else {
noSemicolon = false;
}
}
@ -131,7 +126,7 @@ public class Scribe {
}
/**
* Prints a { to the Buffer an increases the Indentationlevel.
* Prints a { to the Buffer an increases the indentation level.
*/
public void printLBrace() {
print('{');
@ -139,7 +134,7 @@ public class Scribe {
}
/**
* Prints a } to the Buffer an decrease the Indentationlevel.
* Prints a } to the Buffer an decrease the indentation level.
*/
public void printRBrace() {
--indentationLevel;
@ -184,6 +179,6 @@ public class Scribe {
}
public void cleanCache() {
buffer = new StringBuffer();
buffer = new StringBuilder();
}
}