summaryrefslogtreecommitdiffstats
path: root/maildrop/rematch.h
blob: 25c520245a601ea3454185b6b249ee23eb63893f (plain)
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
#ifndef	rematch_h
#define	rematch_h


#include	"config.h"
#include	<sys/types.h>
// #include	<unistd.h>

////////////////////////////////////////////////////////////////////////////
//
// ReMatch is an abstract class used in matching text against regular
// expression.  The matched text may come from a memory buffer, or a file.
// The matching logic does not care, and uses an abstracted data source,
// represented by this class, which supplies the text being matched,
// character by character.
//
// Also, in order to support the '!' operator, GetCurrentPos() and
// SetCurrentPos() functions must be implemented as a rudimentary "seek"
// mechanism.
//
////////////////////////////////////////////////////////////////////////////

class ReMatch {
public:
	ReMatch()	{}
	virtual ~ReMatch();

	virtual int NextChar()=0;
	virtual int CurrentChar()=0;
	virtual off_t GetCurrentPos()=0;
	virtual void SetCurrentPos(off_t)=0;
} ;
#endif