blob: 38d65335a4f5b35a3850a37d10811d1a198ce0c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/*
* 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
#include <pcre.h>
#else /* we don't USE_PCRE */
#define MAX_MSG_FIELDS 200
#include "Regexp.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
#ifdef _DEBUG
std::string expression_string;
#endif
pcre *regexp;
pcre_extra *inspect;
int ovectorsize;
int* ovector;
#else /* we don't USE_PCRE */
Regexp *regexp; /* la regexp sous forme machine */
//regmatch_t match[MAX_MSG_FIELDS+1]; /* resultat du match */
#endif /* USE_PCRE */
int nb_match;
};
|