-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilter.h
More file actions
75 lines (62 loc) · 1.3 KB
/
Filter.h
File metadata and controls
75 lines (62 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Copyright ©2017 NagraFrance
*/
#ifndef CPAD__FILTER_H_
#define CPAD__FILTER_H_
#include <string>
#include <regex>
using namespace std;
namespace cpad
{
enum FilterType
{
REGEXP = 1,
WILDCARD = 2,
EXPR = 3
};
enum FilterApplyOn
{
APPLYON_FILENAME = 1,
APPLYON_BASENAME = 2,
APPLYON_DIRNAME = 3,
APPLYON_EXTENSION = 4,
APPLYON_MIMETYPE = 5,
APPLYON_SIZE = 6,
APPLYON_MDATE = 7,
APPLYON_CDATE = 8,
APPLYON_NUMBERS = 9
};
const char *FilterApplyOn_str[cpad::APPLYON_NUMBERS+1] =
{
/*0*/ "",
/*1*/ "filename",
/*2*/ "basename",
/*3*/ "dirname",
/*4*/ "extension",
/*5*/ "mimetype",
/*6*/ "size",
/*7*/ "mdate",
/*8*/ "cdate",
/*9*/ NULL
};
class Filter
{
public:
Filter(enum FilterType type);
Filter(enum FilterType type, char const* expr);
virtual ~Filter();
Filter(Filter const&);
Filter& operator = (Filter const&);
Filter& operator != (Filter const&);
enum FilterType get_type();
const char *get_expr();
string get_applyon();
void set_applyon(string applyon);
private:
enum FilterType m_type;
string m_filter_expr;
regex m_filter_regexp;
string m_applyon;
};
}
#endif