DeviceAtlas C++ Api documentation
regex.h
1 #ifndef MTLD_REGEX_H
2 #define MTLD_REGEX_H
3 #include <string>
4 #include <stdlib.h>
5 #include <pcre.h>
6 
7 namespace Mobi { namespace Mtld { namespace Da {
8 struct REImpl;
9 
10 class REInfo {
11  REImpl *impl;
12 public:
13  struct REMatch { size_t start; size_t end; };
14  std::string pattern;
15  ~REInfo();
16  REMatch match(const char *data, size_t length, int flags) const {
17  REMatch res;
18  if (!match(data, length, flags, &res, 1)) {
19  res.start = -1;
20  res.end = -1;
21  }
22  return res;
23  }
24  bool match(const char *data, size_t length, int flags, REMatch *matches, size_t maxMatches) const;
25  REInfo(std::string pattern_);
26 };
27 }}}
28 #endif
Definition: regex.h:13
Definition: binary.h:13
Definition: regex.cpp:13
Definition: regex.h:10