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
Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
bool match(const std::string &str) const
Returns true if this regex matches whole string provided.
bool isOk()
Returns true if the pattern of this regex is ok.
std::string getPattern() const
Returns pattern.
bool hasPattern(std::string str)
Returns true if this regex has the pattern provided.
RegularExpression()
Default constructor.
~RegularExpression()
Destructor.
RegularExpression & operator=(const RegularExpression &regex)
Assignment operator.
A regular expression class.
Definition: ArcRegex.h:17