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

Side by Side Diff: compiled/bindings.cpp

Issue 29385742: Issue 4127 - [emscripten] Convert subscription classes to C++ - Part 2 (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Use iterators syntax Created April 6, 2017, 8:05 a.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 | « no previous file | 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 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 class_<ElemHideException,ElemHideBase>("ElemHideException") 83 class_<ElemHideException,ElemHideBase>("ElemHideException")
84 .class_property("type", "'elemhideexception'"); 84 .class_property("type", "'elemhideexception'");
85 85
86 class_<ElemHideEmulationFilter,ElemHideBase>("ElemHideEmulationFilter") 86 class_<ElemHideEmulationFilter,ElemHideBase>("ElemHideEmulationFilter")
87 .class_property("type", "'elemhideemulation'"); 87 .class_property("type", "'elemhideemulation'");
88 88
89 class_<Subscription>("Subscription") 89 class_<Subscription>("Subscription")
90 .property("url", &Subscription::GetID) 90 .property("url", &Subscription::GetID)
91 .property("title", &Subscription::GetTitle, &Subscription::SetTitle) 91 .property("title", &Subscription::GetTitle, &Subscription::SetTitle)
92 .property("disabled", &Subscription::GetDisabled, &Subscription::SetDisabl ed) 92 .property("disabled", &Subscription::GetDisabled, &Subscription::SetDisabl ed)
93 .property("filterCount", &Subscription::GetFilterCount)
94 .function("filterAt", &Subscription::FilterAt)
95 .function("indexOfFilter", &Subscription::IndexOfFilter)
93 .function("serialize", &Subscription::Serialize) 96 .function("serialize", &Subscription::Serialize)
94 .function("serializeFilters", &Subscription::SerializeFilters) 97 .function("serializeFilters", &Subscription::SerializeFilters)
95 .class_function("fromURL", &Subscription::FromID) 98 .class_function("fromURL", &Subscription::FromID)
96 .subclass_differentiator(&Subscription::mType, { 99 .subclass_differentiator(&Subscription::mType, {
97 {Subscription::Type::USERDEFINED, "SpecialSubscription"}, 100 {Subscription::Type::USERDEFINED, "SpecialSubscription"},
98 {Subscription::Type::DOWNLOADABLE, "DownloadableSubscription"}, 101 {Subscription::Type::DOWNLOADABLE, "DownloadableSubscription"},
99 }); 102 });
100 103
101 class_<UserDefinedSubscription,Subscription>("SpecialSubscription") 104 class_<UserDefinedSubscription,Subscription>("SpecialSubscription")
102 .function("isDefaultFor", &UserDefinedSubscription::IsDefaultFor) 105 .function("isDefaultFor", &UserDefinedSubscription::IsDefaultFor)
103 .function("makeDefaultFor", &UserDefinedSubscription::MakeDefaultFor) 106 .function("makeDefaultFor", &UserDefinedSubscription::MakeDefaultFor)
107 .function("insertFilterAt", &UserDefinedSubscription::InsertFilterAt)
108 .function("removeFilterAt", &UserDefinedSubscription::RemoveFilterAt)
104 .function("serialize", &UserDefinedSubscription::Serialize); 109 .function("serialize", &UserDefinedSubscription::Serialize);
105 110
106 class_<DownloadableSubscription,Subscription>("DownloadableSubscription") 111 class_<DownloadableSubscription,Subscription>("DownloadableSubscription")
107 .property("fixedTitle", &DownloadableSubscription::GetFixedTitle, &Downloa dableSubscription::SetFixedTitle) 112 .property("fixedTitle", &DownloadableSubscription::GetFixedTitle, &Downloa dableSubscription::SetFixedTitle)
108 .property("homepage", &DownloadableSubscription::GetHomepage, &Downloadabl eSubscription::SetHomepage) 113 .property("homepage", &DownloadableSubscription::GetHomepage, &Downloadabl eSubscription::SetHomepage)
109 .property("lastCheck", &DownloadableSubscription::GetLastCheck, &Downloada bleSubscription::SetLastCheck) 114 .property("lastCheck", &DownloadableSubscription::GetLastCheck, &Downloada bleSubscription::SetLastCheck)
110 .property("expires", &DownloadableSubscription::GetHardExpiration, &Downlo adableSubscription::SetHardExpiration) 115 .property("expires", &DownloadableSubscription::GetHardExpiration, &Downlo adableSubscription::SetHardExpiration)
111 .property("softExpiration", &DownloadableSubscription::GetSoftExpiration, &DownloadableSubscription::SetSoftExpiration) 116 .property("softExpiration", &DownloadableSubscription::GetSoftExpiration, &DownloadableSubscription::SetSoftExpiration)
112 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &Dow nloadableSubscription::SetLastDownload) 117 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &Dow nloadableSubscription::SetLastDownload)
113 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus, &DownloadableSubscription::SetDownloadStatus) 118 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus, &DownloadableSubscription::SetDownloadStatus)
114 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Downl oadableSubscription::SetLastSuccess) 119 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Downl oadableSubscription::SetLastSuccess)
115 .property("errors", &DownloadableSubscription::GetErrorCount, &Downloadabl eSubscription::SetErrorCount) 120 .property("errors", &DownloadableSubscription::GetErrorCount, &Downloadabl eSubscription::SetErrorCount)
116 .property("version", &DownloadableSubscription::GetDataRevision, &Download ableSubscription::SetDataRevision) 121 .property("version", &DownloadableSubscription::GetDataRevision, &Download ableSubscription::SetDataRevision)
117 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersion , &DownloadableSubscription::SetRequiredVersion) 122 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersion , &DownloadableSubscription::SetRequiredVersion)
118 .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &D ownloadableSubscription::SetDownloadCount) 123 .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &D ownloadableSubscription::SetDownloadCount)
119 .function("serialize", &DownloadableSubscription::Serialize); 124 .function("serialize", &DownloadableSubscription::Serialize);
120 } 125 }
OLDNEW
« no previous file with comments | « no previous file | compiled/bindings.ipp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld