summaryrefslogtreecommitdiff
path: root/Ivy
diff options
context:
space:
mode:
authorfcolin2007-02-01 13:04:37 +0000
committerfcolin2007-02-01 13:04:37 +0000
commit3f3f2e621789c3c65eb10d3ee937c047c5a46857 (patch)
treefd60fc2ad9eb6f0912360148e6d8228615f6661d /Ivy
parente6dbff317adc5b2dc6d174128f3f9d6177cf1207 (diff)
downloadivy-cplusplus-3f3f2e621789c3c65eb10d3ee937c047c5a46857.zip
ivy-cplusplus-3f3f2e621789c3c65eb10d3ee937c047c5a46857.tar.gz
ivy-cplusplus-3f3f2e621789c3c65eb10d3ee937c047c5a46857.tar.bz2
ivy-cplusplus-3f3f2e621789c3c65eb10d3ee937c047c5a46857.tar.xz
Utilisateur : Fcolin Date : 16/06/00 Heure : 10:14 Créé (vss 1)
Diffstat (limited to 'Ivy')
-rw-r--r--Ivy/Regexp.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/Ivy/Regexp.h b/Ivy/Regexp.h
new file mode 100644
index 0000000..22e2699
--- /dev/null
+++ b/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
+