From 17c92cf5b2b0dfdfdbbdb5c41354634ca98ae1b4 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 7 Jan 2010 00:24:08 +0000 Subject: Added a new class, RegEx, it does extended regular expressions for now, more to come. --- src/regex.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/regex.h (limited to 'src/regex.h') 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 @@ +#ifndef BU_REG_EX_H +#define BU_REG_EX_H + +#include "bu/fstring.h" + +#include + +namespace Bu +{ + class RegEx + { + public: + RegEx(); + RegEx( const Bu::FString &sSrc ); + virtual ~RegEx(); + + void compile( const Bu::FString &sSrc ); + int getNumSubStrings(); + bool execute( const Bu::FString &sSrc ); + void getSubStringRange( int nIndex, int &iStart, int &iEnd ); + Bu::FString getSubString( int nIndex ); + const Bu::FString &getSource() + { + return sSrc; + } + + private: + Bu::FString sSrc; + Bu::FString sTest; + void *pRegEx; + bool bCompiled; + int nSubStr; + void *paSubStr; + }; +}; + +#endif -- cgit v1.2.3