summaryrefslogtreecommitdiff
path: root/utils/RegExp.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/RegExp.h')
-rw-r--r--utils/RegExp.h81
1 files changed, 81 insertions, 0 deletions
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_ */
+