00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef REGEXP_H
00013 #define REGEXP_H
00014
00015 #include "assa/Assure.h"
00016 #include <sys/types.h>
00017
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00022 #include <regex.h>
00023
00024 #ifdef __cplusplus
00025 }
00026 #endif
00027
00028
00029 #include <string>
00030
00031 namespace ASSA {
00032
00043 class Regexp {
00044 public:
00048 Regexp (const std::string& pattern_);
00049
00053 ~Regexp ();
00054
00060 int match (const char* text_);
00061
00064 const char* get_error () const { return m_error_msg; }
00065
00068 const char* get_pattern () const { return m_pattern; }
00069
00070 private:
00071 char* m_pattern;
00072 char* m_error_msg;
00073 regex_t* m_compiled_pattern;
00074 };
00075 }
00076
00077 #endif
00078
00079
00080