Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: compiled/CSSPropertyFilter.h

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Patch Set: Split up String class into two, cleaned up RegExpFilter methods Created Feb. 4, 2016, 7:20 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compiled/ActiveFilter.cpp ('k') | compiled/CSSPropertyFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef ADBLOCK_PLUS_CSS_PROPERTY_FILTER_H
2 #define ADBLOCK_PLUS_CSS_PROPERTY_FILTER_H
3
4 #include <cstddef>
5
6 #include "Filter.h"
7 #include "ElemHideBase.h"
8
9 struct CSSPropertyFilterData
10 {
11 String::size_type mPrefixEnd;
12 String::size_type mRegexpStart;
13 String::size_type mRegexpEnd;
14 String::size_type mSuffixStart;
15
16 const DependentString GetSelectorPrefix(const String& text,
17 String::size_type selectorStart) const
18 {
19 return DependentString(text, selectorStart, mPrefixEnd - selectorStart);
20 }
21
22 const DependentString GetRegExpSource(const String& text) const
23 {
24 return DependentString(text, mRegexpStart, mRegexpEnd - mRegexpStart);
25 }
26
27 const DependentString GetSelectorSuffix(const String& text) const
28 {
29 return DependentString(text, mSuffixStart);
30 }
31 };
32
33 struct ElemHideData : ElemHideBaseData, CSSPropertyFilterData
34 {
35 };
36
37 class CSSPropertyFilter: public ElemHideBase, protected CSSPropertyFilterData
38 {
39 public:
40 CSSPropertyFilter(const String& text, const ElemHideData& data);
41 Type GetType() const;
42 EMSCRIPTEN_KEEPALIVE OwnedString GetRegExpString() const;
43 EMSCRIPTEN_KEEPALIVE const DependentString GetSelectorPrefix() const
44 {
45 return CSSPropertyFilterData::GetSelectorPrefix(mText, mSelectorStart);
46 }
47 EMSCRIPTEN_KEEPALIVE const DependentString GetSelectorSuffix() const
48 {
49 return CSSPropertyFilterData::GetSelectorSuffix(mText);
50 }
51 };
52
53 #endif
OLDNEW
« no previous file with comments | « compiled/ActiveFilter.cpp ('k') | compiled/CSSPropertyFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld