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

Unified Diff: compiled/bindings/main.cpp

Issue 29556737: Issue 5141 - Convert filter match to C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Fixed many issues. One test left out. Created Oct. 6, 2017, 1:45 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiled/bindings/main.cpp
===================================================================
--- a/compiled/bindings/main.cpp
+++ b/compiled/bindings/main.cpp
@@ -29,16 +29,17 @@
#include "../filter/ElemHideBase.h"
#include "../filter/ElemHideFilter.h"
#include "../filter/ElemHideException.h"
#include "../filter/ElemHideEmulationFilter.h"
#include "../subscription/Subscription.h"
#include "../subscription/DownloadableSubscription.h"
#include "../subscription/UserDefinedSubscription.h"
#include "../storage/FilterStorage.h"
+#include "../filter/Matcher.h"
#include "../FilterNotifier.h"
int main()
{
try
{
class_<Filter>("Filter")
.property("text", &Filter::GetText)
@@ -126,16 +127,39 @@
.property("downloadStatus", &DownloadableSubscription::GetDownloadStatus, &DownloadableSubscription::SetDownloadStatus)
.property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &DownloadableSubscription::SetLastSuccess)
.property("errors", &DownloadableSubscription::GetErrorCount, &DownloadableSubscription::SetErrorCount)
.property("version", &DownloadableSubscription::GetDataRevision, &DownloadableSubscription::SetDataRevision)
.property("requiredVersion", &DownloadableSubscription::GetRequiredVersion, &DownloadableSubscription::SetRequiredVersion)
.property("downloadCount", &DownloadableSubscription::GetDownloadCount, &DownloadableSubscription::SetDownloadCount)
.function("serialize", &DownloadableSubscription::Serialize);
+ class_<ReMatchResults>("ReMatchResults")
+ .function("push", &ReMatchResults::push);
Wladimir Palant 2017/10/09 08:39:47 Why do we need to export what is clearly an intern
sergei 2017/10/09 15:27:51 This class is used as a callback to obtain the res
hub 2017/10/10 13:46:15 The sole purpose of this class is to be able to ge
+
+ class_<CombinedMatcher>("CombinedMatcher")
+ .class_function("create", &CombinedMatcher::Create)
+ .function("add", &CombinedMatcher::Add)
+ .function("remove", &CombinedMatcher::Remove)
+ .function("matchesAny", &CombinedMatcher::MatchesAny)
+ .function("clear", &CombinedMatcher::Clear)
+ .function("hasFilter", &CombinedMatcher::HasFilter)
+ .function("getKeywordForFilter", &CombinedMatcher::GetKeywordForFilter)
+ .function("findKeyword", &CombinedMatcher::FindKeyword);
Wladimir Palant 2017/10/09 08:39:47 The three methods above shouldn't be exported, the
sergei 2017/10/09 15:27:52 I think they are currently exported for the sake o
Wladimir Palant 2017/10/10 07:39:05 Yes, that's probably it. We should remove/rewrite
hub 2017/10/10 13:46:15 Note that currently these are test that exist in m
+
+ class_<Matcher>("Matcher")
+ .class_function("create", &Matcher::Create)
+ .function("add", &Matcher::Add)
+ .function("remove", &Matcher::Remove)
+ .function("matchesAny", &Matcher::MatchesAny)
+ .function("clear", &Matcher::Clear)
+ .function("hasFilter", &Matcher::HasFilter)
+ .function("getKeywordForFilter", &Matcher::GetKeywordForFilter)
+ .function("findKeyword", &Matcher::FindKeyword);
+
singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance)
.property("subscriptionCount", &FilterStorage::GetSubscriptionCount)
.function("subscriptionAt", &FilterStorage::SubscriptionAt)
.function("indexOfSubscription", &FilterStorage::IndexOfSubscription)
.function("getSubscriptionForFilter", &FilterStorage::GetSubscriptionForFilter)
.function("addSubscription", &FilterStorage::AddSubscription)
.function("removeSubscription", &FilterStorage::RemoveSubscription)
.function("moveSubscription", &FilterStorage::MoveSubscription);

Powered by Google App Engine
This is Rietveld