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: Created Sept. 26, 2017, 9:34 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,27 @@
.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);
+
+ singleton<MatcherBase>("Matcher", &MatcherBase::GetDefaultInstance)
+ .function("add", &MatcherBase::Add)
+ .function("remove", &MatcherBase::Remove)
+ .function("matchesAny", &MatcherBase::MatchesAny)
+ .function("clear", &MatcherBase::Clear)
+ .function("hasFilter", &MatcherBase::HasFilter)
+ .function("getKeywordForFilter", &MatcherBase::GetKeywordForFilter);
+
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