From 3a4838bed13b767132cbdf06364b2658da6cc356 Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 15 Dec 1992 10:55:33 +0000 Subject: Initial revision --- utils/RegExp.h | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 utils/RegExp.h (limited to 'utils/RegExp.h') diff --git a/utils/RegExp.h b/utils/RegExp.h new file mode 100644 index 0000000..c46431c --- /dev/null +++ b/utils/RegExp.h @@ -0,0 +1,81 @@ +/* + * CENA C++ Utilities + * + * by Stephane Chatty + * + * Copyright 1991, 1992 + * Laboratoire de Recherche en Informatique (LRI) + * Centre d'Etudes de la Navigation Aerienne (CENA) + * + * Regular expressions + * + * $Id$ + * $CurLog$ + */ + +#ifndef RegExp_H_ +#define RegExp_H_ + +#include "cplus_bugs.h" +#include "bool.h" + +#ifdef __hpux +#define REGCOMP +#else +#define RE_COMP +#endif + +#ifdef REGCOMP + +/* POSIX version of regular expressions */ + +class CcuRegExp { +private: + const char* String; + void* Compiled; +public: +inline CcuRegExp (const char* s) : String (s), Compiled (0) {} + ~CcuRegExp (); + bool Compile (); + bool Match (const char*); +inline const char* GetExpr () {return String;} +}; + +#endif /* REGCOMP */ + +#ifdef RE_COMP + +class CcuRegExp { +private: + const char* String; +static CcuRegExp* Compiled; + +public: +inline CcuRegExp (const char* s) : String (s) {} +inline ~CcuRegExp () {}; + bool Compile (); + bool Match (const char*); +inline const char* GetExpr () {return String;} +}; + +#endif /* RE_COMP */ + +#if !defined(REGCOMP) && !defined(RE_COMP) + +class CcuRegExp { +private: + const char* String; + char* Compiled; + +public: +inline CcuRegExp (const char* s) : String (s), Compiled (0) {} + ~CcuRegExp (); + bool Compile (); + bool Match (const char*); +inline const char* GetExpr () { return String; } +}; + +#endif /* !REGCOMP && !RE_COMP */ + +#endif /* RegExp_H_ */ + -- cgit v1.1