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: Addressed Sergei`s comments again and added some asserts Created Feb. 23, 2016, 12:30 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
OLDNEW
(Empty)
1 #pragma once
2
3 #include <cstddef>
4
5 #include "Filter.h"
6 #include "ElemHideBase.h"
7
8 struct CSSPropertyFilterData
9 {
10 String::size_type mPrefixEnd;
11 String::size_type mRegexpStart;
12 String::size_type mRegexpEnd;
13 String::size_type mSuffixStart;
14
15 const DependentString GetSelectorPrefix(const String& text,
16 String::size_type selectorStart) const
17 {
18 return DependentString(text, selectorStart, mPrefixEnd - selectorStart);
19 }
20
21 const DependentString GetRegExpSource(const String& text) const
22 {
23 return DependentString(text, mRegexpStart, mRegexpEnd - mRegexpStart);
24 }
25
26 const DependentString GetSelectorSuffix(const String& text) const
27 {
28 return DependentString(text, mSuffixStart);
29 }
30 };
31
32 struct ElemHideData : ElemHideBaseData, CSSPropertyFilterData
33 {
34 };
35
36 class CSSPropertyFilter: public ElemHideBase, protected CSSPropertyFilterData
37 {
38 public:
39 CSSPropertyFilter(const String& text, const ElemHideData& data);
40 Type GetType() const override;
41 EMSCRIPTEN_KEEPALIVE OwnedString GetRegExpString() const;
42 EMSCRIPTEN_KEEPALIVE const DependentString GetSelectorPrefix() const
43 {
44 return CSSPropertyFilterData::GetSelectorPrefix(mText, mSelectorStart);
45 }
46 EMSCRIPTEN_KEEPALIVE const DependentString GetSelectorSuffix() const
47 {
48 return CSSPropertyFilterData::GetSelectorSuffix(mText);
49 }
50 };
OLDNEW

Powered by Google App Engine
This is Rietveld