summaryrefslogtreecommitdiff
path: root/regexp.h
diff options
context:
space:
mode:
authorMatti Lehtimäki <matti.lehtimaki@gmail.com>2012-05-04 00:20:23 +0300
committerMatti Lehtimäki <matti.lehtimaki@gmail.com>2012-05-04 00:20:23 +0300
commit8877487555503d3615a4b17f9a9809fec2e28944 (patch)
tree42b7ecf8ce45923217d9403475d9c83e6ed4bd7d /regexp.h
parent5fb133a99f38083a421dc0a33acb58a1fa674876 (diff)
downloadvdr-plugin-epgfixer-8877487555503d3615a4b17f9a9809fec2e28944.tar.gz
vdr-plugin-epgfixer-8877487555503d3615a4b17f9a9809fec2e28944.tar.bz2
Fix last commit.
Diffstat (limited to 'regexp.h')
-rw-r--r--regexp.h55
1 files changed, 12 insertions, 43 deletions
diff --git a/regexp.h b/regexp.h
index 57d69ba..3016c4c 100644
--- a/regexp.h
+++ b/regexp.h
@@ -1,5 +1,5 @@
/*
- * regexp.h: Regular expression list
+ * regexp.h: Regular expression list item
*
* See the README file for copyright information and how to reach the author.
*
@@ -8,68 +8,37 @@
#ifndef _REGEXP_H_
#define _REGEXP_H_
+#include "tools.h"
+#include <vdr/epg.h>
#include <vdr/tools.h>
+#include <stdio.h>
#ifdef HAVE_PCREPOSIX
#include <pcre.h>
#endif
typedef enum { REGEXP_TITLE,REGEXP_SHORTTEXT,REGEXP_DESCRIPTION,REGEXP_UNDEFINED } sources;
-extern const char *strSources[];
-class cRegexp : public cListObject
+class cRegexp : public cListItem
{
private:
- bool enabled;
char *regexp;
- char *string;
- int *channels_num;
- char **channels_str;
- int numchannels;
int source;
pcre *re;
pcre_extra *sd;
- void Free();
+ void Compile();
+ void FreeCompiled();
public:
cRegexp();
- cRegexp(int Source, const char *Regex, bool Enabled, bool Precompile);
virtual ~cRegexp();
- void SetFromString(char *string, bool Enabled, bool Precompile);
- const char *GetString() { return string; }
- void Compile();
- void FreeCompiled();
- bool Enabled(void) { return enabled; }
+ bool Apply(cEvent *Event);
+ void SetFromString(char *string, bool Enabled);
+ int GetSource() { return source; };
void ToggleEnabled(void);
- int NumChannels() { return numchannels; }
- int GetChannelNum(int index);
- const char *GetChannelID(int index);
- int GetSource(void) { return source; }
- pcre *GetRe(void) { return re; }
- pcre_extra *GetSd(void) { return sd; }
-};
-
-class cRegexpList : public cList<cRegexp>
-{
-public:
- void Clear(void) { cList<cRegexp>::Clear(); }
- cRegexpList(void) {}
-};
-
-class cEpgfixerRegexps
-{
-private:
- bool LoadRegexps(const char *FileName = NULL, bool AllowComments = true, bool Precompile = true);
- char *fileName;
-public:
- cRegexpList *regexps;
- cEpgfixerRegexps();
- ~cEpgfixerRegexps();
- void SetRegexpConfigFile(const char *FileName);
- const char *RegexpConfigFile();
- bool ReloadRegexps(bool AllowComments = true, bool Precompile = true);
+ virtual void PrintConfigLineToFile(FILE *f);
};
// Global instance
-extern cEpgfixerRegexps EpgfixerRegexps;
+extern cEpgfixerList<cRegexp> EpgfixerRegexps;
#endif //_REGEXP_H_