Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
add_ids_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 
19 
20 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_ADD_IDS_FILTER_H_
21 #define NET_INSTAWEB_REWRITER_PUBLIC_ADD_IDS_FILTER_H_
22 
23 #include <vector>
24 
29 
30 namespace net_instaweb {
31 
42 class AddIdsFilter : public EmptyHtmlFilter {
43  public:
44  static const char kIdPrefix[];
45 
46  explicit AddIdsFilter(RewriteDriver* driver);
47  virtual ~AddIdsFilter();
48 
49  virtual void StartDocument();
50  virtual void StartElement(HtmlElement* element);
51  virtual void EndElement(HtmlElement* element);
52  virtual const char* Name() const { return "AddIdsFilter"; }
53 
54  private:
55  GoogleString GetDivCountStackEncoding();
56 
64  static const int kIsId;
65  std::vector<int> div_count_stack_;
66  std::vector<const HtmlElement::Attribute*> id_stack_;
67  RewriteDriver* driver_;
68 };
69 
70 }
71 
72 #endif
virtual const char * Name() const
The name of this filter – used for logging and debugging.
Definition: add_ids_filter.h:52
Definition: empty_html_filter.h:37
Definition: html_element.h:42
Definition: add_ids_filter.h:42
virtual void StartDocument()
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual void StartElement(HtmlElement *element)
Definition: rewrite_driver.h:100