source: CMT/v1r14p20031120/src/cmt_regexp.h @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 914 bytes
Line 
1#ifndef __cmt_regexp_h__
2#define __cmt_regexp_h__
3
4#include "cmt_string.h"
5
6class cmt_regexp_node;
7
8class cmt_regexp
9{
10public:
11  cmt_regexp ();
12  cmt_regexp (const cmt_string& expression);
13  ~cmt_regexp ();
14
15  void set (const cmt_string& expression);
16
17  bool is_valid () const;
18 
19  class iterator
20  {
21public:
22    static const iterator null ();
23   
24public:
25    iterator ();
26    iterator (int pos, int length);
27    iterator (const iterator& other);
28   
29    int operator != (const iterator& other) const;
30    int operator == (const iterator& other) const;
31   
32    int _pos;
33    int _length;
34  };
35 
36  iterator begin (const cmt_string& text, int pos = 0);
37  iterator end ();
38 
39  iterator begin (const cmt_string& text, int pos = 0) const;
40  iterator end () const;
41
42  bool match (const cmt_string& text) const;
43 
44private:
45 
46  cmt_regexp_node* _root;
47};
48
49#endif
50
Note: See TracBrowser for help on using the repository browser.