-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathre8map.h
52 lines (39 loc) · 1.46 KB
/
re8map.h
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
#ifndef _H_RE8MAP
#define _H_RE8MAP
#include <phpcpp.h>
#include "pcre8_imp.h"
namespace pun {
class Re8map : public Php::Base {
public:
static const char* PHP_NAME;
static void setup_ext(Php::Extension& ext);
Re8map();
~Re8map();
// Install PCRE2 String, Return integer id, the first parameter.
Php::Value setPreg(Php::Parameters& params);
// Has key value in map
Php::Value hasPreg(Php::Parameters& params) const;
// Remove key value and expression data from map
Php::Value unsetPreg(Php::Parameters& params);
// Return a new Pcre8 object by Id
Php::Value getPreg(Php::Parameters& params);
// Two parameters, Array of integer keys, and
// another Re8map object.
// The compiled Re are shared with this map.
// Key PCRE2 already in this map won't be re-copied over.
Php::Value addMapIds(Php::Parameters& params);
// Get unordered array of integer id's in map
Php::Value getIds() const;
Php::Value count() const;
/*! function firstMatch(UStr8|string, Recap8, IntList|Array) : integer;
Return number of captures.
Recap8 object used to store captures.
List of Ids, to order and select match tries
*/
Php::Value firstMatch(Php::Parameters& params);
const Re8map_share& getImp() { return _remap;}
public: // PHP cannot see this
Re8map_share _remap;
};
};
#endif