-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilter.h
More file actions
22 lines (18 loc) · 676 Bytes
/
Copy pathfilter.h
File metadata and controls
22 lines (18 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef FILTER_H_
#define FILTER_H_
#include <set>
#include <functional>
namespace worklog {
struct Filter {
std::set<std::string> tags;
std::set<std::string> tags_negative;
std::string subject;
};
Filter ParseFilter(const std::string& text);
void ApplyFilter(std::function<bool(const worklog::Log&)> apply_func, std::vector<worklog::Log>* logs);
std::function<bool(const worklog::Log&)> SubjectFilter(const Filter& filter);
std::function<bool(const worklog::Log&)> TagsFilter(const Filter& filter);
std::function<bool(const worklog::Log&)> OnlyValidFilter();
std::function<bool(const worklog::Log&)> OnlyInvalidFilter();
} // namespace worklog
#endif // FILTER_H_