mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +02:00
Cosmetics.
This commit is contained in:
parent
0ebca71a1d
commit
168e1f4460
1 changed files with 28 additions and 33 deletions
|
@ -12,20 +12,16 @@
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* This class is responsible for the string concatenation and the management of
|
||||||
* This class is responsible for the string concatination and the management of
|
|
||||||
* the indentations.
|
* the indentations.
|
||||||
*
|
*
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
* @author Emanuel Graf IFS
|
* @author Emanuel Graf IFS
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class Scribe {
|
public class Scribe {
|
||||||
|
|
||||||
|
|
||||||
private int indentationLevel = 0;
|
private int indentationLevel = 0;
|
||||||
private int indentationSize = 4; //HSR tcorbat: could be a tab character too - this is not a very elegant solution
|
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 boolean isAtLineBeginning = true;
|
||||||
private String newLine = System.getProperty("line.separator"); //$NON-NLS-1$
|
private String newLine = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||||
private String givenIndentation = null;
|
private String givenIndentation = null;
|
||||||
|
@ -99,8 +95,7 @@ public class Scribe {
|
||||||
if (!noSemicolon) {
|
if (!noSemicolon) {
|
||||||
indentIfNewLine();
|
indentIfNewLine();
|
||||||
buffer.append(';');
|
buffer.append(';');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
noSemicolon = false;
|
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() {
|
public void printLBrace() {
|
||||||
print('{');
|
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() {
|
public void printRBrace() {
|
||||||
--indentationLevel;
|
--indentationLevel;
|
||||||
|
@ -184,6 +179,6 @@ public class Scribe {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cleanCache() {
|
public void cleanCache() {
|
||||||
buffer = new StringBuffer();
|
buffer = new StringBuilder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue