Closure Library API Documentation
Go to class or file:
format.HtmlPrettyPrinter.Buffer
Extends
This class is a buffer to which we push our output. It tracks line breaks to make sure we don't add unnecessary ones.
Useful links
Source Code
Git
Inheritance
goog.format.HtmlPrettyPrinter.Buffer
Constructor
goog.format.HtmlPrettyPrinter.Buffer(
)
Instance Methods
Public
Protected
Private
Defined in
goog.format.HtmlPrettyPrinter.Buffer
lineBreak
()
Append line break if we need one.
code »
pushToken
(
breakBefore
,
token
,
breakAfter
)
Adds token and necessary line breaks to output buffer.
Arguments:
breakBefore
:
boolean
If true, add line break before token if necessary.
token
:
string
Token to push.
breakAfter
:
boolean
If true, add line break after token if necessary.
code »
toString
()
⇒
string
No description.
Returns:
string
String representation of tokens.
code »
Instance Properties
Defined in
goog.format.HtmlPrettyPrinter.Buffer
breakCount
:
Tracks number of line breaks added.
Code »
isBeginningOfNewLine_
:
Tracks if we are at the start of a new line.
Code »
needsNewLine_
:
Tracks if we need a new line before the next token.
Code »
out_
:
goog.string.StringBuffer
Tokens to be output in #toString.
Code »
Package format.HtmlPrettyPrinter
Package Reference