summaryrefslogtreecommitdiff
path: root/Ivy/IvyBinding.h
diff options
context:
space:
mode:
authorfcolin2007-02-01 13:01:09 +0000
committerfcolin2007-02-01 13:01:09 +0000
commit741e6a814b53154a9b55a24de6fcb941af290439 (patch)
treeec2859fd048d8adf966617e6c01769608ee216ed /Ivy/IvyBinding.h
parent92fc57ceb4fb03e732a2edeef701922a3f570ddc (diff)
downloadivy-cplusplus-741e6a814b53154a9b55a24de6fcb941af290439.zip
ivy-cplusplus-741e6a814b53154a9b55a24de6fcb941af290439.tar.gz
ivy-cplusplus-741e6a814b53154a9b55a24de6fcb941af290439.tar.bz2
ivy-cplusplus-741e6a814b53154a9b55a24de6fcb941af290439.tar.xz
Utilisateur : Fcolin Date : 1/06/06 Heure : 15:54 Créé Commentaire: Separation module de traitement regexp (vss 1)
Diffstat (limited to 'Ivy/IvyBinding.h')
-rw-r--r--Ivy/IvyBinding.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/Ivy/IvyBinding.h b/Ivy/IvyBinding.h
new file mode 100644
index 0000000..44a87ee
--- /dev/null
+++ b/Ivy/IvyBinding.h
@@ -0,0 +1,58 @@
+/*
+ * Ivy, C interface
+ *
+ * Copyright (C) 1997-2006
+ * Centre d'Études de la Navigation Aérienne
+ *
+ * Bind syntax for extracting message comtent
+ * using regexp or other
+ *
+ * Authors: François-Régis Colin <fcolin@cena.fr>
+ *
+ * $Id: ivybind.h,v 1.5.2.3 2006/04/21 15:51:55 fcolin Exp $
+ *
+ * Please refer to file version.h for the
+ * copyright notice regarding this software
+ */
+/* Module de gestion de la syntaxe des messages Ivy */
+#pragma once
+
+#define USE_PCRE
+
+#ifdef USE_PCRE
+#define OVECSIZE 60 /* must be multiple of 3, for regexp return */
+#include <pcre.h>
+#else /* we don't USE_PCRE */
+#define MAX_MSG_FIELDS 200
+#include "Regex.h"
+#endif /* USE_PCRE */
+
+class IvyBinding
+{
+public:
+ /* Creation, Compilation */
+ IvyBinding();
+ ~IvyBinding();
+
+ /* Mise en place des Filtrages */
+ static void SetFilter( int argc, const char ** argv );
+ static int Filter( const char *expression );
+
+ /* Creation, Compilation */
+ bool Compile( const char *expression, int *erroffset, const char **errmessage );
+ /* Execution , extraction */
+ int Exec( const char * message );
+ void Match( const char *message, int argnum, int *arglen, const char **arg );
+
+private:
+#ifdef USE_PCRE
+ pcre *regexp;
+ pcre_extra *inspect;
+ int nb_match;
+ int ovector[OVECSIZE];
+#else /* we don't USE_PCRE */
+ regex_t regexp; /* la regexp sous forme machine */
+ regmatch_t match[MAX_MSG_FIELDS+1]; /* resultat du match */
+#endif /* USE_PCRE */
+
+}; \ No newline at end of file