summaryrefslogtreecommitdiff
path: root/src/regex.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-01-07 00:24:08 +0000
committerMike Buland <eichlan@xagasoft.com>2010-01-07 00:24:08 +0000
commit17c92cf5b2b0dfdfdbbdb5c41354634ca98ae1b4 (patch)
tree7109629e83314cf73be9233b6a3a3c70031eff94 /src/regex.h
parent2dd476ff6dc904174446f269eeb97ccf9ed8c379 (diff)
downloadlibbu++-17c92cf5b2b0dfdfdbbdb5c41354634ca98ae1b4.tar.gz
libbu++-17c92cf5b2b0dfdfdbbdb5c41354634ca98ae1b4.tar.bz2
libbu++-17c92cf5b2b0dfdfdbbdb5c41354634ca98ae1b4.tar.xz
libbu++-17c92cf5b2b0dfdfdbbdb5c41354634ca98ae1b4.zip
Added a new class, RegEx, it does extended regular expressions for now, more to
come.
Diffstat (limited to 'src/regex.h')
-rw-r--r--src/regex.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/regex.h b/src/regex.h
new file mode 100644
index 0000000..11ff9f0
--- /dev/null
+++ b/src/regex.h
@@ -0,0 +1,37 @@
1#ifndef BU_REG_EX_H
2#define BU_REG_EX_H
3
4#include "bu/fstring.h"
5
6#include <stdint.h>
7
8namespace Bu
9{
10 class RegEx
11 {
12 public:
13 RegEx();
14 RegEx( const Bu::FString &sSrc );
15 virtual ~RegEx();
16
17 void compile( const Bu::FString &sSrc );
18 int getNumSubStrings();
19 bool execute( const Bu::FString &sSrc );
20 void getSubStringRange( int nIndex, int &iStart, int &iEnd );
21 Bu::FString getSubString( int nIndex );
22 const Bu::FString &getSource()
23 {
24 return sSrc;
25 }
26
27 private:
28 Bu::FString sSrc;
29 Bu::FString sTest;
30 void *pRegEx;
31 bool bCompiled;
32 int nSubStr;
33 void *paSubStr;
34 };
35};
36
37#endif