-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathregexp.h
More file actions
53 lines (45 loc) · 1.13 KB
/
regexp.h
File metadata and controls
53 lines (45 loc) · 1.13 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
/*
* regexp.h: Regular expression list item
*
* See the README file for copyright information and how to reach the author.
*
*/
#ifndef __EPGFIXER_REGEXP_H_
#define __EPGFIXER_REGEXP_H_
#ifdef HAVE_PCRE2POSIX
#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>
#endif
#include <vdr/epg.h>
#include <vdr/tools.h>
#include "tools.h"
typedef enum { REGEXP_TITLE, REGEXP_SHORTTEXT, REGEXP_DESCRIPTION, REGEXP_UNDEFINED } sources;
class cRegexp : public cListItem
{
private:
char *cregexp;
char *regexp;
char *replacement;
int replace;
int cmodifiers;
int modifiers;
int csource;
int source;
pcre2_code *cre;
pcre2_code *re;
void Compile();
void FreeCompiled();
int ParseModifiers(char *modstring, int substitution = 0);
void ParseRegexp(char *restring);
public:
cRegexp();
virtual ~cRegexp();
using cListItem::Apply;
virtual bool Apply(cEvent *Event, tChannelID ChannelID = tChannelID());
void SetFromString(char *string, bool Enabled);
int GetSource() { return source; };
void ToggleEnabled(void);
};
// Global instance
extern cEpgfixerList<cRegexp, cEvent> EpgfixerRegexps;
#endif //__EPGFIXER_REGEXP_H_