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

Delta Between Two Patch Sets: compiled/bindings.cpp

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Left Patch Set: Replaced old filter classes unit tests completely Created Feb. 18, 2016, 4:40 p.m.
Right Patch Set: Addressed comments from Patch Set 28 Created March 21, 2017, 10:04 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « compiled/WhitelistFilter.cpp ('k') | compiled/bindings.ipp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #include "bindings.h" 1 #include "bindings.ipp"
2 #include "Filter.h" 2 #include "Filter.h"
3 #include "InvalidFilter.h" 3 #include "InvalidFilter.h"
4 #include "CommentFilter.h" 4 #include "CommentFilter.h"
5 #include "ActiveFilter.h" 5 #include "ActiveFilter.h"
6 #include "RegExpFilter.h" 6 #include "RegExpFilter.h"
7 #include "BlockingFilter.h" 7 #include "BlockingFilter.h"
8 #include "WhitelistFilter.h" 8 #include "WhitelistFilter.h"
9 #include "ElemHideBase.h" 9 #include "ElemHideBase.h"
10 #include "ElemHideFilter.h" 10 #include "ElemHideFilter.h"
11 #include "ElemHideException.h" 11 #include "ElemHideException.h"
12 #include "CSSPropertyFilter.h" 12 #include "CSSPropertyFilter.h"
13 13
14 EMSCRIPTEN_BINDINGS 14 EMSCRIPTEN_BINDINGS
15 { 15 {
16 class_<Filter>("Filter") 16 class_<Filter>("Filter")
17 .property("text", &Filter::GetText) 17 .property("text", &Filter::GetText)
18 .function("serialize", &Filter::Serialize) 18 .function("serialize", &Filter::Serialize)
19 .class_function("fromText", &Filter::FromText) 19 .class_function("fromText", &Filter::FromText)
20 .class_function("getKnownFilter", &Filter::GetKnownFilter) 20 .subclass_differentiator(&Filter::mType, {
21 .subclass_differentiator(&Filter::GetType, {
22 {Filter::Type::INVALID, "InvalidFilter"}, 21 {Filter::Type::INVALID, "InvalidFilter"},
23 {Filter::Type::COMMENT, "CommentFilter"}, 22 {Filter::Type::COMMENT, "CommentFilter"},
24 {Filter::Type::BLOCKING, "BlockingFilter"}, 23 {Filter::Type::BLOCKING, "BlockingFilter"},
25 {Filter::Type::WHITELIST, "WhitelistFilter"}, 24 {Filter::Type::WHITELIST, "WhitelistFilter"},
26 {Filter::Type::ELEMHIDE, "ElemHideFilter"}, 25 {Filter::Type::ELEMHIDE, "ElemHideFilter"},
27 {Filter::Type::ELEMHIDEEXCEPTION, "ElemHideException"}, 26 {Filter::Type::ELEMHIDEEXCEPTION, "ElemHideException"},
28 {Filter::Type::CSSPROPERTY, "CSSPropertyFilter"}, 27 {Filter::Type::CSSPROPERTY, "CSSPropertyFilter"},
29 }); 28 });
30 29
31 class_<InvalidFilter,Filter>("InvalidFilter") 30 class_<InvalidFilter,Filter>("InvalidFilter")
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 62
64 class_<ElemHideException,ElemHideBase>("ElemHideException") 63 class_<ElemHideException,ElemHideBase>("ElemHideException")
65 .class_property("type", "'elemhideexception'"); 64 .class_property("type", "'elemhideexception'");
66 65
67 class_<CSSPropertyFilter,ElemHideBase>("CSSPropertyFilter") 66 class_<CSSPropertyFilter,ElemHideBase>("CSSPropertyFilter")
68 .class_property("type", "'cssproperty'") 67 .class_property("type", "'cssproperty'")
69 .property("regexpString", &CSSPropertyFilter::GetRegExpString) 68 .property("regexpString", &CSSPropertyFilter::GetRegExpString)
70 .property("selectorPrefix", &CSSPropertyFilter::GetSelectorPrefix) 69 .property("selectorPrefix", &CSSPropertyFilter::GetSelectorPrefix)
71 .property("selectorSuffix", &CSSPropertyFilter::GetSelectorSuffix); 70 .property("selectorSuffix", &CSSPropertyFilter::GetSelectorSuffix);
72 } 71 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld