beginBlockComment
public void beginBlockComment(boolean is_doc)
Begin a block comment. The beginning of comment string is output
to the pretty writer stream and the block comment mode is enabled.
The comment block is closed by calling the end comment block method.
Documentation comments add an additional asterisk after the open
comment.
- beginBlockComment in interface LanguageWriter
closeCxxExtern
public void closeCxxExtern()
Close the C++ extern block at the end of the header file.
closeHeaderGuard
public void closeHeaderGuard()
Close the header guard at the end of the header file.
endBlockComment
public void endBlockComment(boolean is_doc)
End a block comment. This method disables comment block output and
prints the end of comment string. Documentation comments do not add
a blank line whereas regular comments add a blank line after the
comment.
- endBlockComment in interface LanguageWriter
generateInclude
public void generateInclude(String file,
boolean guards)
Generate a user include statement for the specified include file.
If the guard flag is true, then the include statement will contain
redundant external include guards.
generateSystemInclude
public void generateSystemInclude(String file)
Generate a system include statement for the specified include file.
getIncludeGuard
public String getIncludeGuard(String file)
Generate the include guard from the specified file name. The guard
is the file name (without extension, if it exists) with an "included_"
prefix.
openCxxExtern
public void openCxxExtern()
Open the C++ extern block at the top of the header file.
openHeaderGuard
public void openHeaderGuard(String file)
Open the header include guard at the top of the header file.
redirectBegin
public void redirectBegin(String path,
int line)
Mark a region where the debugger should be redirected to another file
starting on a specific line.
- redirectBegin in interface LineRedirector
redirectEnd
public void redirectEnd(String path,
int line)
End the region where the debugger can just follow this file.
- redirectEnd in interface LineRedirector
safeCommentString
public final String safeCommentString(String str)
Convert a string into a string that can safely be included inside
a C comment. This will insert a space between a slash '/' and an
asterisk '*' to prevent opening a recursive comment or prematurely
ending a comment.
- safeCommentString in interface LanguageWriter
str
- a string to make safe for inclusion in a comment
- the string with starting and ending comments changed
to something safe.
skipIncludeGuard
public void skipIncludeGuard()
Turns openHeaderGuard & closeHeaderGuard into no-ops.
Used for package headers to address Roundup issue 93.
toSafeComment
public static String toSafeComment(String str)
Convert a string into a string that can safely be included inside
a C comment. This will insert a space between a slash '/' and an
asterisk '*' to prevent opening a recursive comment or prematurely
ending a comment.
str
- a string to make safe for inclusion in a comment
- a string with starting and ending comments changed
to something safe.
toSafeString
public static String toSafeString(String str)
Convert a string into a string that can safely be included inside
a C string. It will convert a backslash to a double backslash.
It will convert a quote into a backslash quote.
It will convert control characters into a backslashed character.
str
- a string to make safe for inclusion in a string
- a string with the special characters changed to
a safe form.
writeCommentLine
public void writeCommentLine(String comment)
Output a single-line comment to the pretty writer stream. The comment
should not contain any new line characters. If the comment is null,
then nothing is output.
- writeCommentLine in interface LanguageWriter
writeSplicerTagLine
public void writeSplicerTagLine(String tagLine)
Write the splicer tag as a language-specific comment.
- writeSplicerTagLine in interface LanguageWriter