Page Speed Optimization Libraries  1.9.32.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
scan_filter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_SCAN_FILTER_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_SCAN_FILTER_H_
21 
22 #include "net/instaweb/htmlparse/public/empty_html_filter.h"
23 
24 namespace net_instaweb {
25 
26 class HtmlCdataNode;
27 class HtmlCharactersNode;
28 class HtmlCommentNode;
29 class HtmlDirectiveNode;
30 class HtmlElement;
31 class HtmlIEDirectiveNode;
32 class RewriteDriver;
33 
40 class ScanFilter : public EmptyHtmlFilter {
41  public:
42  explicit ScanFilter(RewriteDriver* driver);
43  virtual ~ScanFilter();
44 
45  virtual void StartDocument();
46  virtual void StartElement(HtmlElement* element);
47  virtual void Cdata(HtmlCdataNode* cdata);
48  virtual void Comment(HtmlCommentNode* comment);
49  virtual void IEDirective(HtmlIEDirectiveNode* directive);
50  virtual void Characters(HtmlCharactersNode* characters);
51  virtual void Directive(HtmlDirectiveNode* directive);
52  virtual void Flush();
53 
54  virtual const char* Name() const { return "Scan"; }
55 
56  private:
57  RewriteDriver* driver_;
58  bool seen_any_nodes_;
59  bool seen_refs_;
60  bool seen_base_;
61  bool seen_meta_tag_charset_;
62 };
63 
64 }
65 
66 #endif
Definition: scan_filter.h:40
Definition: rewrite_driver.h:98