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

Adding percent filter to PublisherInfoFilter #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
ryanml marked this conversation as resolved.
Show resolved Hide resolved
};

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