From 2432021f64ac5b032b06f164ff845a116646b4f1 Mon Sep 17 00:00:00 2001 From: ryanml Date: Thu, 6 Dec 2018 03:41:45 -0700 Subject: [PATCH] Adding percent filter to PublisherInfoFilter --- include/bat/ledger/publisher_info.h | 6 ++++++ src/bat/ledger/ledger.cc | 2 ++ 2 files changed, 8 insertions(+) diff --git a/include/bat/ledger/publisher_info.h b/include/bat/ledger/publisher_info.h index bd7e2e5..de74027 100644 --- a/include/bat/ledger/publisher_info.h +++ b/include/bat/ledger/publisher_info.h @@ -52,6 +52,11 @@ LEDGER_EXPORT enum PUBLISHER_EXCLUDE_FILTER { FILTER_ALL_EXCEPT_EXCLUDED = 3 }; +LEDGER_EXPORT enum PUBLISHER_PERCENT_FILTER { + FILTER_ALL_PERCENT = -1, + FILTER_ZERO = 0 +}; + LEDGER_EXPORT struct PublisherInfoFilter { PublisherInfoFilter(); PublisherInfoFilter(const PublisherInfoFilter& filter); @@ -62,6 +67,7 @@ LEDGER_EXPORT struct PublisherInfoFilter { PUBLISHER_MONTH month; int year; PUBLISHER_EXCLUDE_FILTER excluded; + PUBLISHER_PERCENT_FILTER percent; std::vector> order_by; unsigned int min_duration; uint64_t reconcile_stamp; diff --git a/src/bat/ledger/ledger.cc b/src/bat/ledger/ledger.cc index 18f1817..68caa98 100644 --- a/src/bat/ledger/ledger.cc +++ b/src/bat/ledger/ledger.cc @@ -88,6 +88,7 @@ PublisherInfoFilter::PublisherInfoFilter() : month(PUBLISHER_MONTH::ANY), year(-1), excluded(PUBLISHER_EXCLUDE_FILTER::FILTER_DEFAULT), + percent(PUBLISHER_PERCENT_FILTER::FILTER_ALL_PERCENT), min_duration(0), reconcile_stamp(0) {} PublisherInfoFilter::PublisherInfoFilter(const PublisherInfoFilter& filter) : @@ -96,6 +97,7 @@ PublisherInfoFilter::PublisherInfoFilter(const PublisherInfoFilter& filter) : month(filter.month), year(filter.year), excluded(filter.excluded), + percent(filter.percent), order_by(filter.order_by), min_duration(filter.min_duration), reconcile_stamp(filter.reconcile_stamp) {}