19 #ifndef PAGESPEED_KERNEL_HTML_HTML_WRITER_FILTER_H_
20 #define PAGESPEED_KERNEL_HTML_HTML_WRITER_FILTER_H_
30 namespace net_instaweb {
40 void set_writer(
Writer* writer) { writer_ = writer; }
58 void set_max_column(
int max_column) { max_column_ = max_column; }
59 void set_case_fold(
bool case_fold) { case_fold_ = case_fold; }
61 virtual const char*
Name()
const {
return "HtmlWriter"; }
67 Writer* writer() {
return writer_; }
73 void EmitBytes(
const StringPiece& str);
77 void EmitName(
const HtmlName& name);
83 void EncodeBytes(
const GoogleString& val,
int quoteChar);
85 HtmlParse* html_parse_;
93 HtmlElement* lazy_close_element_;
Definition: html_filter.h:35
virtual void StartDocument()
Leaf node representing raw characters in HTML.
Definition: html_node.h:167
Indicates this filter never injects scripts.
Definition: html_filter.h:55
virtual void StartElement(HtmlElement *element)
virtual void EndDocument()
virtual void IEDirective(HtmlIEDirectiveNode *directive)
Definition: html_parse.h:88
virtual void Characters(HtmlCharactersNode *characters)
Called for raw characters between tags.
Definition: html_element.h:42
virtual bool CanModifyUrls()
This filter will not change urls.
Definition: html_writer_filter.h:55
virtual void DetermineEnabled(GoogleString *disabled_reason)
virtual void Clear()
Clear various variables for rewriting a new html file.
virtual void Cdata(HtmlCdataNode *cdata)
Called for CDATA blocks (e.g. <![CDATA[foobar]]>)
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Style
Definition: html_element.h:50
ScriptUsage GetScriptUsage() const override
Definition: html_writer_filter.h:56
ScriptUsage
Describes a filter's relationship with scripts.
Definition: html_filter.h:38
virtual void Comment(HtmlCommentNode *comment)
Called for HTML comments that aren't IE directives (e.g. ).
Interface for writing bytes to an output stream.
Definition: writer.h:29
Leaf node representing an HTML directive.
Definition: html_node.h:233
Filter that serializes HTML to a Writer stream.
Definition: html_writer_filter.h:36
virtual const char * Name() const
The name of this filter – used for logging and debugging.
Definition: html_writer_filter.h:61
Leaf node representing a CDATA section.
Definition: html_node.h:147
Leaf node representing an HTML IE directive.
Definition: html_node.h:213
void TerminateLazyCloseElement()
Terminates the current lazy close element if it is not already terminated.
virtual void Directive(HtmlDirectiveNode *directive)
Called for HTML directives (e.g. <!doctype foobar>).