My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
RegExpParser.h
Go to the documentation of this file.
1 #ifndef GCP_UTIL_REGEXPPARSER_H
2 #define GCP_UTIL_REGEXPPARSER_H
3 
11 #include <string>
12 
13 namespace gcp {
14  namespace util {
15 
16  class RegExpParser {
17  public:
18 
22  RegExpParser(std::string regexp);
23 
27  virtual ~RegExpParser();
28 
34  bool matches(std::string matchString);
35 
36  private:
37 
38  // The reg exp string to match
39 
40  std::string regExpString_;
41 
42  // Utility pointer to the above
43 
44  char* regExpPtr_;
45 
46  // Private recursion method for matching a string
47 
48  bool matches(char* matchString);
49 
65  bool matchSingle(char *start_ptr, char *end_ptr, char ch);
66 
77  char getNextChar(char *string, char **tail, bool& wasEscaped);
78 
79  }; // End class RegExpParser
80 
81  } // End namespace util
82 } // End namespace gcp
83 
84 
85 
86 
87 #endif // End #ifndef GCP_UTIL_REGEXPPARSER_H
RegExpParser(std::string regexp)
Definition: RegExpParser.cc:15
Definition: RegExpParser.h:16
bool matches(std::string matchString)
virtual ~RegExpParser()
Definition: RegExpParser.cc:23