write some boring struct in VxTypes

This commit is contained in:
2023-09-13 22:33:41 +08:00
parent 33c02d292b
commit 8894b1ccad
34 changed files with 396 additions and 981 deletions

View File

@ -0,0 +1,65 @@
import java.io.OutputStreamWriter;
public class IndentHelper {
public IndentHelper(OutputStreamWriter writer) {
mIndent = 0;
mWriter = writer;
}
private int mIndent;
private OutputStreamWriter mWriter;
public void inc() {
++mIndent;
}
public void dec() {
--mIndent;
}
public void indent() throws Exception {
mWriter.write("\n");
for (int i = 0; i < mIndent; ++i) {
mWriter.write("\t");
}
}
public void puts(String data) throws Exception {
indent();
mWriter.write(data);
}
public void printf(String fmt, Object... args) throws Exception {
indent();
mWriter.write(String.format(fmt, args));
}
/**
* Write standard Doxygen document comment.
* <p>
* Usually be called before writing content.
* @param comment
* @throws Exception
*/
public void briefComment(String comment) throws Exception {
if (comment == null)
return;
puts("/**");
puts(comment);
puts(" */");
}
/**
* Write suffix style Doxygen document comment.
* <p>
* Usually be called after writing content.
* @param comment
* @throws Exception
*/
public void afterMemberComment(String comment) throws Exception {
if (comment == null)
return;
mWriter.write(String.format("\t/**< %s */", CommonHelper.removeEol(comment)));
}
}