/* * CENA C++ Utilities * * by Stephane Chatty * * Copyright 1991 - 1996 * 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" #if defined(__hpux) || (defined (sun) && defined (__svr4__)) /* POSIX */ #define REGCOMP #else #if 1 /* I'm not aware of systems that use regcmp anymore */ #define RE_COMP #endif #endif #ifdef REGCOMP /* POSIX version of regular expressions */ class IvlRegExp { private: const char* String; void* Compiled; public: inline IvlRegExp (const char* s) : String (s), Compiled (0) {} ~IvlRegExp (); bool Compile (); bool Match (const char*); inline const char* GetExpr () {return String;} }; #endif /* REGCOMP */ #ifdef RE_COMP class IvlRegExp { private: const char* String; static IvlRegExp* Compiled; public: inline IvlRegExp (const char* s) : String (s) {} inline ~IvlRegExp () {}; bool Compile (); bool Match (const char*); inline const char* GetExpr () {return String;} }; #endif /* RE_COMP */ #if !defined(REGCOMP) && !defined(RE_COMP) class IvlRegExp { private: const char* String; char* Compiled; public: inline IvlRegExp (const char* s) : String (s), Compiled (0) {} ~IvlRegExp (); bool Compile (); bool Match (const char*); inline const char* GetExpr () { return String; } }; #endif /* !REGCOMP && !RE_COMP */ #endif /* RegExp_H_ */