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

Side by Side Diff: compiled/bindings.cpp

Issue 29384812: Issue 4127 - [emscripten] Convert subscription classes to C++ - Part 1 (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Fixed method names according to convention Created March 16, 2017, 6:26 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/StringMap.h ('k') | compiled/bindings.ipp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "bindings.ipp" 1 #include "bindings.ipp"
2 #include "filter/Filter.h" 2 #include "filter/Filter.h"
3 #include "filter/InvalidFilter.h" 3 #include "filter/InvalidFilter.h"
4 #include "filter/CommentFilter.h" 4 #include "filter/CommentFilter.h"
5 #include "filter/ActiveFilter.h" 5 #include "filter/ActiveFilter.h"
6 #include "filter/RegExpFilter.h" 6 #include "filter/RegExpFilter.h"
7 #include "filter/BlockingFilter.h" 7 #include "filter/BlockingFilter.h"
8 #include "filter/WhitelistFilter.h" 8 #include "filter/WhitelistFilter.h"
9 #include "filter/ElemHideBase.h" 9 #include "filter/ElemHideBase.h"
10 #include "filter/ElemHideFilter.h" 10 #include "filter/ElemHideFilter.h"
11 #include "filter/ElemHideException.h" 11 #include "filter/ElemHideException.h"
12 #include "filter/ElemHideEmulationFilter.h" 12 #include "filter/ElemHideEmulationFilter.h"
13 #include "subscription/Subscription.h"
14 #include "subscription/DownloadableSubscription.h"
15 #include "subscription/UserDefinedSubscription.h"
13 16
14 EMSCRIPTEN_BINDINGS 17 EMSCRIPTEN_BINDINGS
15 { 18 {
16 class_<Filter>("Filter") 19 class_<Filter>("Filter")
17 .property("text", &Filter::GetText) 20 .property("text", &Filter::GetText)
18 .function("serialize", &Filter::Serialize) 21 .function("serialize", &Filter::Serialize)
19 .class_function("fromText", &Filter::FromText) 22 .class_function("fromText", &Filter::FromText)
20 .subclass_differentiator(&Filter::mType, { 23 .subclass_differentiator(&Filter::mType, {
21 {Filter::Type::INVALID, "InvalidFilter"}, 24 {Filter::Type::INVALID, "InvalidFilter"},
22 {Filter::Type::COMMENT, "CommentFilter"}, 25 {Filter::Type::COMMENT, "CommentFilter"},
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 .property("selectorDomain", &ElemHideBase::GetSelectorDomain); 61 .property("selectorDomain", &ElemHideBase::GetSelectorDomain);
59 62
60 class_<ElemHideFilter,ElemHideBase>("ElemHideFilter") 63 class_<ElemHideFilter,ElemHideBase>("ElemHideFilter")
61 .class_property("type", "'elemhide'"); 64 .class_property("type", "'elemhide'");
62 65
63 class_<ElemHideException,ElemHideBase>("ElemHideException") 66 class_<ElemHideException,ElemHideBase>("ElemHideException")
64 .class_property("type", "'elemhideexception'"); 67 .class_property("type", "'elemhideexception'");
65 68
66 class_<ElemHideEmulationFilter,ElemHideBase>("ElemHideEmulationFilter") 69 class_<ElemHideEmulationFilter,ElemHideBase>("ElemHideEmulationFilter")
67 .class_property("type", "'elemhideemulation'"); 70 .class_property("type", "'elemhideemulation'");
71
72 class_<Subscription>("Subscription")
73 .property("url", &Subscription::GetID)
74 .property("title", &Subscription::GetTitle, &Subscription::SetTitle)
75 .property("disabled", &Subscription::GetDisabled, &Subscription::SetDisabl ed)
76 .function("serialize", &Subscription::Serialize)
77 .function("serializeFilters", &Subscription::SerializeFilters)
78 .class_function("fromURL", &Subscription::FromID)
79 .subclass_differentiator(&Subscription::mType, {
80 {Subscription::Type::USERDEFINED, "SpecialSubscription"},
81 {Subscription::Type::DOWNLOADABLE, "DownloadableSubscription"},
82 });
83
84 class_<UserDefinedSubscription,Subscription>("SpecialSubscription")
85 .function("isDefaultFor", &UserDefinedSubscription::IsDefaultFor)
86 .function("makeDefaultFor", &UserDefinedSubscription::MakeDefaultFor)
87 .function("serialize", &UserDefinedSubscription::Serialize);
88
89 class_<DownloadableSubscription,Subscription>("DownloadableSubscription")
90 .property("fixedTitle", &DownloadableSubscription::GetFixedTitle, &Downloa dableSubscription::SetFixedTitle)
91 .property("homepage", &DownloadableSubscription::GetHomepage, &Downloadabl eSubscription::SetHomepage)
92 .property("lastCheck", &DownloadableSubscription::GetLastCheck, &Downloada bleSubscription::SetLastCheck)
93 .property("expires", &DownloadableSubscription::GetHardExpiration, &Downlo adableSubscription::SetHardExpiration)
94 .property("softExpiration", &DownloadableSubscription::GetSoftExpiration, &DownloadableSubscription::SetSoftExpiration)
95 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &Dow nloadableSubscription::SetLastDownload)
96 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus, &DownloadableSubscription::SetDownloadStatus)
97 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Downl oadableSubscription::SetLastSuccess)
98 .property("errors", &DownloadableSubscription::GetErrorCount, &Downloadabl eSubscription::SetErrorCount)
99 .property("version", &DownloadableSubscription::GetDataRevision, &Download ableSubscription::SetDataRevision)
100 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersion , &DownloadableSubscription::SetRequiredVersion)
101 .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &D ownloadableSubscription::SetDownloadCount)
102 .function("serialize", &DownloadableSubscription::Serialize);
68 } 103 }
OLDNEW
« no previous file with comments | « compiled/StringMap.h ('k') | compiled/bindings.ipp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld