anope

- supernets anope source code & configuration
git clone git://git.acid.vegas/anope.git
Log | Files | Refs | Archive | README

regexpr.h (999B)

      1 /*
      2  *
      3  * (C) 2003-2022 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 #ifndef REGEXPR_H
     13 #define REGEXPR_H
     14 
     15 #include "services.h"
     16 #include "anope.h"
     17 #include "service.h"
     18 
     19 class RegexException : public CoreException
     20 {
     21  public:
     22 	RegexException(const Anope::string &reason = "") : CoreException(reason) { }
     23 
     24 	virtual ~RegexException() throw() { }
     25 };
     26 
     27 class CoreExport Regex
     28 {
     29 	Anope::string expression;
     30  protected:
     31 	Regex(const Anope::string &expr) : expression(expr) { }
     32  public:
     33 	virtual ~Regex() { }
     34 	const Anope::string &GetExpression() { return expression; }
     35 	virtual bool Matches(const Anope::string &str) = 0;
     36 };
     37 
     38 class CoreExport RegexProvider : public Service
     39 {
     40  public:
     41 	RegexProvider(Module *o, const Anope::string &n) : Service(o, "Regex", n) { }
     42 	virtual Regex *Compile(const Anope::string &) = 0;
     43 };
     44 
     45 #endif // REGEXPR_H