Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
Adding percent filter to PublisherInfoFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanml committed Dec 11, 2018
1 parent 7bd43e1 commit 2432021
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/bat/ledger/publisher_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -62,6 +67,7 @@ LEDGER_EXPORT struct PublisherInfoFilter {
PUBLISHER_MONTH month;
int year;
PUBLISHER_EXCLUDE_FILTER excluded;
PUBLISHER_PERCENT_FILTER percent;
std::vector<std::pair<std::string, bool>> order_by;
unsigned int min_duration;
uint64_t reconcile_stamp;
Expand Down
2 changes: 2 additions & 0 deletions src/bat/ledger/ledger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) :
Expand All @@ -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) {}
Expand Down

0 comments on commit 2432021

Please sign in to comment.