From 818cf866da84841e0f46c8f7b717b18926032f25 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 25 Feb 2006 02:43:03 +0000 Subject: Patch from Greg Smith with further modifications moved character classification from Document into a separate CharClassify class and file and uses this from RESearch for regular expression word end \< and \> instead of built-in table. --- src/RESearch.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/RESearch.h') diff --git a/src/RESearch.h b/src/RESearch.h index a558b371d..25205951f 100644 --- a/src/RESearch.h +++ b/src/RESearch.h @@ -18,7 +18,7 @@ #define BITBLK MAXCHR/CHRBIT class CharacterIndexer { -public: +public: virtual char CharAt(int index)=0; virtual ~CharacterIndexer() { } @@ -27,7 +27,7 @@ public: class RESearch { public: - RESearch(); + RESearch(CharClassify *charClassTable); ~RESearch(); void Init(); void Clear(); @@ -36,7 +36,6 @@ public: void ChSetWithCase(char c, bool caseSensitive); const char *Compile(const char *pat, int length, bool caseSensitive, bool posix); int Execute(CharacterIndexer &ci, int lp, int endp); - void ModifyWord(char *s); int Substitute(CharacterIndexer &ci, char *src, char *dst); enum {MAXTAG=10}; @@ -57,6 +56,10 @@ private: char bittab[BITBLK]; /* bit table for CCL */ /* pre-set bits... */ int failure; + CharClassify *charClass; + bool iswordc(unsigned char x) { + return charClass->IsWord(x); + } }; #endif -- cgit v1.2.3