diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-08-23 22:09:30 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-08-23 22:09:30 +0000 |
commit | d2fe7edb2bfea20987a1f69935179fa5fc9f3b37 (patch) | |
tree | ee35479f264788bf43b7904f31a528699b53e955 /src/regexp.h | |
parent | 7a7390337e04d0163b97c1da7bdaa198bacaff72 (diff) | |
download | build-d2fe7edb2bfea20987a1f69935179fa5fc9f3b37.tar.gz build-d2fe7edb2bfea20987a1f69935179fa5fc9f3b37.tar.bz2 build-d2fe7edb2bfea20987a1f69935179fa5fc9f3b37.tar.xz build-d2fe7edb2bfea20987a1f69935179fa5fc9f3b37.zip |
Really close...functions are doing their stuff, we have inputs, almost have rules.
Diffstat (limited to 'src/regexp.h')
-rw-r--r-- | src/regexp.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/regexp.h b/src/regexp.h new file mode 100644 index 0000000..96f3747 --- /dev/null +++ b/src/regexp.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef REG_EXP_H | ||
2 | #define REG_EXP_H | ||
3 | |||
4 | #include <string> | ||
5 | #include <stdint.h> | ||
6 | #include <regex.h> | ||
7 | #include <utility> | ||
8 | #include "staticstring.h" | ||
9 | |||
10 | class RegExp | ||
11 | { | ||
12 | public: | ||
13 | RegExp(); | ||
14 | RegExp( const char *sSrc ); | ||
15 | virtual ~RegExp(); | ||
16 | |||
17 | void compile( const char *sSrc ); | ||
18 | int getNumSubStrings(); | ||
19 | bool execute( const char *sSrc ); | ||
20 | std::pair<int,int> getSubStringRange( int nIndex ); | ||
21 | std::string getSubString( int nIndex ); | ||
22 | const char *getSource() | ||
23 | { | ||
24 | return sSrc; | ||
25 | } | ||
26 | |||
27 | private: | ||
28 | StaticString sSrc; | ||
29 | StaticString sTest; | ||
30 | regex_t re; | ||
31 | bool bCompiled; | ||
32 | int nSubStr; | ||
33 | regmatch_t *aSubStr; | ||
34 | }; | ||
35 | |||
36 | #endif | ||