Back to index

courier  0.68.2
rematch.h
Go to the documentation of this file.
00001 #ifndef       rematch_h
00002 #define       rematch_h
00003 
00004 
00005 #include      "config.h"
00006 #include      <sys/types.h>
00007 // #include   <unistd.h>
00008 
00010 //
00011 // ReMatch is an abstract class used in matching text against regular
00012 // expression.  The matched text may come from a memory buffer, or a file.
00013 // The matching logic does not care, and uses an abstracted data source,
00014 // represented by this class, which supplies the text being matched,
00015 // character by character.
00016 //
00017 // Also, in order to support the '!' operator, GetCurrentPos() and
00018 // SetCurrentPos() functions must be implemented as a rudimentary "seek"
00019 // mechanism.
00020 //
00022 
00023 class ReMatch {
00024 public:
00025        ReMatch()     {}
00026        virtual ~ReMatch();
00027 
00028        virtual int NextChar()=0;
00029        virtual int CurrentChar()=0;
00030        virtual off_t GetCurrentPos()=0;
00031        virtual void SetCurrentPos(off_t)=0;
00032 } ;
00033 #endif