CoxIter  1.2
CoxIter - Computing invariants of hyperbolic Coxeter groups
regexp.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2013, 2014
3 Rafael Guglielmetti, rafael.guglielmetti@unifr.ch
4 */
5 
6 /*
7 This file is part of CoxIter and AlVin.
8 
9 CoxIter is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as
11 published by the Free Software Foundation, either version 3 of the
12 License, or (at your option) any later version.
13 
14 CoxIter is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with CoxIter. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
30 #include <string>
31 #include <iostream>
32 #include <vector>
33 
34 #include <pcre.h>
35 
36 using namespace std;
37 
38 #ifndef __REGEXP_H__
39 #define __REGEXP_H__
40 
41 #include <stdexcept> // std::invalid_argument // TODO: remove
42 
43 typedef vector< vector< string > > PCREResult;
44 
46 {
47  private:
48  string strError;
49  bool bClassUsed;
50 
51  pcre *regexp;
52  const char *regPattern;
53  const char *regSubject;
54  const char *regError;
55 
58 
59  int *ovector;
61 
62  public:
63  PCRERegexp( int iOvectorSize = 30 );
64  ~PCRERegexp( );
65 
74  int preg_match_all( const string &pattern, const string &subject, PCREResult &results, const int& optionsCompile = 0 );
75 
80  string get_strError( );
81 };
82 
83 #endif
pcre * regexp
Definition: regexp.h:51
vector< vector< string > > PCREResult
Definition: regexp.h:43
Definition: regexp.h:45
int * ovector
Information about the result.
Definition: regexp.h:59
const char * regPattern
Definition: regexp.h:52
int regSubjectLength
Definition: regexp.h:57
const char * regError
Definition: regexp.h:54
const char * regSubject
Definition: regexp.h:53
int iOvectorSize
Size of the ovector array.
Definition: regexp.h:60
int regErrorOffset
Definition: regexp.h:56
bool bClassUsed
True if the class was used.
Definition: regexp.h:49
string strError
Eventually, error code.
Definition: regexp.h:48