ARC SDK
ArcRegex.h
1 // -*- indent-tabs-mode: nil -*-
2 
3 #ifndef __ARC_REGEX_H__
4 #define __ARC_REGEX_H__
5 
6 #include <list>
7 #include <string>
8 #include <regex.h>
9 
10 namespace Arc {
11 
13 
17  public:
18 
20  RegularExpression() : status(-1) {}
21 
23  RegularExpression(std::string pattern);
24 
27 
30 
33 
35  bool isOk();
36 
38  bool hasPattern(std::string str);
39 
41  bool match(const std::string& str) const;
42 
44 
50  bool match(const std::string& str, std::list<std::string>& unmatched, std::list<std::string>& matched) const;
51 
53  std::string getPattern() const;
54 
55  private:
56  std::string pattern;
57  regex_t preg;
58  int status;
59  };
60 }
61 
62 #endif