From 9063da1f2e1cb8a551eb5cac4715d73bb4c79dc3 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:04:37 +0000 Subject: Utilisateur : Fcolin Date : 16/06/00 Heure : 10:14 Créé (vss 1) --- Bus/Ivy/Regexp.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Bus/Ivy/Regexp.h (limited to 'Bus/Ivy') diff --git a/Bus/Ivy/Regexp.h b/Bus/Ivy/Regexp.h new file mode 100644 index 0000000..22e2699 --- /dev/null +++ b/Bus/Ivy/Regexp.h @@ -0,0 +1,44 @@ +#ifndef __REGEXP_H__ +#define __REGEXP_H__ + + +class regexp; + +class Regexp +{ +public: + enum { NSUBEXP = 20 }; + + Regexp(); + Regexp( const char * exp, bool iCase = 0 ); + Regexp( const Regexp &r ); + ~Regexp(); + const Regexp & operator=( const Regexp & r ); + + bool Match( const char * s ); + int SubStrings() const; + + const string operator[]( unsigned int i ) const; + int SubStart( unsigned int i ) const; + int SubLength( unsigned int i ) const; + + string GetReplaceString( const char * source ) const; + + string GetErrorString() const; + bool CompiledOK() const; + +#if defined( _RE_DEBUG ) + void Dump(); +#endif +private: + const char * str; /* used to return substring offsets only */ + mutable string m_szError; + regexp * rc; + + void ClearErrorString() const; + int safeIndex( unsigned int i ) const; + +}; + +#endif + -- cgit v1.1