Anope IRC Services  Version 2.0
regexpr.h
Go to the documentation of this file.
1 /*
2  *
3  * (C) 2003-2014 Anope Team
4  * Contact us at team@anope.org
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  *
11  */
12 
13 #ifndef REGEXPR_H
14 #define REGEXPR_H
15 
16 #include "services.h"
17 #include "anope.h"
18 #include "service.h"
19 
21 {
22  public:
23  RegexException(const Anope::string &reason = "") : CoreException(reason) { }
24 
25  virtual ~RegexException() throw() { }
26 };
27 
29 {
31  protected:
32  Regex(const Anope::string &expr) : expression(expr) { }
33  public:
34  virtual ~Regex() { }
35  const Anope::string &GetExpression() { return expression; }
36  virtual bool Matches(const Anope::string &str) = 0;
37 };
38 
40 {
41  public:
42  RegexProvider(Module *o, const Anope::string &n) : Service(o, "Regex", n) { }
43  virtual Regex *Compile(const Anope::string &) = 0;
44 };
45 
46 #endif // REGEXPR_H
47 
RegexException(const Anope::string &reason="")
Definition: regexpr.h:23
RegexProvider(Module *o, const Anope::string &n)
Definition: regexpr.h:42
virtual ~Regex()
Definition: regexpr.h:34
const Anope::string & GetExpression()
Definition: regexpr.h:35
Definition: regexpr.h:28
Regex(const Anope::string &expr)
Definition: regexpr.h:32
Anope::string expression
Definition: regexpr.h:30
virtual ~RegexException()
Definition: regexpr.h:25
#define CoreExport
Definition: services.h:62