diff options
author | nyamatongwe <unknown> | 2008-06-29 09:18:49 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2008-06-29 09:18:49 +0000 |
commit | c0e21edce865dad4431e8861cefa719f05d41baf (patch) | |
tree | 641f3e3b4b1237131a62c7089333109d3e4a80b8 /src/Document.h | |
parent | 9659de1f4d46343708afe84f05d54b019f55c315 (diff) | |
download | scintilla-mirror-c0e21edce865dad4431e8861cefa719f05d41baf.tar.gz |
Simon Steele's modification to allow replacing the regular
expression implementation.
Diffstat (limited to 'src/Document.h')
-rw-r--r-- | src/Document.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/Document.h b/src/Document.h index 04bbd5c74..0457b475b 100644 --- a/src/Document.h +++ b/src/Document.h @@ -74,7 +74,24 @@ public: class DocWatcher; class DocModification; -class RESearch; +class Document; + +/** + * Interface class for regular expression searching + */ +class RegexSearchBase { +public: + virtual ~RegexSearchBase(){} + + virtual long FindText(Document* doc, int minPos, int maxPos, const char *s, + bool caseSensitive, bool word, bool wordStart, int flags, int *length) = 0; + + ///@return String with the substitutions, must remain valid until the next call or destruction + virtual const char *SubstituteByPosition(Document* doc, const char *text, int *length) = 0; +}; + +/// Factory function for RegexSearchBase +extern RegexSearchBase* CreateRegexSearch(CharClassify *charClassTable); /** */ @@ -109,8 +126,7 @@ private: int lenWatchers; bool matchesValid; - RESearch *pre; - char *substituted; + RegexSearchBase* regex; public: int stylingBits; @@ -208,7 +224,7 @@ public: int Length() const { return cb.Length(); } void Allocate(int newSize) { cb.Allocate(newSize); } long FindText(int minPos, int maxPos, const char *s, - bool caseSensitive, bool word, bool wordStart, bool regExp, bool posix, int *length); + bool caseSensitive, bool word, bool wordStart, bool regExp, int flags, int *length); long FindText(int iMessage, unsigned long wParam, long lParam); const char *SubstituteByPosition(const char *text, int *length); int LinesTotal() const; |