Index: compiled/bindings/main.cpp |
=================================================================== |
--- a/compiled/bindings/main.cpp |
+++ b/compiled/bindings/main.cpp |
@@ -28,16 +28,17 @@ |
#include "../filter/WhitelistFilter.h" |
#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 "../FilterNotifier.h" |
int main() |
{ |
try |
{ |
class_<Filter>("Filter") |
.property("text", &Filter::GetText) |
@@ -90,30 +91,32 @@ int main() |
class_<ElemHideEmulationFilter,ElemHideBase>("ElemHideEmulationFilter") |
.class_property("type", "'elemhideemulation'"); |
class_<Subscription>("Subscription") |
.property("url", &Subscription::GetID) |
.property("title", &Subscription::GetTitle, &Subscription::SetTitle) |
.property("disabled", &Subscription::GetDisabled, &Subscription::SetDisabled) |
+ .property("listed", &Subscription::GetListed) |
.property("filterCount", &Subscription::GetFilterCount) |
.function("filterAt", &Subscription::FilterAt) |
.function("indexOfFilter", &Subscription::IndexOfFilter) |
.function("serialize", &Subscription::Serialize) |
.function("serializeFilters", &Subscription::SerializeFilters) |
.class_function("fromURL", &Subscription::FromID) |
.subclass_differentiator(&Subscription::mType, { |
{Subscription::Type::USERDEFINED, "SpecialSubscription"}, |
{Subscription::Type::DOWNLOADABLE, "DownloadableSubscription"}, |
}); |
class_<UserDefinedSubscription,Subscription>("SpecialSubscription") |
.function("isDefaultFor", &UserDefinedSubscription::IsDefaultFor) |
.function("makeDefaultFor", &UserDefinedSubscription::MakeDefaultFor) |
+ .function("isGeneric", &UserDefinedSubscription::IsGeneric) |
.function("insertFilterAt", &UserDefinedSubscription::InsertFilterAt) |
.function("removeFilterAt", &UserDefinedSubscription::RemoveFilterAt) |
.function("serialize", &UserDefinedSubscription::Serialize); |
class_<DownloadableSubscription,Subscription>("DownloadableSubscription") |
.property("fixedTitle", &DownloadableSubscription::GetFixedTitle, &DownloadableSubscription::SetFixedTitle) |
.property("homepage", &DownloadableSubscription::GetHomepage, &DownloadableSubscription::SetHomepage) |
.property("lastCheck", &DownloadableSubscription::GetLastCheck, &DownloadableSubscription::SetLastCheck) |
@@ -123,16 +126,25 @@ int main() |
.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); |
+ 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); |
+ |
printBindings(); |
RegExpFilter::GenerateCustomBindings(); |
FilterNotifier::GenerateCustomBindings(); |
return 0; |
} |
catch (const std::exception& e) |
{ |