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 <vector>
9 #include <regex.h>
10 
11 namespace Arc {
12 
14 
18  public:
19 
22 
24 
27  RegularExpression(std::string pattern, bool ignoreCase = false);
28 
31 
34 
37 
39  bool isOk();
40 
42  bool hasPattern(std::string str);
43 
45  bool match(const std::string& str) const;
46 
48 
54  bool match(const std::string& str, std::list<std::string>& unmatched, std::list<std::string>& matched) const;
55 
57 
67  bool match(const std::string& str, std::vector<std::string>& matched) const;
68 
70  std::string getPattern() const;
71 
72  private:
73  std::string pattern;
74  regex_t preg;
75  int status;
76  };
77 }
78 
79 #endif