diff options
Diffstat (limited to 'event.h')
-rw-r--r-- | event.h | 33 |
1 files changed, 27 insertions, 6 deletions
@@ -8,10 +8,7 @@ #ifndef VDR_BLOCK_EVENT_H #define VDR_BLOCK_EVENT_H -#include <sys/types.h> #include <regex.h> - -#include <vdr/tools.h> #include <vdr/config.h> #define EVLINELENGTH 256 @@ -24,7 +21,8 @@ private: int mRegularExp; int mIgnoreCase; bool mCompiled; - + int whitelisted; + regex_t mExpression; public: @@ -34,22 +32,45 @@ public: ~cEventBlock(); cEventBlock &operator=(const cEventBlock &Src); + bool operator==(const cEventBlock Src); + - bool Acceptable(const char *Event) const ; + bool doesMatch(const char *Event) const ; + const int isWhitelisted(void) const {return whitelisted;} + void setWhitelisted(const bool b) {whitelisted=b;} + bool IgnoreCase(void) const {return mIgnoreCase;} + void setIgnoreCase(const bool b) {mIgnoreCase=b;} bool Parse(char *s); bool Compile(void); bool Save(FILE *f); static const char *LastTitle; + static const bool *ReplayingRecording; - + + static char *duptolower(const char*); + const char *Pattern(void) const { return mPattern; } + + virtual int Compare(const cListObject &src) const + { + cEventBlock* rhs=(cEventBlock*)&src; + char* l=cEventBlock::duptolower(mPattern); + char* r=cEventBlock::duptolower(rhs->mPattern); + return strcmp(l,r); }//TODO check if the code relies on this because in fact we have to return !strcmp(r,l) here!!! }; class cEventsBlock : public cConfig<cEventBlock> { +private: +// int recursive_pos_seek (char *pattern, int start); + public: bool Acceptable(const char *Event); cEventsBlock &operator=(const cEventsBlock &Source); + void ListMatches (const char *src, cVector <cEventBlock*> *match_vec, cEventBlock &stringmatch); + void ListMatches (const char *src, cVector <cEventBlock*> *match_vec); + cEventBlock* hasStringMatch(const char* src, bool ignorecase=false); + int getIndexOf(cEventBlock *Src); }; extern cEventsBlock EventsBlock; |