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: Addressed most of the comment. Fixed some issues. Created Oct. 3, 2017, 7:31 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,37 @@
.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);
+
+ class_<CombinedMatcher>("CombinedMatcher")
+ .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);
+
+ class_<Matcher>("Matcher")
+ .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